Skip to content

Commit 023763d

Browse files
[pallet-revive-eth-rpc] persist eth transaction hash (paritytech#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: GitHub Action <[email protected]> Co-authored-by: command-bot <>
1 parent 105c5b9 commit 023763d

33 files changed

+2090
-472
lines changed

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ rustdocflags = [
99
CC_x86_64_unknown_linux_musl = { value = ".cargo/musl-gcc", force = true, relative = true }
1010
CXX_x86_64_unknown_linux_musl = { value = ".cargo/musl-g++", force = true, relative = true }
1111
CARGO_WORKSPACE_ROOT_DIR = { value = "", relative = true }
12+
SQLX_OFFLINE = "true"
1213

1314
[net]
1415
retry = 5

.github/workflows/build-publish-eth-rpc.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
env:
15-
IMAGE_NAME: "docker.io/paritypr/eth-rpc"
15+
ETH_RPC_IMAGE_NAME: "docker.io/paritypr/eth-rpc"
16+
ETH_INDEXER_IMAGE_NAME: "docker.io/paritypr/eth-indexer"
1617

1718
jobs:
1819
set-variables:
@@ -34,7 +35,7 @@ jobs:
3435
echo "set VERSION=${VERSION}"
3536
3637
build_docker:
37-
name: Build docker image
38+
name: Build docker images
3839
runs-on: parity-large
3940
needs: [set-variables]
4041
env:
@@ -43,17 +44,26 @@ jobs:
4344
- name: Check out the repo
4445
uses: actions/checkout@v4
4546

46-
- name: Build Docker image
47+
- name: Build eth-rpc Docker image
4748
uses: docker/build-push-action@v6
4849
with:
4950
context: .
50-
file: ./substrate/frame/revive/rpc/Dockerfile
51+
file: ./substrate/frame/revive/rpc/dockerfiles/eth-rpc/Dockerfile
5152
push: false
5253
tags: |
53-
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
54+
${{ env.ETH_RPC_IMAGE_NAME }}:${{ env.VERSION }}
55+
56+
- name: Build eth-indexer Docker image
57+
uses: docker/build-push-action@v6
58+
with:
59+
context: .
60+
file: ./substrate/frame/revive/rpc/dockerfiles/eth-indexer/Dockerfile
61+
push: false
62+
tags: |
63+
${{ env.ETH_INDEXER_IMAGE_NAME }}:${{ env.VERSION }}
5464
5565
build_push_docker:
56-
name: Build and push docker image
66+
name: Build and push docker images
5767
runs-on: parity-large
5868
if: github.ref == 'refs/heads/master'
5969
needs: [set-variables]
@@ -69,11 +79,20 @@ jobs:
6979
username: ${{ secrets.PARITYPR_DOCKERHUB_USERNAME }}
7080
password: ${{ secrets.PARITYPR_DOCKERHUB_PASSWORD }}
7181

72-
- name: Build Docker image
82+
- name: Build eth-rpc Docker image
83+
uses: docker/build-push-action@v6
84+
with:
85+
context: .
86+
file: ./substrate/frame/revive/rpc/dockerfiles/eth-rpc/Dockerfile
87+
push: true
88+
tags: |
89+
${{ env.ETH_RPC_IMAGE_NAME }}:${{ env.VERSION }}
90+
91+
- name: Build eth-indexer Docker image
7392
uses: docker/build-push-action@v6
7493
with:
7594
context: .
76-
file: ./substrate/frame/revive/rpc/Dockerfile
95+
file: ./substrate/frame/revive/rpc/dockerfiles/eth-indexer/Dockerfile
7796
push: true
7897
tags: |
79-
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
98+
${{ env.ETH_INDEXER_IMAGE_NAME }}:${{ env.VERSION }}

0 commit comments

Comments
 (0)