Skip to content
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

Open
pengin7384 opened this issue Apr 28, 2024 · 0 comments
Open

Optimize eth_getTransactionReceipt RPC #29669

pengin7384 opened this issue Apr 28, 2024 · 0 comments

Comments

@pengin7384
Copy link
Contributor

pengin7384 commented Apr 28, 2024

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 RPC

Implementation

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.

@pengin7384 pengin7384 changed the title Optimize getTransactionReceipt RPC logic Optimize eth_getTransactionReceipt RPC logic Apr 28, 2024
@pengin7384 pengin7384 changed the title Optimize eth_getTransactionReceipt RPC logic Optimize eth_getTransactionReceipt RPC Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant