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

feat: symbiotic integration #411

Merged
merged 28 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
dae1674
feat: begin symbiotic integration
drewstone Oct 26, 2024
d7f8bc6
Merge branch 'main' into symbiotic
drewstone Oct 26, 2024
8a071a0
fix: impl eigen register in config
drewstone Oct 26, 2024
df91349
feat: impl symb and fix other registrations/requires registration
drewstone Oct 26, 2024
a8fd778
fix: fmt
drewstone Oct 26, 2024
ce3526e
feat: update runners, separate configs, add Symbiotic contracts, not …
drewstone Oct 27, 2024
cc6013d
feat: use blueprint runner in eigen test, still not working
drewstone Oct 27, 2024
5bb4ea7
feat: fix test and insert test keys at setup time
drewstone Oct 28, 2024
94778ca
fix: remove unused runner
drewstone Oct 28, 2024
30aa14c
fix: fix
drewstone Oct 28, 2024
f89d485
fix: clippy
drewstone Oct 28, 2024
469c3d0
fix: add default blueprint ids
drewstone Oct 28, 2024
67a2fff
fix: remove need to import packages for macro
drewstone Oct 28, 2024
2b33339
fix: fix test
drewstone Oct 28, 2024
8753638
fix: reorg and attempt to fix CI
drewstone Oct 28, 2024
21ef912
fix: fixes
drewstone Oct 28, 2024
e42e7d2
fix: fmt
drewstone Oct 28, 2024
7b0cbed
fix: services context
drewstone Oct 28, 2024
6236c42
fix: fixes
drewstone Oct 28, 2024
b3bfeac
fix: fix path
drewstone Oct 28, 2024
43900c0
Update sdk/src/runners/jobs.rs
drewstone Oct 28, 2024
0e94135
fix: symbiotic build
drewstone Oct 28, 2024
ee2dbf9
fix: fix naming
drewstone Oct 28, 2024
3b905c0
fix: fix naming
drewstone Oct 28, 2024
2d21f6e
fix: fix var in macro
drewstone Oct 28, 2024
bb7e5b5
fix: symbiotic contracts
drewstone Oct 29, 2024
0dbdf59
fix: fixes
drewstone Oct 29, 2024
03c6ed6
fix: fixes
drewstone Oct 29, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
blueprint-manager,
gadget-context-derive,
gadget-blueprint-proc-macro,
gadget-blueprint-proc-macro-playground,
gadget-blueprint-proc-macro-playground
]
steps:
- name: checkout code
Expand Down
8 changes: 7 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@
[submodule "blueprints/ecdsa-threshold-mpc/contracts/lib/tnt-core"]
path = blueprints/ecdsa-threshold-mpc/contracts/lib/tnt-core
url = https://github.com/tangle-network/tnt-core
branch = main
branch = main
[submodule "blueprints/incredible-squaring-symbiotic/contracts/lib/forge-std"]
path = blueprints/incredible-squaring-symbiotic/contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "blueprints/incredible-squaring-symbiotic/contracts/lib/core"]
path = blueprints/incredible-squaring-symbiotic/contracts/lib/core
url = https://github.com/symbioticfi/core
56 changes: 56 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"blueprint-metadata",
"blueprints/incredible-squaring",
"blueprints/incredible-squaring-eigenlayer",
"blueprints/incredible-squaring-symbiotic",
"blueprints/periodic-web-poller",
"cli",
"gadget-io",
Expand Down Expand Up @@ -44,7 +45,9 @@ blueprint-manager = { version = "0.1.1", path = "./blueprint-manager" }
blueprint-test-utils = { path = "./blueprint-test-utils" }
gadget-sdk = { path = "./sdk", default-features = false, version = "0.2.3" }

incredible-squaring-blueprint = { path = "./blueprints/incredible-squaring", default-features = false, version = "0.1.1" }
incredible-squaring-blueprint-eigenlayer = { path = "./blueprints/incredible-squaring-eigenlayer", default-features = false, version = "0.1.1" }
incredible-squaring-blueprint-symbiotic = { path = "./blueprints/incredible-squaring-symbiotic", default-features = false, version = "0.1.1" }
periodic-web-poller-blueprint = { path = "./blueprints/periodic-web-poller", default-features = false, version = "0.1.1" }
gadget-blueprint-proc-macro = { path = "./macros/blueprint-proc-macro", default-features = false, version = "0.2.3" }
gadget-blueprint-proc-macro-core = { path = "./macros/blueprint-proc-macro-core", default-features = false, version = "0.1.5" }
Expand Down Expand Up @@ -178,6 +181,9 @@ secp256k1 = "0.29.1"
eigensdk = { version = "0.1.0", features = ["full", "utils", "types"] }
testcontainers = { version = "0.20.1" }

# Symbiotic
symbiotic-rs = { version = "0.1.0" }

# Config for 'cargo dist'
[workspace.metadata.dist]
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
Expand Down
2 changes: 1 addition & 1 deletion blueprint-manager/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct BlueprintManagerConfig {
/// The directory in which all gadgets will store their data
#[arg(long, short = 'd', default_value = "./data")]
pub data_dir: PathBuf,
/// The verbosity level, can be used multiple times
/// The verbosity level, can be used multiple times to increase verbosity
#[arg(long, short = 'v', action = clap::ArgAction::Count)]
pub verbose: u8,
/// Whether to use pretty logging
Expand Down
1 change: 1 addition & 0 deletions blueprint-test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ alloy-contract = { workspace = true }
alloy-rpc-types-eth = { workspace = true }
alloy-node-bindings = { workspace = true }
thiserror = { workspace = true }
lazy_static = { workspace = true }

eigensdk = { workspace = true }
testcontainers = { workspace = true }
Expand Down
113 changes: 113 additions & 0 deletions blueprint-test-utils/src/eigenlayer_test_env.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
use alloy_primitives::{address, Address};
use alloy_provider::Provider;
use gadget_sdk::info;
use gadget_sdk::{
config::protocol::EigenlayerContractAddresses, events_watcher::evm::get_provider_http,
};

use crate::helpers::get_receipt;

alloy_sol_types::sol!(
#[allow(missing_docs)]
#[sol(rpc)]
#[derive(Debug)]
IncredibleSquaringTaskManager,
"./../blueprints/incredible-squaring-eigenlayer/contracts/out/IncredibleSquaringTaskManager.sol/IncredibleSquaringTaskManager.json"
);

alloy_sol_types::sol!(
#[allow(missing_docs)]
#[sol(rpc)]
#[derive(Debug)]
PauserRegistry,
"./../blueprints/incredible-squaring-eigenlayer/contracts/out/IPauserRegistry.sol/IPauserRegistry.json"
);

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

pub struct EigenlayerTestEnvironment {
pub http_endpoint: String,
pub ws_endpoint: String,
pub accounts: Vec<Address>,
pub eigenlayer_contract_addresses: EigenlayerContractAddresses,
pub pauser_registry_address: Address,
}

pub async fn setup_eigenlayer_test_environment(
http_endpoint: &str,
ws_endpoint: &str,
) -> EigenlayerTestEnvironment {
let provider = get_provider_http(http_endpoint);

let accounts = provider.get_accounts().await.unwrap();

let registry_coordinator_address = address!("c3e53f4d16ae77db1c982e75a937b9f60fe63690");
std::env::set_var(
"REGISTRY_COORDINATOR_ADDR",
registry_coordinator_address.to_string(),
);
let operator_state_retriever_address = address!("1613beb3b2c4f22ee086b2b38c1476a3ce7f78e8");
std::env::set_var(
"OPERATOR_STATE_RETRIEVER_ADDR",
operator_state_retriever_address.to_string(),
);
let delegation_manager_address = address!("dc64a140aa3e981100a9beca4e685f962f0cf6c9");
std::env::set_var(
"DELEGATION_MANAGER_ADDR",
delegation_manager_address.to_string(),
);
let strategy_manager_address = address!("5fc8d32690cc91d4c39d9d3abcbd16989f875707");
std::env::set_var(
"STRATEGY_MANAGER_ADDR",
strategy_manager_address.to_string(),
);
let erc20_mock_address = address!("7969c5ed335650692bc04293b07f5bf2e7a673c0");
std::env::set_var("ERC20_MOCK_ADDR", erc20_mock_address.to_string());

let pauser_registry = PauserRegistry::deploy(provider.clone()).await.unwrap();
let pauser_registry_address = *pauser_registry.address();

let registry_coordinator =
RegistryCoordinator::new(registry_coordinator_address, provider.clone());

let operator_set_params = RegistryCoordinator::OperatorSetParam {
maxOperatorCount: 10,
kickBIPsOfOperatorStake: 100,
kickBIPsOfTotalStake: 1000,
};
let strategy_params = RegistryCoordinator::StrategyParams {
strategy: erc20_mock_address,
multiplier: 1,
};

info!("Creating Quorum");
let _receipt = get_receipt(registry_coordinator.createQuorum(
operator_set_params,
0,
vec![strategy_params],
))
.await
.unwrap();

info!("Setup Eigenlayer test environment");

EigenlayerTestEnvironment {
http_endpoint: http_endpoint.to_string(),
ws_endpoint: ws_endpoint.to_string(),
accounts,
eigenlayer_contract_addresses: EigenlayerContractAddresses {
registry_coordinator_address,
operator_state_retriever_address,
delegation_manager_address,
strategy_manager_address,
avs_directory_address: Default::default(),
},
pauser_registry_address,
}
}
Loading
Loading