Skip to content

Removed callbacks from TxMempool#3410

Open
pompon0 wants to merge 50 commits into
mainfrom
gprusak-rpc-sharding8
Open

Removed callbacks from TxMempool#3410
pompon0 wants to merge 50 commits into
mainfrom
gprusak-rpc-sharding8

Conversation

@pompon0
Copy link
Copy Markdown
Contributor

@pompon0 pompon0 commented May 8, 2026

EVM keeper used to mirror mempool state to be able to track highest nonce per account in mempool, which required passing callbacks from EVM keeper to TxMempool. Additionally it passed a IsPending callback, so that TxMempool could verify if evm transaction is ready to be executed on demand. This pr is simplifying the execution flow as follows:

  • made Application take a LocalClient instead of generic Client, so that new Application -> Tendermint calls do not require exposing new network rpcs
  • added EVMNonce and EVMBalance methods to LocalClient so that Tendermint can evaluate evm tx eligibility without callbacks needed
  • removed callbacks from ResponseCheckTxV2
  • made GetTransactionCount EVM RPC call Tendermint to evaluate the high nonce in mempool per account instead of mirroring mempool state.

Additionally

  • marked some config fields as deprecated, given that only local tendermint node is supported
  • changed type of evm address fields from hex encoded string to common.Address
  • removed expirationIndex, since it was just mirroring txStore.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 8, 2026, 1:49 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 45.61129% with 347 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.14%. Comparing base (c7e729a) to head (e345b59).

Files with missing lines Patch % Lines
sei-tendermint/internal/mempool/mempool.go 62.50% 28 Missing and 11 partials ⚠️
sei-cosmos/server/start.go 16.66% 24 Missing and 1 partial ⚠️
sei-tendermint/abci/types/mocks/application.go 0.00% 21 Missing ⚠️
sei-tendermint/rpc/client/local/local.go 19.23% 21 Missing ⚠️
app/abci.go 6.66% 14 Missing ⚠️
sei-cosmos/x/gov/client/utils/query.go 26.31% 13 Missing and 1 partial ⚠️
sei-cosmos/client/rpc/validators.go 7.14% 13 Missing ⚠️
sei-cosmos/x/auth/client/cli/query.go 0.00% 11 Missing ⚠️
sei-cosmos/client/rpc/status.go 16.66% 9 Missing and 1 partial ⚠️
sei-wasmd/x/wasm/client/cli/gov_tx.go 0.00% 10 Missing ⚠️
... and 49 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3410      +/-   ##
==========================================
- Coverage   59.17%   59.14%   -0.03%     
==========================================
  Files        2108     2108              
  Lines      173660   173575      -85     
==========================================
- Hits       102770   102668     -102     
- Misses      62008    62028      +20     
+ Partials     8882     8879       -3     
Flag Coverage Δ
sei-chain-pr 55.13% <45.61%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/legacyabci/deliver_tx.go 95.83% <100.00%> (ø)
evmrpc/association.go 44.53% <ø> (ø)
evmrpc/block.go 82.49% <100.00%> (ø)
evmrpc/filter.go 65.28% <ø> (ø)
evmrpc/info.go 78.52% <100.00%> (ø)
evmrpc/net.go 33.33% <100.00%> (ø)
evmrpc/send.go 46.25% <ø> (ø)
evmrpc/server.go 91.54% <ø> (ø)
evmrpc/simulate.go 74.36% <ø> (ø)
evmrpc/state.go 59.05% <100.00%> (ø)
... and 80 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

err = txmp.addNewTransaction(wtx, res.ResponseCheckTx, txInfo)
if err != nil {
if !txmp.isPending(wtx) {
if err := txmp.addNewTransaction(wtx); err != nil {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addNewTransaction may return nil when the tx isn't really inserted because of capacity. This wasn't an issue before but becomes one now because we don't want to txmp.addNonce(wtx) below in such cases. I think we can just make addNewTransaction return error https://github.com/sei-protocol/sei-chain/pull/3410/changes#diff-91c10e3fa6ed77b7ad77bae9a7cfbc8b102e837fdf521fa96817ef134b65f05aR934

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants