Closed adu-web3 closed 1 week ago
This pull request introduces significant changes to the staking and deposit functionality within the Ethereum ecosystem. Key modifications include renaming the depositBeaconChainValidator
method to verifyAndDepositNativeStake
, reflecting a shift towards enhanced verification processes. The implementation of an ImmutableConfig
struct across various contracts simplifies parameter management during contract initialization. Additionally, new validation checks and error handling mechanisms are introduced to ensure the integrity of deposit operations. Overall, these changes streamline the deposit process and improve the organization of code across multiple contracts.
File Path | Change Summary |
---|---|
docs/native_deposit_workflow.wsd | Renamed method: depositBeaconChainValidator → verifyAndDepositNativeStake in NativeRestakingController . |
script/12_RedeployClientChainGateway.s.sol | Added import for BootstrapStorage . Updated run function to use ImmutableConfig struct for ClientChainGateway instantiation. |
script/13_DepositValidator.s.sol | Updated method call from clientGateway.depositBeaconChainValidator to clientGateway.verifyAndDepositNativeStake . |
script/14_CorrectBootstrapErrors.s.sol | Added import for BootstrapStorage . Updated setUp function with additional address checks. Replaced individual parameters with ImmutableConfig struct in Bootstrap instantiation. |
script/2_DeployBoth.s.sol | Added import for BootstrapStorage . Updated run function to utilize ImmutableConfig struct for ClientChainGateway instantiation. |
script/7_DeployBootstrap.s.sol | Added import for BootstrapStorage . Updated run function to deploy Bootstrap using ImmutableConfig struct. |
script/integration/1_DeployBootstrap.s.sol | Added imports for EigenLayerBeaconOracle , BootstrapStorage , and ExoCapsule . Updated deployContract to use ImmutableConfig struct for Bootstrap initialization. |
src/core/Bootstrap.sol | Added new methods for native restaking. Updated constructor to accept ImmutableConfig struct. |
src/core/ClientChainGateway.sol | Updated constructor to accept ImmutableConfig struct. |
src/core/NativeRestakingController.sol | Renamed function depositBeaconChainValidator to verifyAndDepositNativeStake . Removed nativeRestakingEnabled modifier. |
src/interfaces/INativeRestakingController.sol | Renamed function depositBeaconChainValidator to verifyAndDepositNativeStake . Added new function withdrawNonBeaconChainETHFromCapsule . |
src/storage/BootstrapStorage.sol | Added new mapping ownerToCapsule and ImmutableConfig struct. Updated constructor to accept ImmutableConfig . |
src/storage/ClientChainGatewayStorage.sol | Removed ownerToCapsule mapping. Updated constructor to accept ImmutableConfig and simplified state management. |
test/foundry/BootstrapDepositNST.t.sol | Introduced a new test contract for Bootstrap functionality, including various test cases for deposit processes and event emissions. |
test/foundry/DepositWithdrawPrinciple.t.sol | Updated test cases to reflect the new method name verifyAndDepositNativeStake . Enhanced event emissions for deposit and withdrawal workflows. |
test/foundry/ExocoreDeployer.t.sol | Added import for BootstrapStorage . Updated ClientChainGateway instantiation to use ImmutableConfig struct. |
test/foundry/Governance.t.sol | Added import for BootstrapStorage . Updated ClientChainGateway constructor to use ImmutableConfig . |
test/foundry/unit/Bootstrap.t.sol | Added tests for staking functionality and updated initialization to use ImmutableConfig . |
test/foundry/unit/ClientChainGateway.t.sol | Modified test setup to use ImmutableConfig for ClientChainGateway initialization. |
depositBeaconChainValidator
function to verifyAndDepositNativeStake
.LSTRestakingController
and Bootstrap
contracts, ensuring adherence to necessary checks.markBootstrapped
function, related to overall control flow and error handling improvements.🐇 In the meadow where the stakes are high,
A rabbit hops beneath the sky.
With deposits verified, oh what a sight,
New structures in place, everything feels right!
So let us cheer for the code that's neat,
For every hop, a new feature's sweet! 🌼
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?
Linting failed. Please check the logs.
The tests have failed. Please check the logs.
Storage layout compatibility check failed. This could be due to a mismatch between Bootstrap and ClientChainGateway, or incompatibility with deployed contracts on Sepolia. Please check the logs for details.
Storage layout compatibility check failed. This could be due to a mismatch between Bootstrap and ClientChainGateway, or incompatibility with deployed contracts on Sepolia. Please check the logs for details.
Storage layout compatibility check failed. This could be due to a mismatch between Bootstrap and ClientChainGateway, or incompatibility with deployed contracts on Sepolia. Please check the logs for details.
Storage layout compatibility check failed. This could be due to a mismatch between Bootstrap and ClientChainGateway, or incompatibility with deployed contracts on Sepolia. Please check the logs for details.
Storage layout compatibility check failed. This could be due to a mismatch between Bootstrap and ClientChainGateway, or incompatibility with deployed contracts on Sepolia. Please check the logs for details.
This PR would lead to failure of upgrading the current ClientChainGateway
, since it has changed some state slots(https://github.com/ExocoreNetwork/exocore-contracts/pull/121#discussion_r1822176226). @cloud8little do you think this is acceptable? If acceptable, I would disable the compare-storage-layout job to make this PR able to merge
Description
As we need to support Ethereum native restaking during bootstrap, we should allow the stakers to deposit staked ETH of beacon chain to Exocore, by pointing withdrawal credentials to capsule contract the staker creates and owns.
TODO:
Bootstrap
inheritINativeRestakingController
and implement relative functionsownerToCapsule
state fromClientChainGatewayStorage
toBootstrapStorage
BootstrapStorage
constructor function by usingImmutableConfig
struct to work aroundstack too deep
compilation errorBootstrap.t.sol
and integration test inBootstrapDepositNSTTest.t.sol
Summary by CodeRabbit
New Features
verifyAndDepositNativeStake
function for enhanced deposit verification and processing.withdrawNonBeaconChainETHFromCapsule
function for ETH withdrawals from ExoCapsule.ImmutableConfig
struct consolidates configuration parameters for improved contract initialization.Bug Fixes
InvalidImmutableConfig
error for better error management in configuration.Tests
Documentation