Skip to content

Commit 190742e

Browse files
build(deps): bump alloy from 1.7.3 to 2.0.0 (#6501)
* build(deps): bump alloy from 1.7.3 to 2.0.0 Bumps [alloy](https://github.com/alloy-rs/alloy) from 1.7.3 to 2.0.0. - [Release notes](https://github.com/alloy-rs/alloy/releases) - [Changelog](https://github.com/alloy-rs/alloy/blob/main/CHANGELOG.md) - [Commits](alloy-rs/alloy@v1.7.3...v2.0.0) --- updated-dependencies: - dependency-name: alloy dependency-version: 2.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * all: Fix compilation for alloy 2.0.0 upgrade - Add AnyTransactionRequest newtype for split TransactionBuilder traits - Bump alloy-rpc-types to 2.0.0 - Add block_timestamp field to Transaction struct literals - Add Amsterdam hardfork header fields (block_access_list_hash, slot_number) - Remove .with_recommended_fillers() (now handled by .network()) * all: Install rustls aws_lc_rs as default crypto provider With alloy 2.0.0 pulling in rustls with aws_lc_rs and object_store (via reqwest) pulling in rustls with ring, rustls 0.23 refuses to auto-pick and panics on first TLS use. Install aws_lc_rs explicitly at each binary/test-harness entry point via a shared helper. * graph: Add serde(transparent) to AnyTransactionRequest Without this, serde wraps the inner WithOtherFields<TransactionRequest> in an extra struct layer when serializing, which would produce malformed JSON for eth_call RPC requests. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: incrypto32 <vpkrishnanand@gmail.com>
1 parent 4630a01 commit 190742e

16 files changed

Lines changed: 589 additions & 229 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ repository = "https://github.com/graphprotocol/graph-node"
3535
license = "MIT OR Apache-2.0"
3636

3737
[workspace.dependencies]
38-
alloy = { version = "1.7.3", features = ["dyn-abi", "json-abi", "full", "arbitrary", "json-rpc", "serde"] }
39-
alloy-rpc-types = "1.0.33"
38+
alloy = { version = "2.0.0", features = ["dyn-abi", "json-abi", "full", "arbitrary", "json-rpc", "serde"] }
39+
alloy-rpc-types = "2.0.0"
40+
# rustls is pulled in transitively by alloy (aws_lc_rs) and object_store via
41+
# reqwest (ring). With both providers linked, rustls 0.23 requires an explicit
42+
# default provider to be installed before any TLS use. We install aws_lc_rs
43+
# explicitly in each binary/test entry point.
44+
rustls = { version = "0.23", default-features = false, features = ["aws_lc_rs"] }
4045
anyhow = "1.0"
4146
async-graphql = { version = "7.2.1", features = ["chrono"] }
4247
async-graphql-axum = "7.2.1"

chain/ethereum/src/codec.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ impl<'a> TryInto<Transaction<AnyTxEnvelope>> for TransactionTraceAt<'a> {
162162
// Extract data from trace and block
163163
let block_hash = self.block.hash.try_decode_proto("transaction block hash")?;
164164
let block_number = self.block.number;
165+
let block_timestamp = self
166+
.block
167+
.header
168+
.as_ref()
169+
.and_then(|h| h.timestamp.as_ref().map(|t| t.seconds as u64));
165170
let transaction_index = Some(self.trace.index as u64);
166171
let from_address = self
167172
.trace
@@ -241,6 +246,7 @@ impl<'a> TryInto<Transaction<AnyTxEnvelope>> for TransactionTraceAt<'a> {
241246
inner: recovered,
242247
block_hash: Some(block_hash),
243248
block_number: Some(block_number),
249+
block_timestamp,
244250
transaction_index,
245251
effective_gas_price: if gas_price > 0 { Some(gas_price) } else { None },
246252
});
@@ -451,6 +457,7 @@ impl<'a> TryInto<Transaction<AnyTxEnvelope>> for TransactionTraceAt<'a> {
451457
inner: recovered,
452458
block_hash: Some(block_hash),
453459
block_number: Some(block_number),
460+
block_timestamp,
454461
transaction_index,
455462
effective_gas_price: if gas_price > 0 { Some(gas_price) } else { None }, // gas_price already contains effective gas price per protobuf spec
456463
})
@@ -528,6 +535,8 @@ impl TryInto<AnyBlock> for &Block {
528535
} else {
529536
Some(header.requests_hash.try_decode_proto("requests hash")?)
530537
},
538+
block_access_list_hash: None,
539+
slot_number: None,
531540
};
532541

533542
let rpc_header = alloy::rpc::types::Header {

chain/ethereum/src/data_source.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ fn create_dummy_transaction(
468468
inner: recovered,
469469
block_hash: Some(block_hash),
470470
block_number: Some(block_number),
471+
block_timestamp: None,
471472
transaction_index,
472473
effective_gas_price: None,
473474
})

chain/ethereum/src/ethereum_adapter.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,21 +174,18 @@ impl EthereumAdapter {
174174
Transport::RPC(client) => Arc::new(
175175
alloy::providers::ProviderBuilder::<_, _, AnyNetworkBare>::default()
176176
.network::<AnyNetworkBare>()
177-
.with_recommended_fillers()
178177
.connect_client(client.clone()),
179178
),
180179
Transport::IPC(ipc_connect) => Arc::new(
181180
alloy::providers::ProviderBuilder::<_, _, AnyNetworkBare>::default()
182181
.network::<AnyNetworkBare>()
183-
.with_recommended_fillers()
184182
.connect_ipc(ipc_connect.clone())
185183
.await
186184
.expect("Failed to connect to Ethereum IPC"),
187185
),
188186
Transport::WS(ws_connect) => Arc::new(
189187
alloy::providers::ProviderBuilder::<_, _, AnyNetworkBare>::default()
190188
.network::<AnyNetworkBare>()
191-
.with_recommended_fillers()
192189
.connect_ws(ws_connect.clone())
193190
.await
194191
.expect("Failed to connect to Ethereum WS"),
@@ -2790,7 +2787,6 @@ mod tests {
27902787
let asserter = Asserter::new();
27912788
let provider = ProviderBuilder::<_, _, AnyNetworkBare>::default()
27922789
.network::<AnyNetworkBare>()
2793-
.with_recommended_fillers()
27942790
.connect_mocked_client(asserter.clone());
27952791

27962792
asserter.push_success(&json_value);

gnd/src/commands/test/trigger.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ fn dummy_transaction(
446446
inner: Recovered::new_unchecked(envelope, Address::ZERO),
447447
block_hash: Some(block_hash),
448448
block_number: Some(block_number),
449+
block_timestamp: None,
449450
transaction_index: Some(transaction_index),
450451
effective_gas_price: None,
451452
}

gnd/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ fn run_indexer(args: Vec<OsString>) -> Result<()> {
224224

225225
#[tokio::main]
226226
async fn main() -> Result<()> {
227+
graph::tls::install_default_crypto_provider();
227228
unsafe {
228229
std::env::set_var("ETHEREUM_REORG_THRESHOLD", "10");
229230
std::env::set_var("GRAPH_NODE_DISABLE_DEPLOYMENT_HASH_VALIDATION", "true");

graph/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ chrono = "0.4.44"
2727
envconfig = { workspace = true }
2828
Inflector = "0.11.3"
2929
reqwest = { version = "0.12.23", features = ["json", "stream", "multipart", "gzip", "brotli", "deflate"] }
30+
rustls = { workspace = true }
3031
hex = "0.4.3"
3132
http0 = { version = "0", package = "http" }
3233
http = "1"

0 commit comments

Comments
 (0)