Skip to content

optimise GetTransactionByHash and GetRawTransactionByHash #11347

Closed
@sudeepdino008

Description

Sudeep:

question about the RPC endpoints: GetTransactionByHash and GetRawTransactionByHash (in eth_txs.go)
both use BlockReader#TxnLookup which basically goes through different segments/indexes and return txnRlp and block number.
then txnRlp is ignored and block number is sent to eth_txs.go (where GetTx and GetRawTx is implemented). Then it fetches block and iterates through the tx and returns that tx.

wouldn't it be better just to use the txnRlp, rather than ignoring it? We can also ignore figuring out block number for this query. Is there a problem with removing the 2nd step above?

Alex Sharov GMT+7:

Probably you right.

Activity

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

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions