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
Optimize eth_getTransactionReceipt
RPC
#29669
Labels
Comments
pengin7384
changed the title
Optimize getTransactionReceipt RPC logic
Optimize Apr 28, 2024
eth_getTransactionReceipt
RPC logic
pengin7384
changed the title
Optimize
Optimize Apr 28, 2024
eth_getTransactionReceipt
RPC logiceth_getTransactionReceipt
RPC
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rationale
Why should this feature exist?
We're getting the receipts of all transactions in a block to get a single transaction receipt.
Internally, all block receipts are stored as one in database, so getting them all is not a problem.
The problem is that the process of getting a receipt is not all about getting it from database, but some receipt fields need to be filled out by gathering various information (receipt.go/DeriveFields).
There are at least 10 of these fields, some of which require computational calculations, such as
effectiveGasPrice
.And for contract creation transaction, Sender derivation, which is an expensive operation, must be performed to obtain the contract address.
Therefore, I suggest performing this logic only for a specific receipt and not for all receipts.
This work will prevent unnecessary copying and computation.
Originally, it occurred as many transactions as the number of transactions in the block, but It is reduced to one time.
What are the use-cases?
eth_getTransactionReceipt
RPCImplementation
Do you have ideas regarding the implementation of this feature?
Create a new
DeriveField
function that operates on a single receipt.And make
getTransactionReceipt
API to use the new function that only derive a single receipt.Then, Derivation logic will now be performed only for a specific transaction, not for all transactions in the block.
Are you willing to implement this feature? Yes, I'm submitting an issue after testing, so the PR is already prepared. I'll also open a related PR after the issue is published.
The text was updated successfully, but these errors were encountered: