Skip to content
Snippets Groups Projects
Unverified Commit 023763da authored by PG Herveou's avatar PG Herveou Committed by GitHub
Browse files

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


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 indexes, which are not stored 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.

---------

Co-authored-by: default avatarGitHub Action <action@github.com>
Co-authored-by: command-bot <>
parent 105c5b94
No related merge requests found
Pipeline #511551 waiting for manual action with stages
in 30 minutes and 25 seconds
Showing
with 792 additions and 129 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment