Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
542 changes: 368 additions & 174 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ repository = "https://github.com/graphprotocol/graph-node"
license = "MIT OR Apache-2.0"

[workspace.dependencies]
alloy = { version = "1.7.3", features = ["dyn-abi", "json-abi", "full", "arbitrary", "json-rpc", "serde"] }
alloy-rpc-types = "1.0.33"
alloy = { version = "2.0.0", features = ["dyn-abi", "json-abi", "full", "arbitrary", "json-rpc", "serde"] }
alloy-rpc-types = "2.0.0"
# rustls is pulled in transitively by alloy (aws_lc_rs) and object_store via
# reqwest (ring). With both providers linked, rustls 0.23 requires an explicit
# default provider to be installed before any TLS use. We install aws_lc_rs
# explicitly in each binary/test entry point.
rustls = { version = "0.23", default-features = false, features = ["aws_lc_rs"] }
anyhow = "1.0"
async-graphql = { version = "7.2.1", features = ["chrono"] }
async-graphql-axum = "7.2.1"
Expand Down
9 changes: 9 additions & 0 deletions chain/ethereum/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ impl<'a> TryInto<Transaction<AnyTxEnvelope>> for TransactionTraceAt<'a> {
// Extract data from trace and block
let block_hash = self.block.hash.try_decode_proto("transaction block hash")?;
let block_number = self.block.number;
let block_timestamp = self
.block
.header
.as_ref()
.and_then(|h| h.timestamp.as_ref().map(|t| t.seconds as u64));
let transaction_index = Some(self.trace.index as u64);
let from_address = self
.trace
Expand Down Expand Up @@ -241,6 +246,7 @@ impl<'a> TryInto<Transaction<AnyTxEnvelope>> for TransactionTraceAt<'a> {
inner: recovered,
block_hash: Some(block_hash),
block_number: Some(block_number),
block_timestamp,
transaction_index,
effective_gas_price: if gas_price > 0 { Some(gas_price) } else { None },
});
Expand Down Expand Up @@ -451,6 +457,7 @@ impl<'a> TryInto<Transaction<AnyTxEnvelope>> for TransactionTraceAt<'a> {
inner: recovered,
block_hash: Some(block_hash),
block_number: Some(block_number),
block_timestamp,
transaction_index,
effective_gas_price: if gas_price > 0 { Some(gas_price) } else { None }, // gas_price already contains effective gas price per protobuf spec
})
Expand Down Expand Up @@ -528,6 +535,8 @@ impl TryInto<AnyBlock> for &Block {
} else {
Some(header.requests_hash.try_decode_proto("requests hash")?)
},
block_access_list_hash: None,
slot_number: None,
};

let rpc_header = alloy::rpc::types::Header {
Expand Down
1 change: 1 addition & 0 deletions chain/ethereum/src/data_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ fn create_dummy_transaction(
inner: recovered,
block_hash: Some(block_hash),
block_number: Some(block_number),
block_timestamp: None,
transaction_index,
effective_gas_price: None,
})
Expand Down
4 changes: 0 additions & 4 deletions chain/ethereum/src/ethereum_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,18 @@ impl EthereumAdapter {
Transport::RPC(client) => Arc::new(
alloy::providers::ProviderBuilder::<_, _, AnyNetworkBare>::default()
.network::<AnyNetworkBare>()
.with_recommended_fillers()
.connect_client(client.clone()),
),
Transport::IPC(ipc_connect) => Arc::new(
alloy::providers::ProviderBuilder::<_, _, AnyNetworkBare>::default()
.network::<AnyNetworkBare>()
.with_recommended_fillers()
.connect_ipc(ipc_connect.clone())
.await
.expect("Failed to connect to Ethereum IPC"),
),
Transport::WS(ws_connect) => Arc::new(
alloy::providers::ProviderBuilder::<_, _, AnyNetworkBare>::default()
.network::<AnyNetworkBare>()
.with_recommended_fillers()
.connect_ws(ws_connect.clone())
.await
.expect("Failed to connect to Ethereum WS"),
Expand Down Expand Up @@ -2779,7 +2776,6 @@ mod tests {
let asserter = Asserter::new();
let provider = ProviderBuilder::<_, _, AnyNetworkBare>::default()
.network::<AnyNetworkBare>()
.with_recommended_fillers()
.connect_mocked_client(asserter.clone());

asserter.push_success(&json_value);
Expand Down
1 change: 1 addition & 0 deletions gnd/src/commands/test/trigger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ fn dummy_transaction(
inner: Recovered::new_unchecked(envelope, Address::ZERO),
block_hash: Some(block_hash),
block_number: Some(block_number),
block_timestamp: None,
transaction_index: Some(transaction_index),
effective_gas_price: None,
}
Expand Down
1 change: 1 addition & 0 deletions gnd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ fn generate_completions(completions_opt: CompletionsOpt) -> Result<()> {

#[tokio::main]
async fn main() -> Result<()> {
graph::tls::install_default_crypto_provider();
std::env::set_var("ETHEREUM_REORG_THRESHOLD", "10");
std::env::set_var("GRAPH_NODE_DISABLE_DEPLOYMENT_HASH_VALIDATION", "true");
env_logger::init();
Expand Down
1 change: 1 addition & 0 deletions graph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ chrono = "0.4.44"
envconfig = { workspace = true }
Inflector = "0.11.3"
reqwest = { version = "0.12.23", features = ["json", "stream", "multipart", "gzip", "brotli", "deflate"] }
rustls = { workspace = true }
hex = "0.4.3"
http0 = { version = "0", package = "http" }
http = "1"
Expand Down
Loading
Loading