From e966f4f201b8818afdb2da2afe548b771924a8f8 Mon Sep 17 00:00:00 2001 From: supernovahs Date: Fri, 10 Jan 2025 19:49:50 +0530 Subject: [PATCH 1/2] remove duplicate delegation manager in ELWriter --- crates/chainio/clients/elcontracts/src/reader.rs | 2 +- crates/chainio/clients/elcontracts/src/writer.rs | 11 ++++------- .../operatorsinfo/src/operatorsinfo_inmemory.rs | 1 - ...perator_in_quorum_with_avs_registry_coordinator.rs | 1 - .../examples/get_operator_info.rs | 1 - 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/crates/chainio/clients/elcontracts/src/reader.rs b/crates/chainio/clients/elcontracts/src/reader.rs index 36634548..7813eb99 100644 --- a/crates/chainio/clients/elcontracts/src/reader.rs +++ b/crates/chainio/clients/elcontracts/src/reader.rs @@ -12,7 +12,7 @@ use eigen_utils::middleware::{ pub struct ELChainReader { _logger: SharedLogger, slasher: Address, - delegation_manager: Address, + pub delegation_manager: Address, avs_directory: Address, pub provider: String, } diff --git a/crates/chainio/clients/elcontracts/src/writer.rs b/crates/chainio/clients/elcontracts/src/writer.rs index 3e8f868d..390ab8cf 100644 --- a/crates/chainio/clients/elcontracts/src/writer.rs +++ b/crates/chainio/clients/elcontracts/src/writer.rs @@ -21,7 +21,6 @@ pub const GAS_LIMIT_REGISTER_AS_OPERATOR_DELEGATION_MANAGER: u128 = 300000; /// Chain Writer to interact with EigenLayer contracts onchain #[derive(Debug, Clone)] pub struct ELChainWriter { - delegation_manager: Address, strategy_manager: Address, rewards_coordinator: Address, el_chain_reader: ELChainReader, @@ -31,7 +30,6 @@ pub struct ELChainWriter { impl ELChainWriter { pub fn new( - delegation_manager: Address, strategy_manager: Address, rewards_coordinator: Address, el_chain_reader: ELChainReader, @@ -39,7 +37,6 @@ impl ELChainWriter { signer: String, ) -> Self { Self { - delegation_manager, strategy_manager, rewards_coordinator, el_chain_reader, @@ -73,7 +70,8 @@ impl ELChainWriter { }; let provider = get_signer(&self.signer.clone(), &self.provider); - let contract_delegation_manager = DelegationManager::new(self.delegation_manager, provider); + let contract_delegation_manager = + DelegationManager::new(self.el_chain_reader.delegation_manager, provider); let binding = { let contract_call = contract_delegation_manager @@ -129,7 +127,8 @@ impl ELChainWriter { }; let provider = get_signer(&self.signer.clone(), &self.provider); - let contract_delegation_manager = DelegationManager::new(self.delegation_manager, provider); + let contract_delegation_manager = + DelegationManager::new(self.el_chain_reader.delegation_manager, provider); let contract_call_modify_operator_details = contract_delegation_manager.modifyOperatorDetails(operator_details); @@ -330,14 +329,12 @@ mod tests { async fn new_test_writer(http_endpoint: String) -> ELChainWriter { let (el_chain_reader, _) = setup_el_chain_reader(http_endpoint.clone()).await; - let operator_addr = Address::from_str("90F79bf6EB2c4f870365E785982E1f101E93b906").unwrap(); let operator_private_key = "7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6".to_string(); let strategy_manager = get_strategy_manager_address(http_endpoint.clone()).await; let rewards_coordinator = get_rewards_coordinator_address(http_endpoint.clone()).await; ELChainWriter::new( - operator_addr, strategy_manager, rewards_coordinator, el_chain_reader, diff --git a/crates/services/operatorsinfo/src/operatorsinfo_inmemory.rs b/crates/services/operatorsinfo/src/operatorsinfo_inmemory.rs index c4bef26b..a982c950 100644 --- a/crates/services/operatorsinfo/src/operatorsinfo_inmemory.rs +++ b/crates/services/operatorsinfo/src/operatorsinfo_inmemory.rs @@ -652,7 +652,6 @@ mod tests { let signer = PrivateKeySigner::from_str(pvt_key).unwrap(); let el_chain_writer = ELChainWriter::new( - delegation_manager_address, strategy_manager_address, rewards_coordinator_address, el_chain_reader, diff --git a/examples/avsregistry-write/examples/register_operator_in_quorum_with_avs_registry_coordinator.rs b/examples/avsregistry-write/examples/register_operator_in_quorum_with_avs_registry_coordinator.rs index 4500799d..735448d7 100644 --- a/examples/avsregistry-write/examples/register_operator_in_quorum_with_avs_registry_coordinator.rs +++ b/examples/avsregistry-write/examples/register_operator_in_quorum_with_avs_registry_coordinator.rs @@ -69,7 +69,6 @@ async fn main() -> Result<()> { ); // A new ElChainWriter instance let el_writer = ELChainWriter::new( - DELEGATION_MANAGER_ADDRESS, STRATEGY_MANAGER_ADDRESS, REWARDS_COORDINATOR, el_chain_reader, diff --git a/examples/info-operator-service/examples/get_operator_info.rs b/examples/info-operator-service/examples/get_operator_info.rs index 71cf9bed..f4bdc8ed 100644 --- a/examples/info-operator-service/examples/get_operator_info.rs +++ b/examples/info-operator-service/examples/get_operator_info.rs @@ -88,7 +88,6 @@ pub async fn register_operator(pvt_key: &str, bls_key: &str, http_endpoint: &str ); let el_chain_writer = ELChainWriter::new( - delegation_manager_address, strategy_manager_address, rewards_coordinator_address, el_chain_reader, From 725eec3e0c31994ca7b7da362a223ec343329b8b Mon Sep 17 00:00:00 2001 From: supernovahs Date: Fri, 10 Jan 2025 19:52:31 +0530 Subject: [PATCH 2/2] ci ubuntu change to old version --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 2b7b0932..16fce021 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -46,7 +46,7 @@ jobs: test: name: Run Tests - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: HOLESKY_WS_URL: ${{ secrets.HOLESKY_WS_URL }} HOLESKY_HTTP_URL: ${{ secrets.HOLESKY_HTTP_URL }}