Skip to content

Commit c89dc3a

Browse files
committed
chain/ethereum: Implment rpc metrics collection with alloy
1 parent 8444cd5 commit c89dc3a

File tree

5 files changed

+84
-139
lines changed

5 files changed

+84
-139
lines changed

Cargo.lock

Lines changed: 6 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ repository = "https://github.com/graphprotocol/graph-node"
3838
license = "MIT OR Apache-2.0"
3939

4040
[workspace.dependencies]
41-
alloy = { version = "0.15.10", features = ["full", "arbitrary"] }
41+
alloy = { version = "0.15.10", features = ["full", "json-rpc"] }
4242
alloy-rpc-types = "0.15.10"
4343
anyhow = "1.0"
4444
async-graphql = { version = "7.0.15", features = ["chrono"] }
@@ -95,6 +95,7 @@ thiserror = "2.0.12"
9595
tokio = { version = "1.45.1", features = ["full"] }
9696
tonic = { version = "0.12.3", features = ["tls-roots", "gzip"] }
9797
tonic-build = { version = "0.12.3", features = ["prost"] }
98+
tower = { version = "0.5.1", features = ["full"] }
9899
tower-http = { version = "0.5.2", features = ["cors"] }
99100
wasmparser = "0.118.1"
100101
wasmtime = "33.0.0"

chain/ethereum/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ tiny-keccak = "1.5.0"
1515
hex = "0.4.3"
1616
semver = "1.0.23"
1717
thiserror = { workspace = true }
18+
tower = { workspace = true }
1819

1920
itertools = "0.14.0"
2021

chain/ethereum/src/ethereum_adapter.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,9 @@ impl EthereumAdapter {
140140
call_only: bool,
141141
) -> Self {
142142
let alloy = match &transport {
143-
Transport::RPC { client, .. } => Arc::new(
144-
alloy::providers::ProviderBuilder::new()
145-
.connect_client(alloy::rpc::client::RpcClient::new(client.clone(), false)),
146-
),
143+
Transport::RPC { client, .. } => {
144+
Arc::new(alloy::providers::ProviderBuilder::new().connect_client(client.clone()))
145+
}
147146
Transport::IPC(ipc_connect) => Arc::new(
148147
alloy::providers::ProviderBuilder::new()
149148
.connect_ipc(ipc_connect.clone())

0 commit comments

Comments
 (0)