diff --git a/CHANGELOG.md b/CHANGELOG.md index 93364ed2..03cf798b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,15 @@ Those changes in added, changed or breaking changes, should include usage exampl ### Added 🎉 +* Added new method `set_churn_approver` in `avsregistry/writer` in [#333](https://github.com/Layr-Labs/eigensdk-rs/pull/333). + + ```rust + let tx_hash = avs_writer + .set_churn_approver(new_churn_approver_address) + .await + .unwrap(); + ``` + ### Breaking Changes 🛠 ### Deprecated ⚠️ @@ -31,6 +40,7 @@ Those changes in added, changed or breaking changes, should include usage exampl ## [0.3.0] - 2025-02-11 ### Added * Added new method `set_slashable_stake_lookahead` in `avsregistry/writer` in [#278](https://github.com/Layr-Labs/eigensdk-rs/pull/278). + ```rust let quorum_number = 0_u8; let lookahead = 10_u32; @@ -39,6 +49,7 @@ Those changes in added, changed or breaking changes, should include usage exampl .await .unwrap(); ``` + * Added new method `set_rewards_initiator` in `avsregistry/writer` in [#273](https://github.com/Layr-Labs/eigensdk-rs/pull/273). ```rust @@ -365,11 +376,12 @@ Those changes in added, changed or breaking changes, should include usage exampl ### Changed - ### Breaking changes + * refactor: update interface on `bls aggregation` in [#254](https://github.com/Layr-Labs/eigensdk-rs/pull/254) * Introduces a new struct `TaskMetadata` with a constructor `TaskMetadata::new` to initialize a new task and a method `with_window_duration` to set the window duration. * Refactors `initialize_new_task` and `single_task_aggregator` to accept a `TaskMetadata` struct instead of multiple parameters. + ```rust // BEFORE bls_agg_service @@ -393,8 +405,9 @@ Those changes in added, changed or breaking changes, should include usage exampl ) bls_agg_service.initialize_new_task(metadata).await.unwrap(); ``` - + * Removes `initialize_new_task_with_window` since `window_duration` can now be set in `TaskMetadata`. + ```rust // BEFORE bls_agg_service @@ -418,9 +431,11 @@ Those changes in added, changed or breaking changes, should include usage exampl time_to_expiry, ).with_window_duration(window_duration); bls_agg_service.initialize_new_task(metadata).await.unwrap(); -* refactor: encapsulate parameters into `TaskSignature` in [#260](https://github.com/Layr-Labs/eigensdk-rs/pull/260) +* refactor: encapsulate parameters into `TaskSignature` in [#260](https://github.com/Layr-Labs/eigensdk-rs/pull/260) + * Introduced `TaskSignature` struct to encapsulate parameters related to task signatures: * Updated `process_new_signature` to accept a `TaskSignature` struct instead of multiple parameters. + ```rust // BEFORE bls_agg_service.process_new_signature(task_index, task_response_digest, bls_signature, operator_id).await.unwrap(); @@ -434,6 +449,7 @@ Those changes in added, changed or breaking changes, should include usage exampl ); bls_agg_service.process_new_signature(task_signature).await.unwrap(); ``` + * Slashing UAM changes in [#248](https://github.com/Layr-Labs/eigensdk-rs/pull/248). ### Removed @@ -541,10 +557,13 @@ Those changes in added, changed or breaking changes, should include usage exampl * ci: split tests and coverage by @MegaRedHand in ## [0.1.3] - 2024-01-17 + ### Added 🎉 -* feat: add rewards-v2 related functionality by @supernovahs in https://github.com/Layr-Labs/eigensdk-rs/pull/221 + +* feat: add rewards-v2 related functionality by @supernovahs in * New methods in `ELChainReader`: * `get_operator_avs_split` + ```rust // Given a chain_reader, an operator_address and an avs_address: @@ -553,8 +572,9 @@ Those changes in added, changed or breaking changes, should include usage exampl .await .unwrap(); ``` - + * `get_operator_pi_split` + ```rust // Given a chain_reader and an operator_address: @@ -567,6 +587,7 @@ Those changes in added, changed or breaking changes, should include usage exampl * New methods in `ELChainWriter`: * `set_operator_avs_split` + ```rust // Given a chain_writer, an operator_address, an avs_address and a split: @@ -576,7 +597,9 @@ Those changes in added, changed or breaking changes, should include usage exampl .unwrap(); let receipt = wait_transaction(&http_endpoint, tx_hash).await.unwrap(); ``` + * `set_operator_pi_split` + ```rust // Given a chain_writer, an operator_address and a split: @@ -586,10 +609,12 @@ Those changes in added, changed or breaking changes, should include usage exampl .unwrap(); let receipt = wait_transaction(&http_endpoint, tx_hash).await.unwrap(); ``` + * Bindings updated for rewards-v2 core contracts release ### Breaking Changes 🛠 -* feat!: remove delegation manager from `ELChainWriter` by @supernovahs in https://github.com/Layr-Labs/eigensdk-rs/pull/214 + +* feat!: remove delegation manager from `ELChainWriter` by @supernovahs in * `ELChainWriter::new` no longer receives the delegation manager address as first parameter. Before, a chainWriter was created this way: @@ -615,7 +640,8 @@ Those changes in added, changed or breaking changes, should include usage exampl "bead471191bea97fc3aeac36c9d74c895e8a6242602e144e43152f96219e96e8".to_string(), ); ``` -* feat!: change way bindings are generated by @MegaRedHand in https://github.com/Layr-Labs/eigensdk-rs/pull/204 + +* feat!: change way bindings are generated by @MegaRedHand in * `eigen_utils::core` contains bindings related to core contracts * `eigen_utils::middleware` contains bindings related to middleware contracts * `eigen_utils::sdk` contains bindings related to the SDK (should only be used for testing) @@ -623,18 +649,23 @@ Those changes in added, changed or breaking changes, should include usage exampl Now, to update the bindings, run `make bindings`. This command will generate the bindings files in the folder: `crates/utils`. ### Documentation 📚 -* docs: add CHANGELOG.md by @lferrigno in https://github.com/Layr-Labs/eigensdk-rs/pull/220 + +* docs: add CHANGELOG.md by @lferrigno in + ### Other Changes -* ci: change docker setup action for official one by @MegaRedHand in https://github.com/Layr-Labs/eigensdk-rs/pull/219 -* docs: add error message for `cargo test` on darwin by @MegaRedHand in https://github.com/Layr-Labs/eigensdk-rs/pull/215 -* test: fix `test_register_and_update_operator` by @ricomateo in https://github.com/Layr-Labs/eigensdk-rs/pull/223 -* chore: update way anvil state dump is generated by @ricomateo in https://github.com/Layr-Labs/eigensdk-rs/pull/222 -* fix: disable doctests on `eigen-utils` by @MegaRedHand in https://github.com/Layr-Labs/eigensdk-rs/pull/227 -* chore: bump version by @MegaRedHand in https://github.com/Layr-Labs/eigensdk-rs/pull/228 -* docs: add GitHub release changelog configuration by @MegaRedHand in https://github.com/Layr-Labs/eigensdk-rs/pull/229 + +* ci: change docker setup action for official one by @MegaRedHand in +* docs: add error message for `cargo test` on darwin by @MegaRedHand in +* test: fix `test_register_and_update_operator` by @ricomateo in +* chore: update way anvil state dump is generated by @ricomateo in +* fix: disable doctests on `eigen-utils` by @MegaRedHand in +* chore: bump version by @MegaRedHand in +* docs: add GitHub release changelog configuration by @MegaRedHand in ## [0.1.2] - 2025-01-09 + ### Added + * Added retries with exponential backoff to send transactions in [#158](https://github.com/Layr-Labs/eigensdk-rs/pull/158) * Added `query_registration_detail` method in [#162](https://github.com/Layr-Labs/eigensdk-rs/pull/162) * Added clippy lints in `Cargo.toml` in [#159](https://github.com/Layr-Labs/eigensdk-rs/pull/159) @@ -642,16 +673,19 @@ Those changes in added, changed or breaking changes, should include usage exampl * Added `common` crate to `eigensdk` crate in [#213](https://github.com/Layr-Labs/eigensdk-rs/pull/213) ### Changed + * Updated `eigenlayer-middleware` to v0.4.3 (rewards release) in [#177](https://github.com/Layr-Labs/eigensdk-rs/pull/177) * Fixed Holesky RPC provider URL in [#184](https://github.com/Layr-Labs/eigensdk-rs/pull/184) * Fixed BLS signature logic in [#174](https://github.com/Layr-Labs/eigensdk-rs/pull/174) ### Removed + * Deleted `TxManager` in [#151](https://github.com/Layr-Labs/eigensdk-rs/pull/151) * Removed `TxManager` crate import in [#211](https://github.com/Layr-Labs/eigensdk-rs/pull/211) * Removed logs in `operatorsinfo` test in [#185](https://github.com/Layr-Labs/eigensdk-rs/pull/185) ### Documentation + * Added notes for running tests in [#194](https://github.com/Layr-Labs/eigensdk-rs/pull/194) * Added "Contract Bindings" section to the README in [#178](https://github.com/Layr-Labs/eigensdk-rs/pull/178) * Added "Branches" section to the README in [#200](https://github.com/Layr-Labs/eigensdk-rs/pull/200) diff --git a/crates/chainio/clients/avsregistry/src/writer.rs b/crates/chainio/clients/avsregistry/src/writer.rs index b73e126f..43d1128d 100644 --- a/crates/chainio/clients/avsregistry/src/writer.rs +++ b/crates/chainio/clients/avsregistry/src/writer.rs @@ -373,10 +373,39 @@ impl AvsRegistryChainWriter { .send() .await .map_err(AvsRegistryError::AlloyContractError)?; - info!(tx_hash = ?tx, "successfully updated the socket with the AVS's registry coordinator"); + info!(tx_hash = ?tx,"successfully updated the socket with the AVS's registry coordinator"); Ok(*tx.tx_hash()) } + /// Set churn approver + /// + /// This function sets a new churn approver for the AVS's registry coordinator. + /// + /// # Arguments + /// + /// * `new_churn_approver` - address of the new churn approver. + /// + /// # Returns + /// + /// * `TxHash` - hash of the transaction. + pub async fn set_churn_approver( + &self, + new_churn_approver: Address, + ) -> Result { + info!("set new churn approver with the AVS's registry coordinator"); + let provider = get_signer(&self.signer.clone(), &self.provider); + + let contract_registry_coordinator = + RegistryCoordinator::new(self.registry_coordinator_addr, provider); + + contract_registry_coordinator.setChurnApprover(new_churn_approver) + .send() + .await + .map_err(AvsRegistryError::AlloyContractError) + .inspect(|tx| info!(tx_hash = ?tx,"successfully updated the new churn approver with the AVS's registry coordinator")) + .map(|tx| *tx.tx_hash()) + } + /// Force a deregistration of an operator from one or more quorums /// /// # Arguments @@ -590,10 +619,9 @@ impl AvsRegistryChainWriter { mod tests { use super::AvsRegistryChainWriter; - use crate::test_utils::build_avs_registry_chain_reader; - use crate::test_utils::create_operator_set; use crate::test_utils::{ - build_avs_registry_chain_writer, test_deregister_operator, test_register_operator, + build_avs_registry_chain_reader, build_avs_registry_chain_writer, create_operator_set, + test_deregister_operator, test_register_operator, }; use alloy::primitives::aliases::U96; use alloy::primitives::U256; @@ -784,6 +812,37 @@ mod tests { assert_eq!(stream_event.socket, new_socket_addr); } + #[tokio::test] + async fn test_set_churn_approver() { + let (_container, http_endpoint, _ws_endpoint) = start_anvil_container().await; + let private_key = FIRST_PRIVATE_KEY.to_string(); + let avs_writer = + build_avs_registry_chain_writer(http_endpoint.clone(), private_key.clone()).await; + + let provider = get_signer(&avs_writer.signer.clone(), &avs_writer.provider); + + let regcoord = RegistryCoordinator::new(avs_writer.registry_coordinator_addr, &provider); + + let current_churn_approver = regcoord.churnApprover().call().await.unwrap()._0; + let new_churn_approver = SECOND_ADDRESS; + assert_ne!(current_churn_approver, new_churn_approver); + + let tx_hash = avs_writer + .set_churn_approver(new_churn_approver) + .await + .unwrap(); + + let tx_status = wait_transaction(&http_endpoint, tx_hash) + .await + .unwrap() + .status(); + + assert!(tx_status); + + let current_churn_approver = regcoord.churnApprover().call().await.unwrap()._0; + assert_eq!(current_churn_approver, new_churn_approver); + } + #[tokio::test] async fn test_set_account_identifier() { let (_container, http_endpoint, _ws_endpoint) = start_anvil_container().await;