Skip to content

Commit d820f77

Browse files
authored
build(deps): fix toolshed deps (#118)
* build(deps): Use thegraph::types::Address (0.5.0) instead of alloy's directly Signed-off-by: Alexis Asseman <[email protected]> * build(deps): Set crate versions graphql-v0.3.0 and graphql-http-v0.2.1 Signed-off-by: Alexis Asseman <[email protected]> --------- Signed-off-by: Alexis Asseman <[email protected]>
1 parent d16470f commit d820f77

27 files changed

+235
-115
lines changed

Cargo.lock

+179-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
alloy-primitives = { version = "0.5.2", features = ["serde"] }
8-
alloy-sol-types = "0.5.2"
7+
alloy-primitives = { version = "0.6", features = ["serde"] }
8+
alloy-sol-types = "0.6"
99
anyhow = "1.0.75"
1010
arc-swap = "1.6.0"
1111
ethers = "2.0.10"
@@ -30,11 +30,11 @@ sqlx = { version = "0.7.1", features = [
3030
"time",
3131
] }
3232
tokio = { version = "1.32.0", features = ["full", "macros", "rt"] }
33-
thegraph = { git = "https://github.com/edgeandnode/toolshed", branch = "main" }
34-
graphql-http = { git = "https://github.com/edgeandnode/toolshed", branch = "main", features = [
33+
thegraph = { git = "https://github.com/edgeandnode/toolshed", tag = "thegraph-v0.5.0" }
34+
graphql-http = { git = "https://github.com/edgeandnode/toolshed", tag = "graphql-http-v0.2.1", features = [
3535
"http-reqwest",
3636
] }
37-
tap_core = "0.7.0"
37+
tap_core = { git = "https://github.com/semiotic-ai/timeline-aggregation-protocol", branch = "aasseman/tap_core_0_7_0_fix_toolshed_dep" }
3838
axum = { version = "0.6.20", default_features = true, features = ["headers"] }
3939
thiserror = "1.0.49"
4040
async-trait = "0.1.74"

common/src/allocations/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright 2023-, GraphOps and Semiotic Labs.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
use alloy_primitives::Address;
54
use ethers_core::types::U256;
65
use serde::{Deserialize, Deserializer};
6+
use thegraph::types::Address;
77
use thegraph::types::DeploymentId;
88

99
pub mod monitor;

common/src/allocations/monitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
use std::{collections::HashMap, time::Duration};
55

6-
use alloy_primitives::Address;
76
use anyhow::anyhow;
87
use eventuals::{timer, Eventual, EventualExt};
98
use serde::Deserialize;
9+
use thegraph::types::Address;
1010
use tokio::time::sleep;
1111
use tracing::warn;
1212

common/src/attestations/dispute_manager.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
use std::time::Duration;
55

6-
use alloy_primitives::Address;
76
use eventuals::{timer, Eventual, EventualExt};
87
use serde::Deserialize;
8+
use thegraph::types::Address;
99
use tokio::time::sleep;
1010
use tracing::warn;
1111

common/src/attestations/signer.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Copyright 2023-, GraphOps and Semiotic Labs.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
use alloy_primitives::{Address, U256};
54
use alloy_sol_types::Eip712Domain;
65
use ethers::signers::coins_bip39::English;
76
use ethers::signers::{MnemonicBuilder, Signer, Wallet};
87
use ethers_core::k256::ecdsa::SigningKey;
98
use thegraph::types::{attestation, Attestation, DeploymentId};
9+
use thegraph::types::{Address, U256};
1010

1111
use crate::prelude::Allocation;
1212

@@ -124,7 +124,6 @@ fn wallet_for_allocation(
124124

125125
#[cfg(test)]
126126
mod tests {
127-
use alloy_primitives::Address;
128127
use ethers_core::types::U256;
129128
use std::str::FromStr;
130129
use test_log::test;

common/src/attestations/signers.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Copyright 2023-, GraphOps and Semiotic Labs.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
use alloy_primitives::Address;
54
use ethers_core::types::U256;
65
use eventuals::{join, Eventual, EventualExt};
76
use std::collections::HashMap;
87
use std::sync::Arc;
8+
use thegraph::types::Address;
99
use tokio::sync::Mutex;
1010
use tracing::warn;
1111

@@ -61,8 +61,6 @@ pub fn attestation_signers(
6161

6262
#[cfg(test)]
6363
mod tests {
64-
use alloy_primitives::Address;
65-
6664
use crate::test_vectors::{
6765
DISPUTE_MANAGER_ADDRESS, INDEXER_ALLOCATIONS, INDEXER_OPERATOR_MNEMONIC,
6866
};

common/src/escrow_accounts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ use std::{
66
time::Duration,
77
};
88

9-
use alloy_primitives::Address;
109
use anyhow::Result;
1110
use ethers_core::types::U256;
1211
use eventuals::{timer, Eventual, EventualExt};
1312
use serde::Deserialize;
13+
use thegraph::types::Address;
1414
use thiserror::Error;
1515
use tokio::time::sleep;
1616
use tracing::{error, warn};

common/src/indexer_service/http/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
use std::net::SocketAddr;
55

6-
use alloy_primitives::Address;
76
use serde::{Deserialize, Serialize};
7+
use thegraph::types::Address;
88
use thegraph::types::DeploymentId;
99

1010
#[derive(Clone, Debug, Deserialize, Serialize)]

common/src/indexer_service/http/indexer_service.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::{
66
time::Duration,
77
};
88

9-
use alloy_primitives::Address;
109
use alloy_sol_types::eip712_domain;
1110
use anyhow;
1211
use autometrics::prometheus_exporter;
@@ -23,6 +22,7 @@ use eventuals::Eventual;
2322
use reqwest::StatusCode;
2423
use serde::{de::DeserializeOwned, Serialize};
2524
use sqlx::postgres::PgPoolOptions;
25+
use thegraph::types::Address;
2626
use thegraph::types::{Attestation, DeploymentId};
2727
use thiserror::Error;
2828
use tokio::signal;

common/src/indexer_service/http/scalar_receipt_header.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ impl Header for ScalarReceipt {
6161
mod test {
6262
use std::str::FromStr;
6363

64-
use alloy_primitives::Address;
6564
use axum::{headers::Header, http::HeaderValue};
65+
use thegraph::types::Address;
6666

6767
use crate::test_vectors::create_signed_receipt;
6868

common/src/signature_verification.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Copyright 2023-, GraphOps and Semiotic Labs.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
use alloy_primitives::Address;
54
use arc_swap::ArcSwap;
65
use keccak_hash::keccak;
76
use lazy_static::lazy_static;
87
use secp256k1::{ecdsa::RecoverableSignature, Message, PublicKey, Secp256k1, VerifyOnly};
98
use std::sync::Arc;
9+
use thegraph::types::Address;
1010

1111
lazy_static! {
1212
static ref SECP256K1: Secp256k1<VerifyOnly> = Secp256k1::verification_only();

common/src/tap_manager.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
use alloy_primitives::hex::ToHex;
5-
use alloy_primitives::Address;
65
use alloy_sol_types::Eip712Domain;
76
use anyhow::anyhow;
87
use ethers_core::types::U256;
@@ -12,6 +11,7 @@ use sqlx::{types::BigDecimal, PgPool};
1211
use std::collections::HashSet;
1312
use std::{collections::HashMap, str::FromStr, sync::Arc};
1413
use tap_core::tap_manager::SignedReceipt;
14+
use thegraph::types::Address;
1515
use tokio::sync::RwLock;
1616
use tracing::error;
1717

@@ -246,7 +246,6 @@ mod test {
246246
use std::str::FromStr;
247247

248248
use crate::prelude::{AllocationStatus, SubgraphDeployment};
249-
use alloy_primitives::Address;
250249
use keccak_hash::H256;
251250
use sqlx::postgres::PgListener;
252251

common/src/test_vectors.rs

+9-17
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
use std::{collections::HashMap, str::FromStr};
55

6-
use alloy_primitives::Address;
76
use alloy_sol_types::{eip712_domain, Eip712Domain};
87
use ethers::signers::{coins_bip39::English, LocalWallet, MnemonicBuilder, Signer};
98
use ethers_core::types::U256;
109
use lazy_static::lazy_static;
1110
use tap_core::{
1211
eip_712_signed_message::EIP712SignedMessage, tap_manager::SignedReceipt, tap_receipt::Receipt,
1312
};
13+
use thegraph::types::Address;
1414
use thegraph::types::DeploymentId;
1515

1616
use crate::prelude::{Allocation, AllocationStatus, SubgraphDeployment};
@@ -166,11 +166,9 @@ lazy_static! {
166166
created_at_epoch: 953,
167167
closed_at_epoch: None,
168168
subgraph_deployment: SubgraphDeployment {
169-
id: DeploymentId(
169+
id: DeploymentId::from_str(
170170
"0xbbde25a2c85f55b53b7698b9476610c3d1202d88870e66502ab0076b7218f98a"
171-
.parse()
172-
.unwrap(),
173-
),
171+
).unwrap(),
174172
denied_at: Some(0),
175173
},
176174
status: AllocationStatus::Null,
@@ -192,11 +190,9 @@ lazy_static! {
192190
created_at_epoch: 953,
193191
closed_at_epoch: None,
194192
subgraph_deployment: SubgraphDeployment {
195-
id: DeploymentId(
193+
id: DeploymentId::from_str(
196194
"0xcda7fa0405d6fd10721ed13d18823d24b535060d8ff661f862b26c23334f13bf"
197-
.parse()
198-
.unwrap(),
199-
),
195+
).unwrap(),
200196
denied_at: Some(0),
201197
},
202198
status: AllocationStatus::Null,
@@ -218,11 +214,9 @@ lazy_static! {
218214
created_at_epoch: 940,
219215
closed_at_epoch: Some(953),
220216
subgraph_deployment: SubgraphDeployment {
221-
id: DeploymentId(
217+
id: DeploymentId::from_str(
222218
"0xbbde25a2c85f55b53b7698b9476610c3d1202d88870e66502ab0076b7218f98a"
223-
.parse()
224-
.unwrap(),
225-
),
219+
).unwrap(),
226220
denied_at: Some(0),
227221
},
228222
status: AllocationStatus::Null,
@@ -244,11 +238,9 @@ lazy_static! {
244238
created_at_epoch: 940,
245239
closed_at_epoch: Some(953),
246240
subgraph_deployment: SubgraphDeployment {
247-
id: DeploymentId(
241+
id: DeploymentId::from_str(
248242
"0xc064c354bc21dd958b1d41b67b8ef161b75d2246b425f68ed4c74964ae705cbd"
249-
.parse()
250-
.unwrap(),
251-
),
243+
).unwrap(),
252244
denied_at: Some(0),
253245
},
254246
status: AllocationStatus::Null,

service/Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ autometrics = { version = "0.3.3", features = ["prometheus-exporter"] }
4545
clap = { version = "4.3.1", features = ["derive", "env"] }
4646
prometheus = "0.13.3"
4747
hex = "0.4.3"
48-
tap_core = "0.7.0"
48+
tap_core = { git = "https://github.com/semiotic-ai/timeline-aggregation-protocol", branch = "aasseman/tap_core_0_7_0_fix_toolshed_dep" }
4949
ethereum-types = "0.14.1"
5050
sqlx = { version = "0.7.1", features = [
5151
"postgres",
@@ -54,12 +54,12 @@ sqlx = { version = "0.7.1", features = [
5454
"rust_decimal",
5555
"time",
5656
] }
57-
alloy-primitives = { version = "0.5.2", features = ["serde"] }
58-
alloy-sol-types = "0.5.2"
57+
alloy-primitives = { version = "0.6", features = ["serde"] }
58+
alloy-sol-types = "0.6"
5959
lazy_static = "1.4.0"
60-
thegraph = { git = "https://github.com/edgeandnode/toolshed", branch = "main" }
61-
graphql = { git = "https://github.com/edgeandnode/toolshed", branch = "main" }
62-
graphql-http = { git = "https://github.com/edgeandnode/toolshed", branch = "main", features = [
60+
thegraph = { git = "https://github.com/edgeandnode/toolshed", tag = "thegraph-v0.5.0" }
61+
graphql = { git = "https://github.com/edgeandnode/toolshed", tag = "graphql-v0.3.0" }
62+
graphql-http = { git = "https://github.com/edgeandnode/toolshed", tag = "graphql-http-v0.2.1", features = [
6363
"http-reqwest",
6464
] }
6565
build-info = "0.0.34"

service/src/database.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,10 @@ mod test {
445445
setup_cost_models_table(&pool).await;
446446
add_cost_models(&pool, to_db_models(test_data())).await;
447447

448-
let deployment_id_from_bytes = DeploymentId(
449-
"0xbd499f7673ca32ef4a642207a8bebdd0fb03888cf2678b298438e3a1ae5206ea"
450-
.parse()
451-
.unwrap(),
452-
);
448+
let deployment_id_from_bytes = DeploymentId::from_str(
449+
"0xbd499f7673ca32ef4a642207a8bebdd0fb03888cf2678b298438e3a1ae5206ea",
450+
)
451+
.unwrap();
453452
let deployment_id_from_hash =
454453
DeploymentId::from_str("Qmb5Ysp5oCUXhLA8NmxmYKDAX2nCMnh7Vvb5uffb9n5vss").unwrap();
455454

tap-agent/Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ name = "indexer-tap-agent"
99
path = "src/main.rs"
1010

1111
[dependencies]
12-
alloy-primitives = "0.5.2"
13-
alloy-sol-types = "0.5.2"
12+
alloy-primitives = "0.6"
13+
alloy-sol-types = "0.6"
1414
anyhow = "1.0.72"
1515
async-trait = "0.1.72"
1616
bigdecimal = { version = "0.4.2", features = ["serde"] }
@@ -32,12 +32,12 @@ sqlx = { version = "0.7.2", features = [
3232
"bigdecimal",
3333
"rust_decimal",
3434
] }
35-
tap_aggregator = "0.2.0"
36-
tap_core = "0.7.0"
35+
tap_aggregator = { git = "https://github.com/semiotic-ai/timeline-aggregation-protocol", branch = "aasseman/tap_core_0_7_0_fix_toolshed_dep" }
36+
tap_core = { git = "https://github.com/semiotic-ai/timeline-aggregation-protocol", branch = "aasseman/tap_core_0_7_0_fix_toolshed_dep" }
3737
thiserror = "1.0.44"
3838
tokio = { version = "1.33.0" }
39-
thegraph = { git = "https://github.com/edgeandnode/toolshed", branch = "main" }
40-
graphql-http = { git = "https://github.com/edgeandnode/toolshed", branch = "main" }
39+
thegraph = { git = "https://github.com/edgeandnode/toolshed", tag = "thegraph-v0.5.0" }
40+
graphql-http = { git = "https://github.com/edgeandnode/toolshed", tag = "graphql-http-v0.2.1" }
4141
tracing = "0.1.37"
4242
tracing-subscriber = { version = "0.3", features = [
4343
"env-filter",

tap-agent/src/aggregator_endpoints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::fs::File;
66
use std::io::BufReader;
77
use std::path::PathBuf;
88

9-
use alloy_primitives::Address;
9+
use thegraph::types::Address;
1010

1111
/// Load a hashmap of sender addresses and their corresponding aggregator endpoints
1212
/// from a yaml file. We're using serde_yaml.

tap-agent/src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
use std::{path::PathBuf, str::FromStr};
55

6-
use alloy_primitives::Address;
76
use bigdecimal::{BigDecimal, ToPrimitive};
87
use clap::{command, Args, Parser, ValueEnum};
98
use dotenvy::dotenv;
109
use serde::{Deserialize, Serialize};
10+
use thegraph::types::Address;
1111
use thegraph::types::DeploymentId;
1212
use tracing::subscriber::{set_global_default, SetGlobalDefaultError};
1313
use tracing_subscriber::{EnvFilter, FmtSubscriber};

tap-agent/src/tap/escrow_adapter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
use std::{collections::HashMap, sync::Arc};
55

6-
use alloy_primitives::Address;
76
use async_trait::async_trait;
87
use eventuals::Eventual;
98
use indexer_common::escrow_accounts::EscrowAccounts;
109
use tap_core::adapters::escrow_adapter::EscrowAdapter as EscrowAdapterTrait;
10+
use thegraph::types::Address;
1111
use thiserror::Error;
1212
use tokio::sync::RwLock;
1313

tap-agent/src/tap/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// Copyright 2023-, GraphOps and Semiotic Labs.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
use alloy_primitives::{hex::ToHex, Address};
4+
use alloy_primitives::hex::ToHex;
55
use anyhow::anyhow;
66
use eventuals::Eventual;
77
use indexer_common::escrow_accounts::EscrowAccounts;
8+
use thegraph::types::Address;
89

910
mod escrow_adapter;
1011
mod rav_storage_adapter;

tap-agent/src/tap/rav_storage_adapter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
use alloy_primitives::hex::ToHex;
5-
use alloy_primitives::Address;
65
use anyhow::Result;
76
use async_trait::async_trait;
87
use sqlx::PgPool;
98
use tap_core::adapters::rav_storage_adapter::RAVStorageAdapter as RAVStorageAdapterTrait;
109
use tap_core::tap_manager::SignedRAV;
10+
use thegraph::types::Address;
1111
use thiserror::Error;
1212

1313
#[derive(Debug)]

0 commit comments

Comments
 (0)