-
Notifications
You must be signed in to change notification settings - Fork 808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use tendermint store to get Tx hashes instead of storing explicitly #1913
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are some rpc calls that test this?
- a little worried about performance impact
- i'd also like to vierfy it on a loadtest cluster later today
evmrpc/block.go
Outdated
for i, tx := range block.Block.Data.Txs { | ||
sdkTx, err := a.txConfig.TxDecoder()(tx) | ||
if err != nil { | ||
fmt.Printf("error decoding tx %d in block %d, skipping\n", i, height) | ||
continue | ||
} | ||
if len(sdkTx.GetMsgs()) == 0 { | ||
continue | ||
} | ||
if evmTx, ok := sdkTx.GetMsgs()[0].(*types.MsgEVMTransaction); ok { | ||
if evmTx.IsAssociateTx() { | ||
continue | ||
} | ||
ethtx, _ := evmTx.AsTransaction() | ||
txHashes = append(txHashes, ethtx.Hash()) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - shoudl we consider moving this to a helper function so it can be reused in filter.go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Describe your changes and provide context
EVM Tx hashes are used for certain EVM RPC queries. Storing EVM Tx hashes explicitly as app state has been causing state bloat. This information is actually already stored in Tendermint block store. This PR changes relevant RPC endpoints to read from Tendermint instead of hashes in app state. Once we are confident that the change is not interruptive to current use cases out there, we can remove the tx hash writing logic and delete the app state.
Testing performed to validate your change
existing unit test should still work