Skip to content

optimizations of Tx Hash handling#3314

Merged
pompon0 merged 11 commits into
mainfrom
gprusak-txkey
Apr 28, 2026
Merged

optimizations of Tx Hash handling#3314
pompon0 merged 11 commits into
mainfrom
gprusak-txkey

Conversation

@pompon0

@pompon0 pompon0 commented Apr 27, 2026

Copy link
Copy Markdown
Contributor
  • Merged Tx.Hash and Tx.Key into one method to avoid confusion
  • Added hashedTx wrapper type which keeps precomputed TxHash

@github-actions

github-actions Bot commented Apr 27, 2026

Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 28, 2026, 1:52 PM

@pompon0 pompon0 marked this pull request as ready for review April 27, 2026 13:16
@codecov

codecov Bot commented Apr 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.70093% with 52 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.23%. Comparing base (d67dd88) to head (cbcd939).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sei-tendermint/internal/mempool/mempool.go 56.25% 19 Missing and 2 partials ⚠️
sei-tendermint/internal/state/execution.go 20.00% 8 Missing ⚠️
app/ante/evm_checktx.go 0.00% 4 Missing ⚠️
giga/deps/xevm/keeper/keeper.go 75.00% 3 Missing and 1 partial ⚠️
x/evm/keeper/keeper.go 75.00% 3 Missing and 1 partial ⚠️
sei-tendermint/internal/rpc/core/mempool.go 57.14% 3 Missing ⚠️
sei-tendermint/types/mempool.go 83.33% 3 Missing ⚠️
x/evm/ante/sig.go 50.00% 2 Missing ⚠️
sei-cosmos/server/rosetta/client_online.go 0.00% 1 Missing ⚠️
sei-tendermint/internal/consensus/state.go 66.66% 1 Missing ⚠️
... and 1 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3314      +/-   ##
==========================================
+ Coverage   59.19%   59.23%   +0.03%     
==========================================
  Files        2097     2097              
  Lines      172482   172493      +11     
==========================================
+ Hits       102106   102170      +64     
+ Misses      61532    61490      -42     
+ Partials     8844     8833      -11     
Flag Coverage Δ
sei-chain-pr 68.31% <75.70%> (?)
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
sei-tendermint/crypto/crypto.go 100.00% <100.00%> (ø)
sei-tendermint/crypto/merkle/hash.go 100.00% <100.00%> (ø)
sei-tendermint/internal/mempool/cache.go 96.93% <100.00%> (ø)
sei-tendermint/internal/mempool/reactor/reactor.go 84.09% <100.00%> (ø)
sei-tendermint/internal/mempool/tx.go 78.00% <100.00%> (+0.11%) ⬆️
sei-tendermint/internal/rpc/core/tx.go 64.78% <100.00%> (ø)
sei-tendermint/internal/state/indexer/tx/kv/kv.go 66.21% <100.00%> (+0.11%) ⬆️
sei-tendermint/rpc/coretypes/requests.go 71.05% <ø> (ø)
sei-tendermint/types/block.go 86.19% <100.00%> (ø)
sei-tendermint/types/evidence.go 75.65% <100.00%> (+0.10%) ⬆️
... and 13 more

... and 6 files 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.

}, []*WrappedTx{
{isEVM: true, evmAddress: "addr1", evmNonce: 0, priority: 100, tx: []byte("def")},
{isEVM: true, evmAddress: "addr1", evmNonce: 1, priority: 100, tx: []byte("abc")},
{hashedTx: newHashedTx(types.Tx("def")), isEVM: true, evmAddress: "addr1", evmNonce: 0, priority: 100},

@wen-coding wen-coding Apr 27, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: I like what you are doing in this PR. But I'm a bit worried that we need to change so many tests. Would it make our lives easier to have a constructor
NewWrappedTx(tx types.Tx, opts...) instead so we don't give the tests a chance to know about newHashedTx?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Although I do agree that strengthening WrappedTx type and making tests internals agnostic would benefit the correctness, I decided to scope down this pr to just hash field protection to limit the diff size. Afaict all the test changes are mechanical and personally I feel comfortable with making them.

@pompon0 pompon0 added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit 4bfc254 Apr 28, 2026
38 checks passed
@pompon0 pompon0 deleted the gprusak-txkey branch April 28, 2026 14:50
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