Skip to content

Commit

Permalink
chore!: update eigensdk (#506)
Browse files Browse the repository at this point in the history
* chore!: update `eigensdk`

* chore: update symbiotic-rs

* chore: update error type

---------

Co-authored-by: Drew Stone <[email protected]>
  • Loading branch information
Serial-ATA and drewstone authored Nov 29, 2024
1 parent b3f7ce3 commit bc837d7
Show file tree
Hide file tree
Showing 24 changed files with 894 additions and 659 deletions.
1,185 changes: 674 additions & 511 deletions Cargo.lock

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ auto_impl = "1.2.0"
backon = { version = "1.2.0", default-features = false }
bincode = "1.3.3"
bip39 = "2.1.0"
bollard = "0.16.1"
bollard = "0.17"
cargo-generate = { version = "0.21.3", default-features = false }
cfg-if = "1.0.0"
clap = "4.5.16"
Expand Down Expand Up @@ -159,28 +159,28 @@ jsonrpc-http-server = "18.0.0"
tempfile = "3.10.1"
cargo_toml = { version = "0.20.5" }

alloy-primitives = "0.7.2"
alloy-json-abi = "0.7.2"
alloy-sol-types = "0.7.2"
alloy-rpc-client = "0.4.2"
alloy-rpc-types = { version = "0.1" }
alloy-rpc-types-eth = { version = "0.1" }
alloy-provider = { version = "0.1", default-features = false, features = ["reqwest", "ws"] }
alloy-pubsub = { version = "0.1" }
alloy-signer = { version = "0.1" }
alloy-signer-local = { version = "0.1" }
alloy-network = { version = "0.1" }
alloy-node-bindings = "0.4.2"
alloy-contract = { version = "0.1" }
alloy-consensus = { version = "0.1" }
alloy-transport = { version = "0.1" }
alloy-transport-http = { version = "0.1" }
alloy-primitives = "0.8.12"
alloy-json-abi = "0.8.12"
alloy-sol-types = "0.8.12"
alloy-rpc-client = "0.5"
alloy-rpc-types = { version = "0.5" }
alloy-rpc-types-eth = { version = "0.5" }
alloy-provider = { version = "0.5", default-features = false, features = ["reqwest", "ws"] }
alloy-pubsub = { version = "0.5" }
alloy-signer = { version = "0.5" }
alloy-signer-local = { version = "0.5" }
alloy-network = { version = "0.5" }
alloy-node-bindings = "0.5"
alloy-contract = { version = "0.5" }
alloy-consensus = { version = "0.5" }
alloy-transport = { version = "0.5" }
alloy-transport-http = { version = "0.5" }

ark-bn254 = "0.4.0"
ark-ec = "0.4.0"
ark-ff = "0.4.0"
ark-ff = "0.5.0"
ark-std = "0.4.0"
ark-serialize = "0.4.0"
ark-serialize = "0.5.0"

# WebAssembly
js-sys = "0.3.70"
Expand All @@ -192,11 +192,11 @@ wasmtimer = "0.2"
secp256k1 = "0.29.1"

# Eigenlayer
eigensdk = { version = "0.1.0", features = ["full", "utils", "types"] }
testcontainers = { version = "0.20.1" }
eigensdk = { version = "0.1.1", default-features = false }
testcontainers = { version = "0.23.1" }

# Symbiotic
symbiotic-rs = { version = "0.1.0" }
symbiotic-rs = { version = "0.1.1" }
dashmap = "6.1.0"
lru-mem = "0.3.0"

Expand Down
6 changes: 4 additions & 2 deletions blueprint-test-utils/src/eigenlayer_test_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::anvil;
pub use crate::binding::ipauserregistry::PauserRegistry;
pub use crate::binding::registrycoordinator::RegistryCoordinator;
pub use crate::helpers::get_receipt;
use alloy_primitives::Uint;
pub use alloy_primitives::{address, Address, Bytes, U256};
pub use alloy_provider::Provider;
pub use gadget_sdk::config::protocol::EigenlayerContractAddresses;
Expand Down Expand Up @@ -125,13 +126,13 @@ pub async fn setup_eigenlayer_test_environment(
};
let strategy_params = RegistryCoordinator::StrategyParams {
strategy: erc20_mock_address,
multiplier: 1,
multiplier: Uint::from(1),
};

info!("Creating Quorum");
let _receipt = get_receipt(registry_coordinator.createQuorum(
operator_set_params,
0,
Uint::from(0),
vec![strategy_params],
))
.await
Expand All @@ -149,6 +150,7 @@ pub async fn setup_eigenlayer_test_environment(
delegation_manager_address,
strategy_manager_address,
avs_directory_address: Default::default(),
rewards_coordinator_address: Default::default(),
},
pauser_registry_address,
}
Expand Down
3 changes: 3 additions & 0 deletions blueprint-test-utils/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ pub enum BlueprintError {

#[error("Contract error occurred: {0}")]
ContractError(#[from] alloy_contract::Error),

#[error("{0}")]
Transaction(#[from] alloy_provider::PendingTransactionError),
}

pub struct BlueprintProcess {
Expand Down
2 changes: 1 addition & 1 deletion blueprints/examples/src/eigen_context.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use alloy_primitives::U256;
use alloy_primitives::{address, Address, Bytes};
use color_eyre::eyre::eyre;
use gadget_sdk::event_listener::evm::contracts::EvmContractEventListener;
Expand Down Expand Up @@ -88,7 +89,6 @@ pub async fn handle_job(
let stake_in_quorums_at_block = ctx
.get_operator_stake_in_quorums_at_block(block_number, Bytes::from(vec![0]))
.await?;
println!("Stake in Quorums at Block: {:?}", stake_in_quorums_at_block);
assert!(!stake_in_quorums_at_block.is_empty());

// Get an Operator's stake in Quorums at the current block.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::{
contexts::client::SignedTaskResponse,
IncredibleSquaringTaskManager::{
self, G1Point, G2Point, NonSignerStakesAndSignature, TaskResponse,
},
};
use crate::IBLSSignatureChecker::NonSignerStakesAndSignature;
use crate::IIncredibleSquaringTaskManager::Task;
use crate::IIncredibleSquaringTaskManager::TaskResponse;
use crate::BN254::G1Point;
use crate::BN254::G2Point;
use crate::{contexts::client::SignedTaskResponse, IncredibleSquaringTaskManager};
use alloy_network::{Ethereum, NetworkWallet};
use alloy_primitives::keccak256;
use alloy_sol_types::SolType;
Expand All @@ -26,7 +26,6 @@ use tokio::sync::{oneshot, Mutex, Notify};
use tokio::task::JoinHandle;
use tokio::time::interval;

use crate::IncredibleSquaringTaskManager::Task;
use alloy_network::EthereumWallet;
use alloy_primitives::{Address, Bytes};
use eigensdk::client_avsregistry::reader::AvsRegistryChainReader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde_json::json;
use tokio::time::{sleep, Duration};
use tracing::{debug, info};

use crate::IncredibleSquaringTaskManager::TaskResponse;
use crate::IIncredibleSquaringTaskManager::TaskResponse;

const MAX_RETRIES: u32 = 5;
const INITIAL_RETRY_DELAY: Duration = Duration::from_secs(1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![allow(dead_code)]
use crate::contexts::client::SignedTaskResponse;
use crate::contexts::x_square::EigenSquareContext;
use crate::IIncredibleSquaringTaskManager::TaskResponse;
use crate::{IncredibleSquaringTaskManager, INCREDIBLE_SQUARING_TASK_MANAGER_ABI_STRING};
use alloy_primitives::keccak256;
use alloy_primitives::{Bytes, U256};
Expand All @@ -13,7 +14,6 @@ use gadget_sdk::event_listener::evm::contracts::EvmContractEventListener;
use gadget_sdk::keystore::BackendExt;
use gadget_sdk::{error, info, job};
use std::{convert::Infallible, ops::Deref};
use IncredibleSquaringTaskManager::TaskResponse;

/// Sends a signed task response to the BLS Aggregator.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::IIncredibleSquaringTaskManager::Task;
use crate::{
contexts::aggregator::AggregatorContext, IncredibleSquaringTaskManager,
INCREDIBLE_SQUARING_TASK_MANAGER_ABI_STRING,
};
use gadget_sdk::event_listener::evm::contracts::EvmContractEventListener;
use gadget_sdk::{info, job};
use std::{convert::Infallible, ops::Deref};
use IncredibleSquaringTaskManager::Task;

const TASK_CHALLENGE_WINDOW_BLOCK: u32 = 100;
const BLOCK_TIME_SECONDS: u32 = 12;
Expand Down
8 changes: 0 additions & 8 deletions blueprints/incredible-squaring-eigenlayer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,3 @@ sol!(
PauserRegistry,
"./contracts/out/IPauserRegistry.sol/IPauserRegistry.json"
);

sol!(
#[allow(missing_docs, clippy::too_many_arguments)]
#[sol(rpc)]
#[derive(Debug)]
RegistryCoordinator,
"./contracts/out/RegistryCoordinator.sol/RegistryCoordinator.json"
);
9 changes: 9 additions & 0 deletions blueprints/incredible-squaring-eigenlayer/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::IncredibleSquaringTaskManager;
use alloy_network::EthereumWallet;
use alloy_provider::Provider;
use alloy_signer_local::PrivateKeySigner;
use alloy_sol_types::sol;
use blueprint_test_utils::eigenlayer_test_env::*;
use blueprint_test_utils::{
eigenlayer_test_env::start_default_anvil_testnet, helpers::wait_for_responses,
Expand All @@ -22,6 +23,14 @@ use gadget_sdk::utils::evm::get_wallet_provider_http;
use reqwest::Url;
use std::path::Path;

sol!(
#[allow(missing_docs, clippy::too_many_arguments)]
#[sol(rpc)]
#[derive(Debug)]
RegistryCoordinator,
"./contracts/out/RegistryCoordinator.sol/RegistryCoordinator.json"
);

const ANVIL_STATE_PATH: &str =
"./blueprint-test-utils/anvil/deployed_anvil_states/testnet_state.json";

Expand Down
2 changes: 1 addition & 1 deletion blueprints/incredible-squaring-symbiotic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ publish = false
eigensdk = { workspace = true }
tracing = { workspace = true }
async-trait = { workspace = true }
gadget-sdk = { workspace = true, features = ["std"] }
gadget-sdk = { workspace = true, features = ["std", "symbiotic"] }
color-eyre = { workspace = true }
lock_api = { workspace = true }
tokio = { workspace = true, default-features = false, features = ["full"] }
Expand Down
Loading

0 comments on commit bc837d7

Please sign in to comment.