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 1 commit into
base: pg/fix-gas-encoding
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 should 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.

This PR also adds a new binary eth-indexer, that iterate past and new blocks and write the receipt hashes to the DB using the new ReceiptProvider.

@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
@pgherveou pgherveou changed the base branch from master to pg/fix-gas-encoding December 19, 2024 20:32
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/12420337575
Failed job name: cargo-clippy

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