Closed adu-web3 closed 3 months ago
The recent updates enhance the capabilities of smart contracts managing operator-staker associations. New public functions have been added for associating and dissociating operators, while outdated validation logic has been removed. These modifications aim to streamline operations in the multi-chain ecosystem, improving interactions and clarity in contract management.
Files | Change Summary |
---|---|
src/core/ExocoreGateway.sol , src/interfaces/precompiles/IDelegation.sol |
Introduced functions for associating/dissociating operators with EVM stakers, enhancing management capabilities and clarifying parameter names. |
src/storage/BootstrapStorage.sol |
Removed address validation constants and logic, simplifying address handling within the contract. |
src/storage/ExocoreGatewayStorage.sol , src/storage/GatewayStorage.sol |
Added new constants, events, and a validation modifier for address formats, improving error handling and operation clarity. |
test/foundry/unit/ExocoreGateway.t.sol |
Enhanced tests for operator association/dissociation, including new events and coverage for edge case scenarios. |
test/mocks/DelegationMock.sol |
Introduced mappings and functions for managing operator-staker associations, improving error handling and contract usability. |
sequenceDiagram
participant Staker
participant Operator
participant Gateway
Staker->>Gateway: Request Associate Operator
Gateway->>Operator: Validate Staker
Operator-->>Gateway: Confirmation
Gateway-->>Staker: Association Success
sequenceDiagram
participant Staker
participant Operator
participant Gateway
Staker->>Gateway: Request Dissociate Operator
Gateway->>Operator: Validate Staker Association
Operator-->>Gateway: Confirmation
Gateway-->>Staker: Dissociation Success
π° In the meadow where the bunnies play,
New changes sprout, brightening the day.
Operators and stakers, hand in paw,
Build a network, with no flaw.
With hops of joy, we celebrate,
Smart contracts dance, oh, isnβt it great! π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Description
This PR would collaborate with https://github.com/ExocoreNetwork/exocore/pull/125 to make self-delegate possible. As Chuang's design doc presents, there are generally three types of client chains regarding self-delegate process:
For type 1 client chains, to associate an EVM address with an operator address is simple: the authority that holds the key for the EVM address could always send an EVM transaction to Exocore and call
ExocoreGateway.associateOpratorWithEVMStaker
, since the EVM address should remain the same for the same private key no matter which EVM-compatible chain the transaction is sent to.Things get more difficult for type 2 client chains: even for the same private key, owing to different cryptographic schemes, the address could be different for EVM and other VM, and we can't link these two addresses without knowing the private key. So in this case, staker should initiate the request from client chain and send the request to Exocore via bridge, so that we could link a Non-EVM address with an operator address.
It is most difficult for type 3 client chains, where we have to recover staker's address from its signature in Exocore's contracts and then link that address with some operator address. We would leave this for future implementation as it brings many complexities.
Summary by CodeRabbit
Summary by CodeRabbit
New Features
IDelegation
interface with new functions for operator-staker management.Bug Fixes
Chores