Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use SDK aggregator and operator crates #25

Open
wants to merge 25 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0626acb
chore: use new SDK branch version
MegaRedHand Jan 30, 2025
4224ecd
chore: regenerate lockfile
MegaRedHand Jan 30, 2025
44467ae
fix: multiple dependency version errors
MegaRedHand Jan 30, 2025
b319f60
fix: use SDK aggregator when building AVS
MegaRedHand Jan 30, 2025
5fce8ce
fix: change imports
MegaRedHand Jan 30, 2025
1e0c348
starting including operator using common functions from sdk
pablodeymo Jan 30, 2025
f088546
Fix error return type in incredible_square_operator.rs
pablodeymo Jan 31, 2025
5b1558a
AVS Builder updated
pablodeymo Jan 31, 2025
2b157cb
test fixed
pablodeymo Jan 31, 2025
b507292
Merge branch 'dev' into use-sdk-aggregator-operator
pablodeymo Jan 31, 2025
514b63b
test: fix tests
MegaRedHand Jan 31, 2025
b375e68
split AVS builder in 3 files
pablodeymo Jan 31, 2025
8aeb1f8
AvsBuilder removed
pablodeymo Jan 31, 2025
d0caf7e
DefaultAvsLauncher methods removed
pablodeymo Jan 31, 2025
732edd8
refactor: simplify incredible-avs crate
MegaRedHand Jan 31, 2025
2185428
fix: generalize config for N operators
MegaRedHand Jan 31, 2025
d5141ca
chore: fix clippy
MegaRedHand Jan 31, 2025
4224b67
chore: add print
MegaRedHand Jan 31, 2025
4577792
Revert "chore: add print"
MegaRedHand Feb 3, 2025
1dbd0af
Revert "chore: fix clippy"
MegaRedHand Feb 3, 2025
7279830
Revert "fix: generalize config for N operators"
MegaRedHand Feb 3, 2025
73790dc
fix: clone config and modify
MegaRedHand Feb 3, 2025
4655676
refactor: remove prints
MegaRedHand Feb 3, 2025
41f68e6
revert: re-add fields to config
MegaRedHand Feb 3, 2025
905f9c8
WIP: updating to sdk-ux-improvment branch of SDK
pablodeymo Feb 18, 2025
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
1,389 changes: 720 additions & 669 deletions Cargo.lock

Large diffs are not rendered by default.

106 changes: 54 additions & 52 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[workspace]
members = ["crates/aggregator",
"crates/operator",
"bin/incredible-squaring-avs",
"crates/cli",
"crates/config",
"crates/bindings",
"crates/avs",
"crates/challenger",
"crates/chainio",
"crates/testing-utils",
"crates/task_generator",
"crates/operator_2",
"crates/slasher"
members = [
"crates/aggregator",
"crates/operator",
"bin/incredible-squaring-avs",
"crates/cli",
"crates/config",
"crates/bindings",
"crates/avs",
"crates/challenger",
"crates/chainio",
"crates/testing-utils",
"crates/task_generator",
"crates/slasher",
]

resolver = "2"
Expand Down Expand Up @@ -40,57 +40,59 @@ clap = "4.5.11"
eyre = "0.6.12"
tokio = { version = "1.21", default-features = false }
thiserror = "2"
ark-bn254 = { version = "0.5.0", features = ["curve"], default-features = false }
ark-bn254 = { version = "0.5.0", features = [
"curve",
], default-features = false }
futures-util = "0.3.31"
metrics = "0.24.0"
metrics-util = "0.19.0"
reqwest = "0.12.9"
serde_json = "1.0.120"
#alloy
alloy = { version = "0.7", features = ["full","signer-keystore","reqwest"] }
alloy = { version = "0.9", features = ["full", "signer-keystore", "reqwest"] }
alloy-primitives = "0.8"
alloy-provider = "0.7"
serde = "1.0.203"
tracing = "0.1.40"
tempfile = "3"
rust-bls-bn254 = {git = "https://github.com/Layr-Labs/rust-bls-bn254.git", rev = "be3ef87", features = ["std"] }
rust-bls-bn254 = { git = "https://github.com/Layr-Labs/rust-bls-bn254.git", rev = "be3ef87", features = [
"std",
] }
rand_core = "0.6"
toml = "0.8"


incredible-operator = {path = "crates/operator/" , features = ["default"]}
incredible-aggregator = {path = "crates/aggregator/"}
incredible-squaring-avs = {path = "bin/incredible-squaring-avs/"}
incredible-cli-runner = {path = "crates/cli/"}
incredible-config = {path = "crates/config/"}
incredible-bindings = {path = "crates/bindings/"}
incredible-metrics = {path = "crates/metrics/"}
incredible-avs = {path = "crates/avs/"}
incredible-challenger = {path = "crates/challenger/"}
incredible-chainio = {path = "crates/chainio/"}
incredible-testing-utils = {path = "crates/testing-utils/"}
incredible-task-generator = {path = "crates/task_generator/"}
incredible-operator-2 = {path = "crates/operator_2/" , features = ["default"]}
incredible-slasher = {path = "crates/slasher/"}
# eigensdk-rs

eigen-client-avsregistry = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-testing-utils ={ git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-crypto-bls = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-types = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-metrics = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-utils = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-contract-bindings = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-cli ={ git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-logging ={ git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-crypto-bn254 = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-client-elcontracts = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-services-operatorsinfo = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-services-avsregistry = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-services-blsaggregation = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-metrics-collectors-rpc-calls = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-client-eth = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}
eigen-nodeapi = { git = "https://github.com/Layr-Labs/eigensdk-rs", rev = "046d497"}


incredible-operator = { path = "crates/operator/", features = ["default"] }
incredible-aggregator = { path = "crates/aggregator/" }
incredible-squaring-avs = { path = "bin/incredible-squaring-avs/" }
incredible-cli-runner = { path = "crates/cli/" }
incredible-config = { path = "crates/config/" }
incredible-bindings = { path = "crates/bindings/" }
incredible-metrics = { path = "crates/metrics/" }
incredible-avs = { path = "crates/avs/" }
incredible-challenger = { path = "crates/challenger/" }
incredible-chainio = { path = "crates/chainio/" }
incredible-testing-utils = { path = "crates/testing-utils/" }
incredible-task-generator = { path = "crates/task_generator/" }
incredible-slasher = { path = "crates/slasher/" }

# eigensdk-rs
eigen-aggregator = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-operator = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-common = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-client-avsregistry = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-testing-utils = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-crypto-bls = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-types = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-metrics = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-utils = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-contract-bindings = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-cli = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-logging = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-crypto-bn254 = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-client-elcontracts = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-services-operatorsinfo = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-services-avsregistry = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-services-blsaggregation = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-metrics-collectors-rpc-calls = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-client-eth = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
eigen-nodeapi = { git = "https://github.com/Layr-Labs/eigensdk-rs", branch = "sdk-ux-improvment" }
7 changes: 4 additions & 3 deletions bin/incredible-squaring-avs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ rust-version.workspace = true
repository.workspace = true
license.workspace = true
description = "incredible squaring avs in rust"

[lints]
workspace = true

[dependencies]
incredible-aggregator.workspace = true
incredible-operator = {workspace = true , features = ["default"]}
incredible-operator = { workspace = true, features = ["default"] }
incredible-cli-runner.workspace = true
incredible-config.workspace = true
incredible-avs.workspace = true
Expand All @@ -29,6 +29,7 @@ rust-bls-bn254.workspace = true
eigen-crypto-bls.workspace = true
metrics-util.workspace = true
# eigensdk-rs
eigen-common.workspace = true
eigen-testing-utils.workspace = true
eigen-logging.workspace = true
eigen-utils.workspace = true
Expand All @@ -43,4 +44,4 @@ tokio.workspace = true

[[bin]]
name = "incredible-squaring-avs"
path = "src/main.rs"
path = "src/main.rs"
46 changes: 21 additions & 25 deletions bin/incredible-squaring-avs/src/commands/avs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use clap::value_parser;
use clap::{Args, Parser};
use eigen_client_elcontracts::reader::ELChainReader;
use eigen_client_elcontracts::{error::ElContractsError, writer::ELChainWriter};
use eigen_common::{get_provider, get_signer};
use eigen_crypto_bls::BlsKeyPair;
use eigen_logging::{get_logger, init_logger, log_level::LogLevel};
use eigen_metrics::prometheus::init_registry;
Expand All @@ -16,11 +17,11 @@ use eigen_testing_utils::anvil_constants::{
get_strategy_manager_address, ANVIL_HTTP_URL,
};
use eigen_types::operator::Operator;
use eigen_utils::allocationmanager::AllocationManager::{self, OperatorSet};
use eigen_utils::allocationmanager::IAllocationManagerTypes::AllocateParams;
use eigen_utils::registrycoordinator::RegistryCoordinator;
use eigen_utils::{get_provider, get_signer};
use incredible_avs::builder::{AvsBuilder, DefaultAvsLauncher, LaunchAvs};
use eigen_utils::rewardsv2::middleware::registrycoordinator::{
IRegistryCoordinator, IStakeRegistry, RegistryCoordinator,
};
use eigen_utils::slashing::core::allocationmanager::AllocationManager::{self, OperatorSet};
use eigen_utils::slashing::core::allocationmanager::IAllocationManagerTypes::AllocateParams;
use incredible_config::IncredibleConfig;
use incredible_testing_utils::{
get_incredible_squaring_operator_state_retriever, get_incredible_squaring_registry_coordinator,
Expand Down Expand Up @@ -665,9 +666,7 @@ impl<Ext: clap::Args + fmt::Debug + Send + Sync + 'static> AvsCommand<Ext> {
mine_anvil_block(&rpc_url, current_block_number);
}

let avs_launcher = DefaultAvsLauncher::new();
let avs_builder = AvsBuilder::new(config);
let _ = avs_launcher.launch_avs(avs_builder).await;
let _ = incredible_avs::launch_avs(config).await;

Ok(())
}
Expand Down Expand Up @@ -701,20 +700,20 @@ pub async fn register_operator_with_el_and_deposit_tokens_in_strategy(
let s = signer.to_field_bytes();
let el_chain_reader = ELChainReader::new(
get_logger(),
allocation_manager,
Some(allocation_manager),
delegation_manager_address,
rewards_coordinator,
avs_directory_address,
permission_controller_address,
Some(permission_controller_address),
rpc_url.clone(),
);
let el_chain_writer = ELChainWriter::new(
delegation_manager_address,
strategy_manager_address,
rewards_coordinator,
permission_controller_address,
Some(rewards_coordinator),
Some(permission_controller_address),
allocation_manager,
registry_coordinator_address,
Some(registry_coordinator_address),
el_chain_reader.clone(),
rpc_url.clone(),
hex::encode(s).to_string(),
Expand Down Expand Up @@ -788,19 +787,16 @@ pub async fn create_total_delegated_stake_quorum(
let registry_coordinator_instance =
RegistryCoordinator::new(registry_coordinator_address, get_signer(&pvt_key, rpc_url));

let operator_set_param =
eigen_utils::registrycoordinator::IRegistryCoordinator::OperatorSetParam {
maxOperatorCount: 3,
kickBIPsOfOperatorStake: 100,
kickBIPsOfTotalStake: 1000,
};
let operator_set_param = IRegistryCoordinator::OperatorSetParam {
maxOperatorCount: 3,
kickBIPsOfOperatorStake: 100,
kickBIPsOfTotalStake: 1000,
};
let minimum_stake: U96 = U96::from(0);
let strategy_params = vec![
eigen_utils::registrycoordinator::IStakeRegistry::StrategyParams {
strategy: strategy_address,
multiplier: U96::from(1),
},
];
let strategy_params = vec![IStakeRegistry::StrategyParams {
strategy: strategy_address,
multiplier: U96::from(1),
}];

let s = registry_coordinator_instance
.createTotalDelegatedStakeQuorum(operator_set_param, minimum_stake, strategy_params)
Expand Down
12 changes: 5 additions & 7 deletions crates/aggregator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,23 @@ edition.workspace = true
rust-version.workspace = true
repository.workspace = true
license.workspace = true
description = "eigen layer aggregator utils "
description = "eigen layer aggregator"

[lints]
workspace = true

[dependencies]
eigen-aggregator.workspace = true
incredible-bindings.workspace = true
ark-bn254.workspace = true
ark-ec.workspace = true
alloy.workspace = true
eigen-types.workspace = true
serde.workspace = true
ark-serialize = "0.4.2"
hex = "0.4.3"
eigen-crypto-bls.workspace = true
eyre.workspace = true
incredible-chainio.workspace = true
incredible-config.workspace = true
incredible-metrics.workspace = true
eigen-common.workspace = true
eigen-services-operatorsinfo.workspace = true
eigen-logging.workspace = true
eigen-client-avsregistry.workspace = true
Expand All @@ -43,4 +41,4 @@ incredible-testing-utils.workspace = true
toml.workspace = true
ark-std = { version = "0.4.0", default-features = false }
incredible-operator.workspace = true
reqwest.workspace = true
reqwest.workspace = true
55 changes: 0 additions & 55 deletions crates/aggregator/src/error.rs

This file was deleted.

Loading
Loading