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

[pallet-revive-eth-rpc] persist eth transaction hash #6836

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

pgherveou
Copy link
Contributor

@pgherveou pgherveou commented Dec 10, 2024

Add an option to persist EVM transaction hash to a SQL db.
This make it possible to run a full archive ETH RPC node (assuming the substrate node is also a full archive node)

Some queries such as eth_getTransactionByHash, eth_getBlockTransactionCountByHash, and other need to work with a transaction hash index, which is not available in Substrate and need to be stored by the eth-rpc proxy.

The refactoring break down the Client into a BlockInfoProvider and ReceiptProvider

  • BlockInfoProvider does not need any persistence data, as we can fetch all block info from the source substrate chain
  • ReceiptProvider comes in two flavor,
    • An in memory cache implementation - This is the one we had so far.
    • A DB implementation - This one persist rows with the block_hash, the transaction_index and the transaction_hash, so that we can later fetch the block and extrinsic for that receipt and reconstruct the ReceiptInfo object.

@pgherveou
Copy link
Contributor Author

/cmd prdoc --audience runtime_dev --bump minor

@pgherveou pgherveou added T7-smart_contracts This PR/Issue is related to smart contracts. R0-silent Changes should not be mentioned in any release notes labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T7-smart_contracts This PR/Issue is related to smart contracts.
Projects
Status: Minimal Feature Launch
Development

Successfully merging this pull request may close these issues.

1 participant