diff --git a/contracts/lib/eigenlayer-middleware b/contracts/lib/eigenlayer-middleware index 48e0aecae3..a2b1847374 160000 --- a/contracts/lib/eigenlayer-middleware +++ b/contracts/lib/eigenlayer-middleware @@ -1 +1 @@ -Subproject commit 48e0aecae3f778356a5009f912ade946b285fe9b +Subproject commit a2b1847374350a723a34207578c098821302fa8b diff --git a/contracts/script/EigenDADeployer.s.sol b/contracts/script/EigenDADeployer.s.sol index 06abf132bd..fba50be2e0 100644 --- a/contracts/script/EigenDADeployer.s.sol +++ b/contracts/script/EigenDADeployer.s.sol @@ -191,6 +191,9 @@ contract EigenDADeployer is DeployOpenEigenLayer { stakeRegistry ); + address[] memory confirmers = new address[](1); + confirmers[0] = addressConfig.eigenDACommunityMultisig; + // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. eigenDAProxyAdmin.upgradeAndCall( TransparentUpgradeableProxy(payable(address(eigenDAServiceManager))), @@ -200,7 +203,7 @@ contract EigenDADeployer is DeployOpenEigenLayer { eigenDAPauserReg, 0, addressConfig.eigenDACommunityMultisig, - addressConfig.eigenDACommunityMultisig + confirmers ) ); diff --git a/contracts/script/deploy/holesky/Holesky_Deploy.s.sol b/contracts/script/deploy/holesky/Holesky_Deploy.s.sol index cbfad997bf..b38429b8b3 100644 --- a/contracts/script/deploy/holesky/Holesky_Deploy.s.sol +++ b/contracts/script/deploy/holesky/Holesky_Deploy.s.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 +/* pragma solidity =0.8.12; import {PauserRegistry} from "eigenlayer-core/contracts/permissions/PauserRegistry.sol"; @@ -89,7 +90,7 @@ contract Deployer_Holesky is ExistingDeploymentParser { /** * First, deploy upgradeable proxy contracts that **will point** to the implementations. Since the implementation contracts are * not yet deployed, we give these proxies an empty contract as the initial implementation, to act as if they have no code. - */ + *//* eigenDAServiceManager = EigenDAServiceManager( address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), "")) ); @@ -377,3 +378,4 @@ contract Deployer_Holesky is ExistingDeploymentParser { ejector = stdJson.readAddress(config_data, ".permissions.ejector"); } } +*/ \ No newline at end of file diff --git a/contracts/script/deploy/mainnet/Mainnet_Deploy.s.sol b/contracts/script/deploy/mainnet/Mainnet_Deploy.s.sol new file mode 100644 index 0000000000..3126e53f36 --- /dev/null +++ b/contracts/script/deploy/mainnet/Mainnet_Deploy.s.sol @@ -0,0 +1,558 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity =0.8.12; + +import {PauserRegistry} from "eigenlayer-core/contracts/permissions/PauserRegistry.sol"; +import {EmptyContract} from "eigenlayer-core/test/mocks/EmptyContract.sol"; + +import {BLSApkRegistry} from "eigenlayer-middleware/BLSApkRegistry.sol"; +import {IBLSApkRegistry} from "eigenlayer-middleware/interfaces/IBLSApkRegistry.sol"; +import {RegistryCoordinator} from "eigenlayer-middleware/RegistryCoordinator.sol"; +import {IRegistryCoordinator} from "eigenlayer-middleware/interfaces/IRegistryCoordinator.sol"; +import {IndexRegistry} from "eigenlayer-middleware/IndexRegistry.sol"; +import {IIndexRegistry} from "eigenlayer-middleware/interfaces/IIndexRegistry.sol"; +import {StakeRegistry} from "eigenlayer-middleware/StakeRegistry.sol"; +import {IStakeRegistry} from "eigenlayer-middleware/interfaces/IStakeRegistry.sol"; +import {EigenDAServiceManager} from "src/core/EigenDAServiceManager.sol"; +import {IServiceManager} from "eigenlayer-middleware/interfaces/IServiceManager.sol"; +import {OperatorStateRetriever} from "eigenlayer-middleware/OperatorStateRetriever.sol"; +import {ServiceManagerRouter} from "eigenlayer-middleware/ServiceManagerRouter.sol"; + +import "eigenlayer-scripts/utils/ExistingDeploymentParser.sol"; +import "forge-std/Test.sol"; +import "forge-std/Script.sol"; +import "forge-std/StdJson.sol"; + +contract Deployer_Mainnet is ExistingDeploymentParser { + + string public existingDeploymentInfoPath = string(bytes("./script/deploy/mainnet/mainnet_addresses.json")); + string public deployConfigPath = string(bytes("./script/deploy/mainnet/mainnet.config.json")); + string public outputPath = string(bytes("script/deploy/mainnet/mainnet_deployment_data.json")); + + ProxyAdmin public eigenDAProxyAdmin; + address public eigenDAOwner; + address public eigenDAUpgrader; + address public batchConfirmer; + address public fallbackBatchConfirmer; + address public pauser; + uint256 public initalPausedStatus; + address public deployer; + + BLSApkRegistry public apkRegistry; + EigenDAServiceManager public eigenDAServiceManager; + RegistryCoordinator public registryCoordinator; + IndexRegistry public indexRegistry; + StakeRegistry public stakeRegistry; + OperatorStateRetriever public operatorStateRetriever; + ServiceManagerRouter public serviceManagerRouter; + + BLSApkRegistry public apkRegistryImplementation; + EigenDAServiceManager public eigenDAServiceManagerImplementation; + RegistryCoordinator public registryCoordinatorImplementation; + IndexRegistry public indexRegistryImplementation; + StakeRegistry public stakeRegistryImplementation; + + function run() external { + // get info on all the already-deployed contracts + _parseDeployedContracts(existingDeploymentInfoPath); + + // READ JSON CONFIG DATA + string memory config_data = vm.readFile(deployConfigPath); + + // check that the chainID matches the one in the config + uint256 currentChainId = block.chainid; + uint256 configChainId = stdJson.readUint(config_data, ".chainInfo.chainId"); + emit log_named_uint("You are deploying on ChainID", currentChainId); + require(configChainId == currentChainId, "You are on the wrong chain for this config"); + + // parse the addresses of permissioned roles + eigenDAOwner = stdJson.readAddress(config_data, ".permissions.owner"); + eigenDAUpgrader = stdJson.readAddress(config_data, ".permissions.upgrader"); + batchConfirmer = stdJson.readAddress(config_data, ".permissions.batchConfirmer"); + fallbackBatchConfirmer = stdJson.readAddress(config_data, ".permissions.fallbackBatchConfirmer"); + initalPausedStatus = stdJson.readUint(config_data, ".permissions.initalPausedStatus"); + + pauser = address(eigenLayerPauserReg); + + deployer = stdJson.readAddress(config_data, ".permissions.deployer"); + require(deployer == tx.origin, "Deployer address must be the same as the tx.origin"); + emit log_named_address("You are deploying from", deployer); + + vm.startBroadcast(); + + // deploy proxy admin for ability to upgrade proxy contracts + eigenDAProxyAdmin = new ProxyAdmin(); + + //deploy service manager router + serviceManagerRouter = new ServiceManagerRouter(); + + /** + * First, deploy upgradeable proxy contracts that **will point** to the implementations. Since the implementation contracts are + * not yet deployed, we give these proxies an empty contract as the initial implementation, to act as if they have no code. + */ + eigenDAServiceManager = EigenDAServiceManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), "")) + ); + registryCoordinator = RegistryCoordinator( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), "")) + ); + indexRegistry = IndexRegistry( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), "")) + ); + stakeRegistry = StakeRegistry( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), "")) + ); + apkRegistry = BLSApkRegistry( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), "")) + ); + + //deploy index registry implementation + indexRegistryImplementation = new IndexRegistry( + registryCoordinator + ); + + //upgrade index registry proxy to implementation + eigenDAProxyAdmin.upgrade( + TransparentUpgradeableProxy(payable(address(indexRegistry))), + address(indexRegistryImplementation) + ); + + //deploy stake registry implementation + stakeRegistryImplementation = new StakeRegistry( + registryCoordinator, + delegationManager + ); + + //upgrade stake registry proxy to implementation + eigenDAProxyAdmin.upgrade( + TransparentUpgradeableProxy(payable(address(stakeRegistry))), + address(stakeRegistryImplementation) + ); + + //deploy apk registry implementation + apkRegistryImplementation = new BLSApkRegistry( + registryCoordinator + ); + + //upgrade apk registry proxy to implementation + eigenDAProxyAdmin.upgrade( + TransparentUpgradeableProxy(payable(address(apkRegistry))), + address(apkRegistryImplementation) + ); + + //deploy the registry coordinator implementation. + registryCoordinatorImplementation = new RegistryCoordinator( + IServiceManager(address(eigenDAServiceManager)), + stakeRegistry, + apkRegistry, + indexRegistry + ); + + { + // parse initalization params and permissions from config data + ( + uint96[] memory minimumStakeForQuourm, + IStakeRegistry.StrategyParams[][] memory strategyAndWeightingMultipliers + ) = _parseStakeRegistryParams(config_data); + ( + IRegistryCoordinator.OperatorSetParam[] memory operatorSetParams, + address churner, + address ejector + ) = _parseRegistryCoordinatorParams(config_data); + + //upgrade the registry coordinator proxy to implementation + eigenDAProxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(payable(address(registryCoordinator))), + address(registryCoordinatorImplementation), + abi.encodeWithSelector( + RegistryCoordinator.initialize.selector, + eigenDAOwner, + churner, + ejector, + IPauserRegistry(pauser), + initalPausedStatus, + operatorSetParams, + minimumStakeForQuourm, + strategyAndWeightingMultipliers + ) + ); + } + + //deploy the eigenDA service manager implementation + eigenDAServiceManagerImplementation = new EigenDAServiceManager( + avsDirectory, + registryCoordinator, + stakeRegistry + ); + + address[] memory batchConfirmers = new address[](2); + batchConfirmers[0] = batchConfirmer; + batchConfirmers[1] = fallbackBatchConfirmer; + + //upgrade the eigenDA service manager proxy to implementation + eigenDAProxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(payable(address(eigenDAServiceManager))), + address(eigenDAServiceManagerImplementation), + abi.encodeWithSelector( + EigenDAServiceManager.initialize.selector, + IPauserRegistry(pauser), + initalPausedStatus, + deployer, + batchConfirmers + ) + ); + + string memory metadataURI = stdJson.readString(config_data, ".uri"); + eigenDAServiceManager.updateAVSMetadataURI(metadataURI); + eigenDAServiceManager.transferOwnership(eigenDAOwner); + + //deploy the operator state retriever + operatorStateRetriever = new OperatorStateRetriever(); + + // transfer ownership of proxy admin to upgrader + eigenDAProxyAdmin.transferOwnership(eigenDAUpgrader); + + vm.stopBroadcast(); + + // sanity checks + __verifyContractPointers( + apkRegistry, + eigenDAServiceManager, + registryCoordinator, + indexRegistry, + stakeRegistry + ); + + __verifyContractPointers( + apkRegistryImplementation, + eigenDAServiceManagerImplementation, + registryCoordinatorImplementation, + indexRegistryImplementation, + stakeRegistryImplementation + ); + + __verifyImplementations(); + __verifyInitalizations(config_data); + + //write output + _writeOutput(config_data); + } + + function xtest() external { + // get info on all the already-deployed contracts + _parseDeployedContracts(existingDeploymentInfoPath); + + // READ JSON CONFIG DATA + string memory config_data = vm.readFile(deployConfigPath); + + // check that the chainID matches the one in the config + uint256 currentChainId = block.chainid; + uint256 configChainId = stdJson.readUint(config_data, ".chainInfo.chainId"); + emit log_named_uint("You are deploying on ChainID", currentChainId); + require(configChainId == currentChainId, "You are on the wrong chain for this config"); + + // parse the addresses of permissioned roles + eigenDAOwner = stdJson.readAddress(config_data, ".permissions.owner"); + eigenDAUpgrader = stdJson.readAddress(config_data, ".permissions.upgrader"); + batchConfirmer = stdJson.readAddress(config_data, ".permissions.batchConfirmer"); + fallbackBatchConfirmer = stdJson.readAddress(config_data, ".permissions.fallbackBatchConfirmer"); + initalPausedStatus = stdJson.readUint(config_data, ".permissions.initalPausedStatus"); + + pauser = address(eigenLayerPauserReg); + + deployer = stdJson.readAddress(config_data, ".permissions.deployer"); + vm.startPrank(deployer); + + // deploy proxy admin for ability to upgrade proxy contracts + eigenDAProxyAdmin = new ProxyAdmin(); + + //deploy service manager router + serviceManagerRouter = new ServiceManagerRouter(); + + /** + * First, deploy upgradeable proxy contracts that **will point** to the implementations. Since the implementation contracts are + * not yet deployed, we give these proxies an empty contract as the initial implementation, to act as if they have no code. + */ + eigenDAServiceManager = EigenDAServiceManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), "")) + ); + registryCoordinator = RegistryCoordinator( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), "")) + ); + indexRegistry = IndexRegistry( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), "")) + ); + stakeRegistry = StakeRegistry( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), "")) + ); + apkRegistry = BLSApkRegistry( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), "")) + ); + + //deploy index registry implementation + indexRegistryImplementation = new IndexRegistry( + registryCoordinator + ); + + //upgrade index registry proxy to implementation + eigenDAProxyAdmin.upgrade( + TransparentUpgradeableProxy(payable(address(indexRegistry))), + address(indexRegistryImplementation) + ); + + //deploy stake registry implementation + stakeRegistryImplementation = new StakeRegistry( + registryCoordinator, + delegationManager + ); + + //upgrade stake registry proxy to implementation + eigenDAProxyAdmin.upgrade( + TransparentUpgradeableProxy(payable(address(stakeRegistry))), + address(stakeRegistryImplementation) + ); + + //deploy apk registry implementation + apkRegistryImplementation = new BLSApkRegistry( + registryCoordinator + ); + + //upgrade apk registry proxy to implementation + eigenDAProxyAdmin.upgrade( + TransparentUpgradeableProxy(payable(address(apkRegistry))), + address(apkRegistryImplementation) + ); + + //deploy the registry coordinator implementation. + registryCoordinatorImplementation = new RegistryCoordinator( + IServiceManager(address(eigenDAServiceManager)), + stakeRegistry, + apkRegistry, + indexRegistry + ); + + { + // parse initalization params and permissions from config data + ( + uint96[] memory minimumStakeForQuourm, + IStakeRegistry.StrategyParams[][] memory strategyAndWeightingMultipliers + ) = _parseStakeRegistryParams(config_data); + ( + IRegistryCoordinator.OperatorSetParam[] memory operatorSetParams, + address churner, + address ejector + ) = _parseRegistryCoordinatorParams(config_data); + + //upgrade the registry coordinator proxy to implementation + eigenDAProxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(payable(address(registryCoordinator))), + address(registryCoordinatorImplementation), + abi.encodeWithSelector( + RegistryCoordinator.initialize.selector, + eigenDAOwner, + churner, + ejector, + IPauserRegistry(pauser), + initalPausedStatus, + operatorSetParams, + minimumStakeForQuourm, + strategyAndWeightingMultipliers + ) + ); + } + + //deploy the eigenDA service manager implementation + eigenDAServiceManagerImplementation = new EigenDAServiceManager( + avsDirectory, + registryCoordinator, + stakeRegistry + ); + + address[] memory batchConfirmers = new address[](2); + batchConfirmers[0] = batchConfirmer; + batchConfirmers[1] = fallbackBatchConfirmer; + + //upgrade the eigenDA service manager proxy to implementation + eigenDAProxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(payable(address(eigenDAServiceManager))), + address(eigenDAServiceManagerImplementation), + abi.encodeWithSelector( + EigenDAServiceManager.initialize.selector, + IPauserRegistry(pauser), + initalPausedStatus, + deployer, + batchConfirmers + ) + ); + + string memory metadataURI = stdJson.readString(config_data, ".uri"); + eigenDAServiceManager.updateAVSMetadataURI(metadataURI); + eigenDAServiceManager.transferOwnership(eigenDAOwner); + + //deploy the operator state retriever + operatorStateRetriever = new OperatorStateRetriever(); + + // transfer ownership of proxy admin to upgrader + eigenDAProxyAdmin.transferOwnership(eigenDAUpgrader); + + vm.stopPrank(); + + // sanity checks + __verifyContractPointers( + apkRegistry, + eigenDAServiceManager, + registryCoordinator, + indexRegistry, + stakeRegistry + ); + + __verifyContractPointers( + apkRegistryImplementation, + eigenDAServiceManagerImplementation, + registryCoordinatorImplementation, + indexRegistryImplementation, + stakeRegistryImplementation + ); + + __verifyImplementations(); + __verifyInitalizations(config_data); + } + + function __verifyContractPointers( + BLSApkRegistry _apkRegistry, + EigenDAServiceManager _eigenDAServiceManager, + RegistryCoordinator _registryCoordinator, + IndexRegistry _indexRegistry, + StakeRegistry _stakeRegistry + ) internal view { + require(address(_apkRegistry.registryCoordinator()) == address(registryCoordinator), "blsApkRegistry.registryCoordinator() != registryCoordinator"); + + require(address(_indexRegistry.registryCoordinator()) == address(registryCoordinator), "indexRegistry.registryCoordinator() != registryCoordinator"); + + require(address(_stakeRegistry.registryCoordinator()) == address(registryCoordinator), "stakeRegistry.registryCoordinator() != registryCoordinator"); + require(address(_stakeRegistry.delegation()) == address(delegationManager), "stakeRegistry.delegationManager() != delegation"); + + require(address(_eigenDAServiceManager.registryCoordinator()) == address(registryCoordinator), "eigenDAServiceManager.registryCoordinator() != registryCoordinator"); + require(address(_eigenDAServiceManager.stakeRegistry()) == address(stakeRegistry), "eigenDAServiceManager.stakeRegistry() != stakeRegistry"); + require(address(_eigenDAServiceManager.avsDirectory()) == address(avsDirectory), "eigenDAServiceManager.avsDirectory() != avsDirectory"); + + require(address(_registryCoordinator.serviceManager()) == address(eigenDAServiceManager), "registryCoordinator.eigenDAServiceManager() != eigenDAServiceManager"); + require(address(_registryCoordinator.stakeRegistry()) == address(stakeRegistry), "registryCoordinator.stakeRegistry() != stakeRegistry"); + require(address(_registryCoordinator.blsApkRegistry()) == address(apkRegistry), "registryCoordinator.blsApkRegistry() != blsPubkeyRegistry"); + require(address(_registryCoordinator.indexRegistry()) == address(indexRegistry), "registryCoordinator.indexRegistry() != indexRegistry"); + } + + function __verifyImplementations() internal view { + require(eigenDAProxyAdmin.getProxyImplementation( + TransparentUpgradeableProxy(payable(address(eigenDAServiceManager)))) == address(eigenDAServiceManagerImplementation), + "eigenDAServiceManager: implementation set incorrectly"); + require(eigenDAProxyAdmin.getProxyImplementation( + TransparentUpgradeableProxy(payable(address(registryCoordinator)))) == address(registryCoordinatorImplementation), + "registryCoordinator: implementation set incorrectly"); + require(eigenDAProxyAdmin.getProxyImplementation( + TransparentUpgradeableProxy(payable(address(apkRegistry)))) == address(apkRegistryImplementation), + "blsApkRegistry: implementation set incorrectly"); + require(eigenDAProxyAdmin.getProxyImplementation( + TransparentUpgradeableProxy(payable(address(indexRegistry)))) == address(indexRegistryImplementation), + "indexRegistry: implementation set incorrectly"); + require(eigenDAProxyAdmin.getProxyImplementation( + TransparentUpgradeableProxy(payable(address(stakeRegistry)))) == address(stakeRegistryImplementation), + "stakeRegistry: implementation set incorrectly"); + } + + function __verifyInitalizations(string memory config_data) internal { + ( + uint96[] memory minimumStakeForQuourm, + IStakeRegistry.StrategyParams[][] memory strategyAndWeightingMultipliers + ) = _parseStakeRegistryParams(config_data); + ( + IRegistryCoordinator.OperatorSetParam[] memory operatorSetParams, + address churner, + address ejector + ) = _parseRegistryCoordinatorParams(config_data); + + require(eigenDAServiceManager.owner() == eigenDAOwner, "eigenDAServiceManager.owner() != eigenDAOwner"); + require(eigenDAServiceManager.pauserRegistry() == IPauserRegistry(pauser), "eigenDAServiceManager: pauser registry not set correctly"); + require(eigenDAServiceManager.isBatchConfirmer(batchConfirmer) == true, "eigenDAServiceManager.batchConfirmer() != batchConfirmer"); + require(eigenDAServiceManager.isBatchConfirmer(fallbackBatchConfirmer) == true, "eigenDAServiceManager.fallbackBatchConfirmer() != fallbackBatchConfirmer"); + require(eigenDAServiceManager.paused() == initalPausedStatus, "eigenDAServiceManager: init paused status set incorrectly"); + + require(registryCoordinator.owner() == eigenDAOwner, "registryCoordinator.owner() != eigenDAOwner"); + require(registryCoordinator.churnApprover() == churner, "registryCoordinator.churner() != churner"); + require(registryCoordinator.ejector() == ejector, "registryCoordinator.ejector() != ejector"); + require(registryCoordinator.pauserRegistry() == IPauserRegistry(pauser), "registryCoordinator: pauser registry not set correctly"); + require(registryCoordinator.paused() == initalPausedStatus, "registryCoordinator: init paused status set incorrectly"); + + for (uint8 i = 0; i < operatorSetParams.length; ++i) { + require(keccak256(abi.encode(registryCoordinator.getOperatorSetParams(i))) == keccak256(abi.encode(operatorSetParams[i])), "registryCoordinator.operatorSetParams != operatorSetParams"); + } + + for (uint8 i = 0; i < minimumStakeForQuourm.length; ++i) { + require(stakeRegistry.minimumStakeForQuorum(i) == minimumStakeForQuourm[i], "stakeRegistry.minimumStakeForQuourm != minimumStakeForQuourm"); + } + + for (uint8 i = 0; i < strategyAndWeightingMultipliers.length; ++i) { + for(uint8 j = 0; j < strategyAndWeightingMultipliers[i].length; ++j) { + IStakeRegistry.StrategyParams memory strategyParams = stakeRegistry.strategyParamsByIndex(i, j); + require(address(strategyParams.strategy) == address(strategyAndWeightingMultipliers[i][j].strategy), "stakeRegistry.strategyAndWeightingMultipliers != strategyAndWeightingMultipliers"); + require(strategyParams.multiplier == strategyAndWeightingMultipliers[i][j].multiplier, "stakeRegistry.strategyAndWeightingMultipliers != strategyAndWeightingMultipliers"); + } + } + + require(operatorSetParams.length == strategyAndWeightingMultipliers.length && operatorSetParams.length == minimumStakeForQuourm.length, "operatorSetParams, strategyAndWeightingMultipliers, and minimumStakeForQuourm must be the same length"); + } + + function _writeOutput(string memory config_data) internal { + string memory parent_object = "parent object"; + + string memory deployed_addresses = "addresses"; + vm.serializeAddress(deployed_addresses, "eigenDAProxyAdmin", address(eigenDAProxyAdmin)); + vm.serializeAddress(deployed_addresses, "operatorStateRetriever", address(operatorStateRetriever)); + vm.serializeAddress(deployed_addresses, "eigenDAServiceManager", address(eigenDAServiceManager)); + vm.serializeAddress(deployed_addresses, "eigenDAServiceManagerImplementation", address(eigenDAServiceManagerImplementation)); + vm.serializeAddress(deployed_addresses, "registryCoordinator", address(registryCoordinator)); + vm.serializeAddress(deployed_addresses, "registryCoordinatorImplementation", address(registryCoordinatorImplementation)); + vm.serializeAddress(deployed_addresses, "blsApkRegistry", address(apkRegistry)); + vm.serializeAddress(deployed_addresses, "blsApkRegistryImplementation", address(apkRegistryImplementation)); + vm.serializeAddress(deployed_addresses, "indexRegistry", address(indexRegistry)); + vm.serializeAddress(deployed_addresses, "indexRegistryImplementation", address(indexRegistryImplementation)); + vm.serializeAddress(deployed_addresses, "stakeRegistry", address(stakeRegistry)); + vm.serializeAddress(deployed_addresses, "stakeRegistryImplementation", address(stakeRegistryImplementation)); + vm.serializeAddress(deployed_addresses, "serviceManagerRouter", address(serviceManagerRouter)); + string memory deployed_addresses_output = vm.serializeAddress(deployed_addresses, "stakeRegistryImplementation", address(stakeRegistryImplementation)); + + string memory chain_info = "chainInfo"; + vm.serializeUint(chain_info, "deploymentBlock", block.number); + string memory chain_info_output = vm.serializeUint(chain_info, "chainId", block.chainid); + + address churner = stdJson.readAddress(config_data, ".permissions.churner"); + address ejector = stdJson.readAddress(config_data, ".permissions.ejector"); + string memory permissions = "permissions"; + vm.serializeAddress(permissions, "eigenDAOwner", eigenDAOwner); + vm.serializeAddress(permissions, "eigenDAUpgrader", eigenDAUpgrader); + vm.serializeAddress(permissions, "eigenDAChurner", churner); + vm.serializeAddress(permissions, "eigenDABatchConfirmer", batchConfirmer); + vm.serializeAddress(permissions, "pauserRegistry", pauser); + string memory permissions_output = vm.serializeAddress(permissions, "eigenDAEjector", ejector); + + vm.serializeString(parent_object, chain_info, chain_info_output); + vm.serializeString(parent_object, deployed_addresses, deployed_addresses_output); + string memory finalJson = vm.serializeString(parent_object, permissions, permissions_output); + vm.writeJson(finalJson, outputPath); + } + + function _parseStakeRegistryParams(string memory config_data) internal pure returns (uint96[] memory minimumStakeForQuourm, IStakeRegistry.StrategyParams[][] memory strategyAndWeightingMultipliers) { + bytes memory stakesConfigsRaw = stdJson.parseRaw(config_data, ".minimumStakes"); + minimumStakeForQuourm = abi.decode(stakesConfigsRaw, (uint96[])); + + bytes memory strategyConfigsRaw = stdJson.parseRaw(config_data, ".strategyWeights"); + strategyAndWeightingMultipliers = abi.decode(strategyConfigsRaw, (IStakeRegistry.StrategyParams[][])); + } + + function _parseRegistryCoordinatorParams(string memory config_data) internal returns (IRegistryCoordinator.OperatorSetParam[] memory operatorSetParams, address churner, address ejector) { + bytes memory operatorConfigsRaw = stdJson.parseRaw(config_data, ".operatorSetParams"); + operatorSetParams = abi.decode(operatorConfigsRaw, (IRegistryCoordinator.OperatorSetParam[])); + + churner = stdJson.readAddress(config_data, ".permissions.churner"); + ejector = stdJson.readAddress(config_data, ".permissions.ejector"); + } +} diff --git a/contracts/script/deploy/mainnet/mainnet.config.json b/contracts/script/deploy/mainnet/mainnet.config.json new file mode 100644 index 0000000000..7420fb93c0 --- /dev/null +++ b/contracts/script/deploy/mainnet/mainnet.config.json @@ -0,0 +1,88 @@ +{ + "chainInfo": { + "chainId": 1 + }, + + "permissions" : { + "owner": "0xBE1685C81aA44FF9FB319dD389addd9374383e90", + "upgrader": "0x369e6F597e22EaB55fFb173C6d9cD234BD699111", + "churner": "0xe0550117Cb066D3b330eBd764B0d75D3BA378734", + "ejector": "0xBE1685C81aA44FF9FB319dD389addd9374383e90", + "batchConfirmer": "0x8ED83c6Bb12E441Ca2C3a544F525d4a3Fb6484D8", + "fallbackBatchConfirmer": "0x5A49Bf6c5690E22dFff3eB37F7dd18254eC361ED", + "deployer": "0x45B866E099a790cbddA655Ca20Cb11168B2cD088", + "initalPausedStatus": 0 + }, + + "minimumStakes": [ + 320000000000000000000 + ], + + "strategyWeights": [ + [ + { + "0_strategy": "0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0", + "1_multiplier": 1000000000000000000 + }, + { + "0_strategy": "0x93c4b944D05dfe6df7645A86cd2206016c51564D", + "1_multiplier": 1030077629425962827 + }, + { + "0_strategy": "0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2", + "1_multiplier": 1102456657360376283 + }, + { + "0_strategy": "0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc", + "1_multiplier": 1067949170243902475 + }, + { + "0_strategy": "0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d", + "1_multiplier": 1026158078493781538 + }, + { + "0_strategy": "0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff", + "1_multiplier": 1152393415227598758 + }, + { + "0_strategy": "0xa4C637e0F704745D182e4D38cAb7E7485321d059", + "1_multiplier": 1011855761455017859 + }, + { + "0_strategy": "0x57ba429517c3473B6d34CA9aCd56c0e735b94c02", + "1_multiplier": 1012495275290785447 + }, + { + "0_strategy": "0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6", + "1_multiplier": 1055446649335815388 + }, + { + "0_strategy": "0x7CA911E83dabf90C90dD3De5411a10F1A6112184", + "1_multiplier": 1035345726488000000 + }, + { + "0_strategy": "0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6", + "1_multiplier": 1081259809521793439 + }, + { + "0_strategy": "0xAe60d8180437b5C34bB956822ac2710972584473", + "1_multiplier": 1044315639811926396 + }, + { + "0_strategy": "0x298aFB19A105D59E74658C4C334Ff360BadE6dd2", + "1_multiplier": 1028802524926876401 + } + ] + ], + + "operatorSetParams": [ + { + "0_maxOperatorCount": 200, + "1_kickBIPsOfOperatorStake": 11000, + "2_kickBIPsOfTotalStake": 50 + } + ], + + "uri": "https://mainnet-ethereum-avs-metadata.s3.amazonaws.com/EigenDA.json" + + } \ No newline at end of file diff --git a/contracts/script/deploy/mainnet/mainnet_addresses.json b/contracts/script/deploy/mainnet/mainnet_addresses.json new file mode 100644 index 0000000000..630eede230 --- /dev/null +++ b/contracts/script/deploy/mainnet/mainnet_addresses.json @@ -0,0 +1,47 @@ +{ + "addresses": { + "avsDirectory": "0x135DDa560e946695d6f155dACaFC6f1F25C1F5AF", + "avsDirectoryImplementation": "0xdabdb3cd346b7d5f5779b0b614ede1cc9dcba5b7", + "baseStrategyImplementation": "0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3", + "beaconOracleAddress": "0x343907185b71aDF0eBa9567538314396aa985442", + "delayedWithdrawalRouter": "0x7Fe7E9CC0F274d2435AD5d56D5fa73E47F6A23D8", + "delayedWithdrawalRouterImplementation": "0x4bb6731b02314d40abbffbc4540f508874014226", + "delegation": "0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A", + "delegationImplementation": "0x1784be6401339fc0fedf7e9379409f5c1bfe9dda", + "eigenLayerPauserReg": "0x0c431C66F4dE941d089625E5B423D00707977060", + "eigenLayerProxyAdmin": "0x8b9566AdA63B64d1E1dcF1418b43fd1433b72444", + "eigenPodBeacon": "0x5a2a4F2F3C18f09179B6703e63D9eDD165909073", + "eigenPodImplementation": "0x8ba40da60f0827d027f029acee62609f0527a255", + "eigenPodManager": "0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338", + "eigenPodManagerImplementation": "0xe4297e3dadbc7d99e26a2954820f514cb50c5762", + "emptyContract": "0x1f96861fEFa1065a5A96F20Deb6D8DC3ff48F7f9", + "slasher": "0xD92145c07f8Ed1D392c1B88017934E301CC1c3Cd", + "slasherImplementation": "0xf3234220163a757edf1e11a8a085638d9b236614", + "strategies": { + "stETH": "0x93c4b944D05dfe6df7645A86cd2206016c51564D", + "rETH": "0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2", + "cbETH": "0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc", + "ETHx": "0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d", + "ankrETH": "0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff", + "oETH": "0xa4C637e0F704745D182e4D38cAb7E7485321d059", + "osETH": "0x57ba429517c3473B6d34CA9aCd56c0e735b94c02", + "swETH": "0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6", + "wBETH": "0x7CA911E83dabf90C90dD3De5411a10F1A6112184", + "sfrxETH": "0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6", + "lsETH": "0xAe60d8180437b5C34bB956822ac2710972584473", + "mETH": "0x298aFB19A105D59E74658C4C334Ff360BadE6dd2" + }, + "strategyManager": "0x858646372CC42E1A627fcE94aa7A7033e7CF075A", + "strategyManagerImplementation": "0x70f44c13944d49a236e3cd7a94f48f5dab6c619b" + }, + "chainInfo": { + "chainId": 1 + }, + "parameters": { + "communityMultisig": "0xFEA47018D632A77bA579846c840d5706705Dc598", + "executorMultisig": "0x369e6F597e22EaB55fFb173C6d9cD234BD699111", + "operationsMultisig": "0xBE1685C81aA44FF9FB319dD389addd9374383e90", + "pauserMultisig": "0x5050389572f2d220ad927CcbeA0D406831012390", + "timelock": "0xA6Db1A8C5a981d1536266D2a393c5F8dDb210EAF" + } + } \ No newline at end of file diff --git a/contracts/script/deploy/mainnet/mainnet_deployment_data.json b/contracts/script/deploy/mainnet/mainnet_deployment_data.json new file mode 100644 index 0000000000..2c12c08ce7 --- /dev/null +++ b/contracts/script/deploy/mainnet/mainnet_deployment_data.json @@ -0,0 +1,29 @@ +{ + "addresses": { + "blsApkRegistry": "0x00A5Fd09F6CeE6AE9C8b0E5e33287F7c82880505", + "blsApkRegistryImplementation": "0x5d0B9cE2e277Daf508528E9f6Bf6314E79e4eD2b", + "eigenDAProxyAdmin": "0x8247EF5705d3345516286B72bFE6D690197C2E99", + "eigenDAServiceManager": "0x870679E138bCdf293b7Ff14dD44b70FC97e12fc0", + "eigenDAServiceManagerImplementation": "0xF5fD25A90902c27068CF5eBe53Be8da693Ac899e", + "indexRegistry": "0xBd35a7a1CDeF403a6a99e4E8BA0974D198455030", + "indexRegistryImplementation": "0x1ae0b73118906f39D5ED30Ae4A484ce2F479a14c", + "operatorStateRetriever": "0xD5D7fB4647cE79740E6e83819EFDf43fa74F8C31", + "registryCoordinator": "0x0BAAc79acD45A023E19345c352d8a7a83C4e5656", + "registryCoordinatorImplementation": "0xd3e09a0c2A9A6FDf5E92aE65D3CC090A4dF8EECF", + "serviceManagerRouter": "0x518D5140B5C935fE094F00f2Dd64f2F95C4F09eA", + "stakeRegistry": "0x006124Ae7976137266feeBFb3F4D2BE4C073139D", + "stakeRegistryImplementation": "0x1C468cf7089D263c2f53e2579b329B16aBc4dd96" + }, + "chainInfo": { + "chainId": 1, + "deploymentBlock": 19592322 + }, + "permissions": { + "eigenDABatchConfirmer": "0x8ED83c6Bb12E441Ca2C3a544F525d4a3Fb6484D8", + "eigenDAChurner": "0xe0550117Cb066D3b330eBd764B0d75D3BA378734", + "eigenDAEjector": "0xBE1685C81aA44FF9FB319dD389addd9374383e90", + "eigenDAOwner": "0xBE1685C81aA44FF9FB319dD389addd9374383e90", + "eigenDAUpgrader": "0x369e6F597e22EaB55fFb173C6d9cD234BD699111", + "pauserRegistry": "0x0c431C66F4dE941d089625E5B423D00707977060" + } +} \ No newline at end of file diff --git a/contracts/src/core/EigenDAServiceManager.sol b/contracts/src/core/EigenDAServiceManager.sol index a0ca6d9429..80f5795d1c 100644 --- a/contracts/src/core/EigenDAServiceManager.sol +++ b/contracts/src/core/EigenDAServiceManager.sol @@ -28,7 +28,7 @@ contract EigenDAServiceManager is EigenDAServiceManagerStorage, ServiceManagerBa /// @notice when applied to a function, ensures that the function is only callable by the `batchConfirmer`. modifier onlyBatchConfirmer() { - require(msg.sender == batchConfirmer, "onlyBatchConfirmer: not from batch confirmer"); + require(isBatchConfirmer[msg.sender], "onlyBatchConfirmer: not from batch confirmer"); _; } @@ -47,14 +47,16 @@ contract EigenDAServiceManager is EigenDAServiceManagerStorage, ServiceManagerBa IPauserRegistry _pauserRegistry, uint256 _initialPausedStatus, address _initialOwner, - address _batchConfirmer + address[] memory _batchConfirmers ) public initializer { _initializePauser(_pauserRegistry, _initialPausedStatus); _transferOwnership(_initialOwner); - _setBatchConfirmer(_batchConfirmer); + for (uint i = 0; i < _batchConfirmers.length; ++i) { + _setBatchConfirmer(_batchConfirmers[i]); + } } /** @@ -128,9 +130,8 @@ contract EigenDAServiceManager is EigenDAServiceManagerStorage, ServiceManagerBa /// @notice changes the batch confirmer function _setBatchConfirmer(address _batchConfirmer) internal { - address previousBatchConfirmer = batchConfirmer; - batchConfirmer = _batchConfirmer; - emit BatchConfirmerChanged(previousBatchConfirmer, batchConfirmer); + isBatchConfirmer[_batchConfirmer] = !isBatchConfirmer[_batchConfirmer]; + emit BatchConfirmerStatusChanged(_batchConfirmer, isBatchConfirmer[_batchConfirmer]); } /// @notice Returns the current batchId diff --git a/contracts/src/core/EigenDAServiceManagerStorage.sol b/contracts/src/core/EigenDAServiceManagerStorage.sol index d3d2f97467..9c97cecebb 100644 --- a/contracts/src/core/EigenDAServiceManagerStorage.sol +++ b/contracts/src/core/EigenDAServiceManagerStorage.sol @@ -41,21 +41,21 @@ abstract contract EigenDAServiceManagerStorage is IEigenDAServiceManager { * this is the percentage of the total stake that must be adversarial to consider a blob invalid. * The first byte is the threshold for quorum 0, the second byte is the threshold for quorum 1, etc. */ - bytes public constant quorumAdversaryThresholdPercentages = hex"2121"; + bytes public constant quorumAdversaryThresholdPercentages = hex"21"; /** * @notice The quorum confirmation threshold percentages stored as an ordered bytes array * this is the percentage of the total stake needed to confirm a blob. * The first byte is the threshold for quorum 0, the second byte is the threshold for quorum 1, etc. */ - bytes public constant quorumConfirmationThresholdPercentages = hex"3737"; + bytes public constant quorumConfirmationThresholdPercentages = hex"37"; /** * @notice The quorum numbers required for confirmation stored as an ordered bytes array * these quorum numbers have respective canonical thresholds in the * quorumConfirmationThresholdPercentages and quorumAdversaryThresholdPercentages above. */ - bytes public constant quorumNumbersRequired = hex"0001"; + bytes public constant quorumNumbersRequired = hex"00"; /// @notice The current batchId uint32 public batchId; @@ -63,8 +63,8 @@ abstract contract EigenDAServiceManagerStorage is IEigenDAServiceManager { /// @notice mapping between the batchId to the hash of the metadata of the corresponding Batch mapping(uint32 => bytes32) public batchIdToBatchMetadataHash; - /// @notice address that is permissioned to confirm batches - address public batchConfirmer; + /// @notice mapping of addressed that are permissioned to confirm batches + mapping(address => bool) public isBatchConfirmer; // storage gap for upgradeability // slither-disable-next-line shadowing-state diff --git a/contracts/src/interfaces/IEigenDAServiceManager.sol b/contracts/src/interfaces/IEigenDAServiceManager.sol index 7c07b07896..21221ea9be 100644 --- a/contracts/src/interfaces/IEigenDAServiceManager.sol +++ b/contracts/src/interfaces/IEigenDAServiceManager.sol @@ -16,11 +16,11 @@ interface IEigenDAServiceManager is IServiceManager { event BatchConfirmed(bytes32 indexed batchHeaderHash, uint32 batchId); /** - * @notice Emitted when the batch confirmer is changed. - * @param previousAddress The address of the previous batch confirmer - * @param newAddress The address of the new batch confirmer + * @notice Emitted when a batch confirmer status is updated. + * @param batchConfirmer The address of the batch confirmer + * @param status The new status of the batch confirmer */ - event BatchConfirmerChanged(address previousAddress, address newAddress); + event BatchConfirmerStatusChanged(address batchConfirmer, bool status); // STRUCTS diff --git a/contracts/test/unit/EigenDABlobUtils.t.sol b/contracts/test/unit/EigenDABlobUtils.t.sol index c4d86c0e59..2ff183e7b3 100644 --- a/contracts/test/unit/EigenDABlobUtils.t.sol +++ b/contracts/test/unit/EigenDABlobUtils.t.sol @@ -48,6 +48,9 @@ contract EigenDABlobUtilsUnit is BLSMockAVSDeployer { stakeRegistry ); + address[] memory confirmers = new address[](1); + confirmers[0] = confirmer; + // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. eigenDAServiceManager = EigenDAServiceManager( address( @@ -59,7 +62,7 @@ contract EigenDABlobUtilsUnit is BLSMockAVSDeployer { pauserRegistry, 0, registryCoordinatorOwner, - confirmer + confirmers ) ) ) @@ -200,7 +203,7 @@ contract EigenDABlobUtilsUnit is BLSMockAVSDeployer { emit log_named_uint("gas used", gasBefore - gasAfter); } - function testVerifyBlob_RequiredQuorumsNotMet(uint256 pseudoRandomNumber) public { + function xtestVerifyBlob_RequiredQuorumsNotMet(uint256 pseudoRandomNumber) public { uint256 numQuorumBlobParams = 1; IEigenDAServiceManager.BlobHeader[] memory blobHeader = new IEigenDAServiceManager.BlobHeader[](2); blobHeader[0] = _generateRandomBlobHeader(pseudoRandomNumber, numQuorumBlobParams); @@ -244,7 +247,7 @@ contract EigenDABlobUtilsUnit is BLSMockAVSDeployer { eigenDABlobUtilsHarness.verifyBlob(blobHeader[1], eigenDAServiceManager, blobVerificationProof); } - function testVerifyBlob_AdversayThresholdNotMet(uint256 pseudoRandomNumber) public { + function xtestVerifyBlob_AdversayThresholdNotMet(uint256 pseudoRandomNumber) public { uint256 numQuorumBlobParams = 2; IEigenDAServiceManager.BlobHeader[] memory blobHeader = new IEigenDAServiceManager.BlobHeader[](2); blobHeader[0] = _generateRandomBlobHeader(pseudoRandomNumber, numQuorumBlobParams); diff --git a/contracts/test/unit/EigenDAServiceManagerUnit.t.sol b/contracts/test/unit/EigenDAServiceManagerUnit.t.sol index 507ade35af..49ef10d0fb 100644 --- a/contracts/test/unit/EigenDAServiceManagerUnit.t.sol +++ b/contracts/test/unit/EigenDAServiceManagerUnit.t.sol @@ -37,6 +37,9 @@ contract EigenDAServiceManagerUnit is BLSMockAVSDeployer { stakeRegistry ); + address[] memory confirmers = new address[](1); + confirmers[0] = confirmer; + // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. eigenDAServiceManager = EigenDAServiceManager( address( @@ -48,7 +51,7 @@ contract EigenDAServiceManagerUnit is BLSMockAVSDeployer { pauserRegistry, 0, registryCoordinatorOwner, - confirmer + confirmers ) ) ) diff --git a/contracts/test/unit/MockRollup.t.sol b/contracts/test/unit/MockRollup.t.sol index 804bc3dded..4cdc82e81a 100644 --- a/contracts/test/unit/MockRollup.t.sol +++ b/contracts/test/unit/MockRollup.t.sol @@ -58,6 +58,10 @@ contract MockRollupTest is BLSMockAVSDeployer { stakeRegistry ); + address[] memory confirmers = new address[](1); + confirmers[0] = registryCoordinatorOwner; + + // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. eigenDAServiceManager = EigenDAServiceManager( address( new TransparentUpgradeableProxy( @@ -68,7 +72,7 @@ contract MockRollupTest is BLSMockAVSDeployer { pauserRegistry, 0, registryCoordinatorOwner, - registryCoordinatorOwner + confirmers ) ) ) @@ -181,7 +185,7 @@ contract MockRollupTest is BLSMockAVSDeployer { function testGetQuorumAdversaryThreshold () public { require(EigenDARollupUtils.getQuorumAdversaryThreshold(eigenDAServiceManager, 0) == 33, "getQuorumAdversaryThreshold failed"); - require(EigenDARollupUtils.getQuorumAdversaryThreshold(eigenDAServiceManager, 1) == 33, "getQuorumAdversaryThreshold failed"); + //require(EigenDARollupUtils.getQuorumAdversaryThreshold(eigenDAServiceManager, 1) == 33, "getQuorumAdversaryThreshold failed"); } } \ No newline at end of file diff --git a/inabox/tests/integration_test.go b/inabox/tests/integration_test.go index ccf277b829..0a26b6d5e5 100644 --- a/inabox/tests/integration_test.go +++ b/inabox/tests/integration_test.go @@ -134,16 +134,14 @@ var _ = Describe("Inabox Integration", func() { restored := codec.RemoveEmptyByteFromPaddedBytes(retrieved) Expect(bytes.TrimRight(restored, "\x00")).To(Equal(bytes.TrimRight(data, "\x00"))) - retrieved, err = retrievalClient.RetrieveBlob(ctx, + _, err = retrievalClient.RetrieveBlob(ctx, [32]byte(reply1.GetInfo().GetBlobVerificationProof().GetBatchMetadata().GetBatchHeaderHash()), reply1.GetInfo().GetBlobVerificationProof().GetBlobIndex(), uint(reply1.GetInfo().GetBlobVerificationProof().GetBatchMetadata().GetBatchHeader().GetReferenceBlockNumber()), [32]byte(reply1.GetInfo().GetBlobVerificationProof().GetBatchMetadata().GetBatchHeader().GetBatchRoot()), 1, // retrieve blob 1 from quorum 1 ) - Expect(err).To(BeNil()) - restored = codec.RemoveEmptyByteFromPaddedBytes(retrieved) - Expect(bytes.TrimRight(restored, "\x00")).To(Equal(bytes.TrimRight(data, "\x00"))) + Expect(err).NotTo(BeNil()) retrieved, err = retrievalClient.RetrieveBlob(ctx, [32]byte(reply2.GetInfo().GetBlobVerificationProof().GetBatchMetadata().GetBatchHeaderHash()), @@ -155,16 +153,14 @@ var _ = Describe("Inabox Integration", func() { Expect(err).To(BeNil()) restored = codec.RemoveEmptyByteFromPaddedBytes(retrieved) Expect(bytes.TrimRight(restored, "\x00")).To(Equal(bytes.TrimRight(data, "\x00"))) - retrieved, err = retrievalClient.RetrieveBlob(ctx, + _, err = retrievalClient.RetrieveBlob(ctx, [32]byte(reply2.GetInfo().GetBlobVerificationProof().GetBatchMetadata().GetBatchHeaderHash()), reply2.GetInfo().GetBlobVerificationProof().GetBlobIndex(), uint(reply2.GetInfo().GetBlobVerificationProof().GetBatchMetadata().GetBatchHeader().GetReferenceBlockNumber()), [32]byte(reply2.GetInfo().GetBlobVerificationProof().GetBatchMetadata().GetBatchHeader().GetBatchRoot()), 1, // retrieve from quorum 1 ) - Expect(err).To(BeNil()) - restored = codec.RemoveEmptyByteFromPaddedBytes(retrieved) - Expect(bytes.TrimRight(restored, "\x00")).To(Equal(bytes.TrimRight(data, "\x00"))) + Expect(err).NotTo(BeNil()) }) })