Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 Blob Verification #781

Merged
merged 26 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function create_binding {
forge clean
forge build

contracts="PaymentVault SocketRegistry AVSDirectory DelegationManager BitmapUtils OperatorStateRetriever RegistryCoordinator BLSApkRegistry IndexRegistry StakeRegistry BN254 EigenDAServiceManager IEigenDAServiceManager MockRollup EjectionManager IEigenDARelayRegistry"
contracts="PaymentVault SocketRegistry AVSDirectory DelegationManager BitmapUtils OperatorStateRetriever RegistryCoordinator BLSApkRegistry IndexRegistry StakeRegistry BN254 EigenDAServiceManager IEigenDAServiceManager MockRollup EjectionManager EigenDABlobVerifier EigenDAThresholdRegistry EigenDARelayRegistry"
for contract in $contracts; do
create_binding ./ $contract ./bindings
done
Expand Down
64 changes: 58 additions & 6 deletions contracts/script/EigenDADeployer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ import {IServiceManager} from "eigenlayer-middleware/interfaces/IServiceManager.
import {IBLSApkRegistry} from "eigenlayer-middleware/interfaces/IBLSApkRegistry.sol";
import {EigenDAServiceManager, IAVSDirectory, IRewardsCoordinator} from "../src/core/EigenDAServiceManager.sol";
import {EigenDAHasher} from "../src/libraries/EigenDAHasher.sol";
import {ISocketRegistry, SocketRegistry} from "eigenlayer-middleware/SocketRegistry.sol";
import {EigenDAThresholdRegistry} from "../src/core/EigenDAThresholdRegistry.sol";
import {EigenDABlobVerifier} from "../src/core/EigenDABlobVerifier.sol";
import {IEigenDAThresholdRegistry} from "../src/interfaces/IEigenDAThresholdRegistry.sol";
import {IEigenDABatchMetadataStorage} from "../src/interfaces/IEigenDABatchMetadataStorage.sol";
import {IEigenDASignatureVerifier} from "../src/interfaces/IEigenDASignatureVerifier.sol";
import {IEigenDARelayRegistry} from "../src/interfaces/IEigenDARelayRegistry.sol";
import {EigenDARelayRegistry} from "../src/core/EigenDARelayRegistry.sol";
import {ISocketRegistry, SocketRegistry} from "eigenlayer-middleware/SocketRegistry.sol";

import {DeployOpenEigenLayer, ProxyAdmin, ERC20PresetFixedSupply, TransparentUpgradeableProxy, IPauserRegistry} from "./DeployOpenEigenLayer.s.sol";
import "forge-std/Test.sol";
import "forge-std/Script.sol";
import "forge-std/StdJson.sol";
import "../src/interfaces/IEigenDAStructs.sol";

// # To load the variables in the .env file
// source .env
Expand All @@ -36,17 +42,22 @@ contract EigenDADeployer is DeployOpenEigenLayer {

BLSApkRegistry public apkRegistry;
EigenDAServiceManager public eigenDAServiceManager;
EigenDAThresholdRegistry public eigenDAThresholdRegistry;
EigenDABlobVerifier public eigenDABlobVerifier;
RegistryCoordinator public registryCoordinator;
IIndexRegistry public indexRegistry;
IStakeRegistry public stakeRegistry;
ISocketRegistry public socketRegistry;
OperatorStateRetriever public operatorStateRetriever;
EigenDARelayRegistry public eigenDARelayRegistry;

BLSApkRegistry public apkRegistryImplementation;
EigenDAServiceManager public eigenDAServiceManagerImplementation;
IRegistryCoordinator public registryCoordinatorImplementation;
IIndexRegistry public indexRegistryImplementation;
IStakeRegistry public stakeRegistryImplementation;
EigenDAThresholdRegistry public eigenDAThresholdRegistryImplementation;
EigenDARelayRegistry public eigenDARelayRegistryImplementation;
ISocketRegistry public socketRegistryImplementation;

struct AddressConfig {
Expand Down Expand Up @@ -93,16 +104,21 @@ contract EigenDADeployer is DeployOpenEigenLayer {
}

emptyContract = new EmptyContract();

// hard-coded inputs


/**
* 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), ""))
);
eigenDAThresholdRegistry = EigenDAThresholdRegistry(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), ""))
);
eigenDARelayRegistry = EigenDARelayRegistry(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), ""))
);

registryCoordinator = RegistryCoordinator(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenDAProxyAdmin), ""))
);
Expand Down Expand Up @@ -205,8 +221,8 @@ contract EigenDADeployer is DeployOpenEigenLayer {
rewardsCoordinator,
registryCoordinator,
stakeRegistry,
IEigenDAThresholdRegistry(address(0)),
IEigenDARelayRegistry(address(0))
eigenDAThresholdRegistry,
eigenDARelayRegistry
);

address[] memory confirmers = new address[](1);
Expand All @@ -226,6 +242,42 @@ contract EigenDADeployer is DeployOpenEigenLayer {
)
);

eigenDAThresholdRegistryImplementation = new EigenDAThresholdRegistry();

VersionedBlobParams[] memory versionedBlobParams = new VersionedBlobParams[](0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to hardcode the params for version 0 here if we're going to use the same values across all environments?

SecurityThresholds memory defaultSecurityThresholds = SecurityThresholds(33, 55);

eigenDAProxyAdmin.upgradeAndCall(
TransparentUpgradeableProxy(payable(address(eigenDAThresholdRegistry))),
address(eigenDAThresholdRegistryImplementation),
abi.encodeWithSelector(
EigenDAThresholdRegistry.initialize.selector,
addressConfig.eigenDACommunityMultisig,
hex"212121",
hex"373737",
hex"0001",
versionedBlobParams,
defaultSecurityThresholds
)
);

operatorStateRetriever = new OperatorStateRetriever();

eigenDABlobVerifier = new EigenDABlobVerifier(
IEigenDAThresholdRegistry(address(eigenDAThresholdRegistry)),
IEigenDABatchMetadataStorage(address(eigenDAServiceManager)),
IEigenDASignatureVerifier(address(eigenDAServiceManager)),
IEigenDARelayRegistry(address(eigenDARelayRegistry)),
OperatorStateRetriever(address(operatorStateRetriever)),
IRegistryCoordinator(address(registryCoordinator))
);

eigenDARelayRegistryImplementation = new EigenDARelayRegistry();

eigenDAProxyAdmin.upgradeAndCall(
TransparentUpgradeableProxy(payable(address(eigenDARelayRegistry))),
address(eigenDARelayRegistryImplementation),
abi.encodeWithSelector(EigenDARelayRegistry.initialize.selector, addressConfig.eigenDACommunityMultisig)
);
}
}
2 changes: 1 addition & 1 deletion contracts/script/MockRollupDeployer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pragma solidity ^0.8.9;

import "forge-std/Script.sol";
import "../src/rollup/MockRollup.sol";
import "../test/rollup/MockRollup.sol";
import {IEigenDAServiceManager} from "../src/interfaces/IEigenDAServiceManager.sol";

contract MockRollupDeployer is Script {
Expand Down
Loading
Loading