datahaven/contracts/config/example.jsonc

109 lines
7.1 KiB
Text
Raw Permalink Normal View History

//! REMOVE ALL COMMENTS AND CHANGE EXTENSION TO `.json` BEFORE USING
//! Parsing JSONC is not supported by the Solidity JSON parser, so we need to remove the comments before using the config
{
"eigenLayer": {
"pausers": [
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
],
"unpauser": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
/// Account authorised to update pending rewards merkle root in the RewardsCoordinator contract.
/// In practice, this is the account used by the off-chain rewards updater service.
/// See https://github.com/Layr-Labs/eigenlayer-contracts/tree/dev/docs#rewardscoordinator
"rewardsUpdater": "0x90F79bf6EB2c4f870365E785982E1f101E93b906",
/// The interval at which the new rewards merkle root is calculated.
/// See testnet deployment: https://holesky.etherscan.io/address/0xAcc1fb458a1317E886dB376Fc8141540537E68fE#readProxyContract#F1
"calculationIntervalSeconds": 86400,
/// The maximum duration of rewards that can be retroactively applied.
/// See testnet deployment: https://holesky.etherscan.io/address/0xAcc1fb458a1317E886dB376Fc8141540537E68fE#readProxyContract#F5
"maxRewardsDuration": 6048000,
/// The maximum retroactive length of rewards that can be applied.
/// See testnet deployment: https://holesky.etherscan.io/address/0xAcc1fb458a1317E886dB376Fc8141540537E68fE#readProxyContract#F4
"maxRetroactiveLength": 7776000,
/// The maximum duration of rewards that can be applied in the future.
/// See testnet deployment: https://holesky.etherscan.io/address/0xAcc1fb458a1317E886dB376Fc8141540537E68fE#readProxyContract#F3
"maxFutureLength": 2592000,
/// The timestamp at which rewards are first calculated.
/// See testnet deployment: https://holesky.etherscan.io/address/0xAcc1fb458a1317E886dB376Fc8141540537E68fE#readProxyContract#F2
"genesisRewardsTimestamp": 1710979200,
/// Delay in timestamp (seconds) before a posted root can be claimed against
/// See testnet deployment: https://holesky.etherscan.io/address/0xAcc1fb458a1317E886dB376Fc8141540537E68fE#readProxyContract#F6
"activationDelay": 7200,
/// Also called "defaultOperatorSplitBips"
/// Used off-chain by the rewards updater to calculate an Operator's split for a specific reward.
/// See testnet deployment: https://holesky.etherscan.io/address/0xAcc1fb458a1317E886dB376Fc8141540537E68fE#readProxyContract#F7
"globalCommissionBips": 1000,
/// Multisig address for controlling operations (we don't care as much about this).
"executorMultisig": "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65",
/// Multisig address for executing operations (we don't care as much about this).
"operationsMultisig": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
/// The delay in blocks before withdrawals can be completed.
/// See testnet deployment: https://holesky.etherscan.io/address/0xA44151489861Fe9e3055d95adC98FbD462B948e7#readProxyContract#F24
"minWithdrawalDelayBlocks": 50,
/// The initial paused status of the DelegationManager
/// See here for more details: https://github.com/Layr-Labs/eigenlayer-contracts/blob/db0f582ba9b4df861b72269267d4980d7f3f7490/src/contracts/permissions/Pausable.sol#L12
"delegationInitPausedStatus": 0,
/// The initial paused status of the EigenPodManager
/// See here for more details: https://github.com/Layr-Labs/eigenlayer-contracts/blob/db0f582ba9b4df861b72269267d4980d7f3f7490/src/contracts/permissions/Pausable.sol#L12
"eigenPodManagerInitPausedStatus": 0,
/// The initial paused status of the RewardsCoordinator
/// See here for more details: https://github.com/Layr-Labs/eigenlayer-contracts/blob/db0f582ba9b4df861b72269267d4980d7f3f7490/src/contracts/permissions/Pausable.sol#L12
"rewardsCoordinatorInitPausedStatus": 0,
/// The initial paused status of the AllocationManager
/// See here for more details: https://github.com/Layr-Labs/eigenlayer-contracts/blob/db0f582ba9b4df861b72269267d4980d7f3f7490/src/contracts/permissions/Pausable.sol#L12
"allocationManagerInitPausedStatus": 0,
/// The delay in blocks before deallocations can be completed.
/// See testnet deployment: https://holesky.etherscan.io/address/0x78469728304326CBc65f8f95FA756B0B73164462#readProxyContract#F2
"deallocationDelay": 50,
/// The delay in blocks before allocation configuration can be completed.
/// See testnet deployment: https://holesky.etherscan.io/address/0x78469728304326CBc65f8f95FA756B0B73164462#readProxyContract#F1
"allocationConfigurationDelay": 75,
/// The genesis time of the beacon state, to help EL calculate conversions between slot and timestamp
/// See testnet deployment: https://holesky.etherscan.io/address/0x68bd1e75E9863C9066B46B8a44E953F918466D37#readContract#F1
"beaconChainGenesisTimestamp": 1695902400
},
"avs": {
/// The owner of the DataHaven Service Manager contract.
"avsOwner": "0x976EA74026E726554dB657fA54763abd0C3a0aa9",
/// The address of the account that initiates the rewards calculation.
/// This is for the EigenLayer rewards distribution way, using the RewardsCoordinator.
/// But for now, we're not using it, and instead sending the rewards directly.
"rewardsInitiator": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955",
/// The address of the account that is a member of the Veto Committee for vetoing slashing.
"vetoCommitteeMember": "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f",
/// The number of blocks that the Veto Committee will have to submit a veto.
"vetoWindowBlocks": 100,
/// The EigenLayer strategy addresses for the Validators to stake into.
feat: ✨ Datahaven contracts deployment on public testnet (#123) ## Summary This PR introduces support for deploying Datahaven contracts to different chains (hoodi, holesky, mainnet), as well as a new cli command to manage this deployment separately from the regular deployment, while maintaining compatibility with it. #### New CLI command - **`bun cli contracts deploy`** - Deploy contracts to supported chains (Hoodi, Holesky, Mainnet) - **`bun cli contracts status`** - Check deployment configuration and status - **`bun cli contracts verify`** - Verify contracts on block explorers - Commands need the chain parameter: `--chain <hoodi | holesky | mainnet>` - Right now only `hoodi` and `holesky` are supported ### Deployment #### Hoodi & Holesky Network Support - Added **DeployBase.s.sol** as common ground for **DeployTestnet.s.sol** (also new) and **DeployLocal.s.sol** (existing). - **Hoodi configuration** (`contracts/config/hoodi.json`) with deployed EigenLayer contract addresses to reference. - **Holesky configuration** (`contracts/config/hoodi.json`) with deployed EigenLayer contract addresses to reference. #### Contracts being deployed - **DataHaven**: ServiceManager, VetoableSlasher, RewardsRegistry - **Snowbridge**: BeefyClient, AgentExecutor, Gateway, RewardsAgent - **EigenLayer**: References existing deployed contracts (not re-deployed) #### Deployment files When the deployment is done, a new file under `contracts/deployments` is generated with the addresses of the deployed contracts, for each chain (it will be overriden per chain if run multiple times). So we would have one `anvil.json`, `hoodi.json`, `holesky.json`, etc, with the addresses of the deployed contracts for reference and for later verification. #### Todo - [x] Test compatibility with existing `bun cli launch` and `bun cli deploy` commands #### For follow-up PRs - Fix verification issue with `foundry verify-contracts` when specifying the `chain` or `chain-id` parameter, needed for hoodi (https://github.com/foundry-rs/foundry/issues/7466). - Add `redeploy` feature to only override implementation contract and leave the proxy address untouched ## Usage Examples ```bash # Deploy to Hoodi network bun cli contracts deploy --chain hoodi # Check deployment status bun cli contracts status --chain hoodi # Verify contracts on block explorer bun cli contracts verify --chain hoodi ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added deployment and configuration support for new networks "hoodi" and "holesky", including new configuration and deployment files. * Introduced a CLI tool for managing contract deployments, status checks, and verification across supported chains. * Added example environment configuration and comprehensive deployment documentation. * Enabled contract verification and status reporting via the CLI with support for block explorer integration. * **Improvements** * Refactored deployment scripts for modularity, supporting both local and testnet environments. * Centralized and extended configuration loading to support additional contract addresses and network parameters. * Enhanced deployment utilities and typings to support multi-network deployments. * **Bug Fixes** * Improved input validation and error handling in CLI commands and deployment scripts. * Added explicit handling for zero address in operator strategy retrieval. * **Chores** * Updated documentation and configuration templates for easier onboarding and deployment management. * Improved logging and output formatting for deployment and verification processes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com> Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
2025-08-21 10:02:31 +00:00
"validatorsStrategies": []
},
"snowbridge": {
/// Minimum delay in number of blocks that a relayer must wait between calling
/// submitInitial and commitPrevRandao. In production this should be set to MAX_SEED_LOOKAHEAD:
/// https://eth2book.info/altair/part3/config/preset#max_seed_lookahead
"randaoCommitDelay": 4,
/// after randaoCommitDelay is reached, relayer must call commitPrevRandao within this number of blocks.
/// Without this expiration, relayers can roll the dice infinitely to get the subsampling
/// they desire.
"randaoCommitExpiration": 24,
/// The minimum number of required signatures for a Randao commit to be valid.
"minNumRequiredSignatures": 2,
/// Initial BEEFY block number.
"startBlock": 1,
/// The origin linked to the Rewards Agent, the Agent contract who's allowed to submit
/// new reward merkle roots to the RewardsRegistry contract.
"rewardsMessageOrigin": "0x0000000000000000000000000000000000000000000000000000000000000000",
Fix: 🏗️ Message encoding / decoding (#113) ## Summary of changes - We decided to remove the topics and nonce from the massage encoding since we don't use them (original commit: https://github.com/Moonsong-Labs/datahaven/commit/ee2a3f2fd432e0f8623a9798730ce697bfc52d34). - Besides, we already have a nonce at the Snowbridge message level https://github.com/Moonsong-Labs/datahaven/blob/f4ab5c2b2e93c775555ab4b8d0b2babaf5bc15b7/operator/primitives/snowbridge/inbound-queue/src/v2/message.rs#L105 - I had to recreate the static test for _encoding_ (happens in [DataHavenSnowbridgeMessages.sol](https://github.com/Moonsong-Labs/datahaven/blob/d12d40634f16eb9642b5b94cbc364b6679339393/contracts/src/libraries/DataHavenSnowbridgeMessages.sol) ) / _decoding_ (happens in [operator/primitives/bridge/src/lib.rs)](https://github.com/Moonsong-Labs/datahaven/blob/f9f9cc65fe33c86ac91f2097adbcb945b1746277/operator/primitives/bridge/src/lib.rs). Now it matches the current structure. The idea is that now we can test that we don't break the decoding in followup refactoring. - Fixes a problem with EigenLayer validator addresses. In all our contracts we were using `bytes32` to refer to a Solochain validator address. But on our Substrate change we actually expect AccountId20, so only 20 bytes. This was causing the decoding to fail. - I opted for the minimal change that would be to take the right-most 20 bytes to send that to our chain. But we might want aswell to limit our EigenLayer contracts to be only 20 bytes long. @ahmadkaouk showcase this [here](https://github.com/Moonsong-Labs/datahaven/commit/92a34c273ca439341bd8b61ff3592cef45ba4727) - Adds a bash script to run the static test. The test will compile the contracts, run the encoding test, compile the operator, and run the decoding test. This saves a huge amount of time since we don't need to run the full e2e setup. The way of running it is the following: ```bash cd operator/test/scripts ./test_message_encoding.sh ``` - As a consequence of this PR, the execution relayer now works properly. EDIT: > [!IMPORTANT] **We decided to use 20-byte addresses in our contracts**. So what is stated above is not valid anymore. The change implies that the mapping from Ethereum addresses to bytes32 addresses now it's a mapping as follows: https://github.com/Moonsong-Labs/datahaven/blob/dd3ba99ac0553a33448dc77efbbea08cacd278e6/contracts/src/DataHavenServiceManager.sol#L51-L52 I've updated helper functions, tests, etc to be compliant with this change. The execution relayer and beefy relayer look stable now. --------- Co-authored-by: Ahmad Kaouk <ahmadkaouk.93@gmail.com> Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
2025-07-16 07:38:58 +00:00
/// The initial validator hashes for the BEEFY light client.
"initialValidatorHashes": [
"0x8626f6940e2eb28930efb4cef49b2d1f2c9c1199914b9e5506744e80bd0fd33d",
"0xdf57089febbacf7ba0bc227dafbffa9fc08a93fdc68e1e42411a14efcf23656e"
],
Fix: 🏗️ Message encoding / decoding (#113) ## Summary of changes - We decided to remove the topics and nonce from the massage encoding since we don't use them (original commit: https://github.com/Moonsong-Labs/datahaven/commit/ee2a3f2fd432e0f8623a9798730ce697bfc52d34). - Besides, we already have a nonce at the Snowbridge message level https://github.com/Moonsong-Labs/datahaven/blob/f4ab5c2b2e93c775555ab4b8d0b2babaf5bc15b7/operator/primitives/snowbridge/inbound-queue/src/v2/message.rs#L105 - I had to recreate the static test for _encoding_ (happens in [DataHavenSnowbridgeMessages.sol](https://github.com/Moonsong-Labs/datahaven/blob/d12d40634f16eb9642b5b94cbc364b6679339393/contracts/src/libraries/DataHavenSnowbridgeMessages.sol) ) / _decoding_ (happens in [operator/primitives/bridge/src/lib.rs)](https://github.com/Moonsong-Labs/datahaven/blob/f9f9cc65fe33c86ac91f2097adbcb945b1746277/operator/primitives/bridge/src/lib.rs). Now it matches the current structure. The idea is that now we can test that we don't break the decoding in followup refactoring. - Fixes a problem with EigenLayer validator addresses. In all our contracts we were using `bytes32` to refer to a Solochain validator address. But on our Substrate change we actually expect AccountId20, so only 20 bytes. This was causing the decoding to fail. - I opted for the minimal change that would be to take the right-most 20 bytes to send that to our chain. But we might want aswell to limit our EigenLayer contracts to be only 20 bytes long. @ahmadkaouk showcase this [here](https://github.com/Moonsong-Labs/datahaven/commit/92a34c273ca439341bd8b61ff3592cef45ba4727) - Adds a bash script to run the static test. The test will compile the contracts, run the encoding test, compile the operator, and run the decoding test. This saves a huge amount of time since we don't need to run the full e2e setup. The way of running it is the following: ```bash cd operator/test/scripts ./test_message_encoding.sh ``` - As a consequence of this PR, the execution relayer now works properly. EDIT: > [!IMPORTANT] **We decided to use 20-byte addresses in our contracts**. So what is stated above is not valid anymore. The change implies that the mapping from Ethereum addresses to bytes32 addresses now it's a mapping as follows: https://github.com/Moonsong-Labs/datahaven/blob/dd3ba99ac0553a33448dc77efbbea08cacd278e6/contracts/src/DataHavenServiceManager.sol#L51-L52 I've updated helper functions, tests, etc to be compliant with this change. The execution relayer and beefy relayer look stable now. --------- Co-authored-by: Ahmad Kaouk <ahmadkaouk.93@gmail.com> Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
2025-07-16 07:38:58 +00:00
/// The next validator hashes for the BEEFY light client.
"nextValidatorHashes": [
"0x8626f6940e2eb28930efb4cef49b2d1f2c9c1199914b9e5506744e80bd0fd33d",
"0xdf57089febbacf7ba0bc227dafbffa9fc08a93fdc68e1e42411a14efcf23656e"
]
}
}