optimizations of Tx Hash handling#3314
Conversation
pompon0
commented
Apr 27, 2026
- Merged Tx.Hash and Tx.Key into one method to avoid confusion
- Added hashedTx wrapper type which keeps precomputed TxHash
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| }, []*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}, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.