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

feat: use v2 zkevm verifier during initial deployment #28

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 docker/templates/config-contracts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ L1_SCROLL_CHAIN_PROXY_ADDR = ""
L1_SCROLL_MESSENGER_PROXY_ADDR = ""
L1_ENFORCED_TX_GATEWAY_IMPLEMENTATION_ADDR = ""
L1_ENFORCED_TX_GATEWAY_PROXY_ADDR = ""
L1_ZKEVM_VERIFIER_V1_ADDR = ""
L1_ZKEVM_VERIFIER_V2_ADDR = ""
yiweichi marked this conversation as resolved.
Show resolved Hide resolved
L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR = ""
L1_MESSAGE_QUEUE_IMPLEMENTATION_ADDR = ""
L1_MESSAGE_QUEUE_PROXY_ADDR = ""
Expand Down
3 changes: 3 additions & 0 deletions scripts/deterministic/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ string constant BRIDGE_HISTORY_CONFIG_PATH = "./volume/bridge-history-config.jso
string constant BALANCE_CHECKER_CONFIG_PATH = "./volume/balance-checker-config.json";
string constant FRONTEND_ENV_PATH = "./volume/frontend-config";
string constant ROLLUP_EXPLORER_BACKEND_CONFIG_PATH = "./volume/rollup-explorer-backend-config.json";

// plonk verifier configs
bytes32 constant V4_VERIFIER_DIGEST = 0x0a1904dbfff4614fb090b4b3864af4874f12680c32f07889e9ede8665097e5ec;
18 changes: 10 additions & 8 deletions scripts/deterministic/DeployScroll.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {L1WETHGateway} from "../../src/L1/gateways/L1WETHGateway.sol";
import {L2GasPriceOracle} from "../../src/L1/rollup/L2GasPriceOracle.sol";
import {MultipleVersionRollupVerifier} from "../../src/L1/rollup/MultipleVersionRollupVerifier.sol";
import {ScrollChain} from "../../src/L1/rollup/ScrollChain.sol";
import {ZkEvmVerifierV1} from "../../src/libraries/verifier/ZkEvmVerifierV1.sol";
import {ZkEvmVerifierV2} from "../../src/libraries/verifier/ZkEvmVerifierV2.sol";
import {GasTokenExample} from "../../src/alternative-gas-token/GasTokenExample.sol";
import {L1ScrollMessengerNonETH} from "../../src/alternative-gas-token/L1ScrollMessengerNonETH.sol";
import {L1GasTokenGateway} from "../../src/alternative-gas-token/L1GasTokenGateway.sol";
Expand Down Expand Up @@ -132,7 +132,7 @@ contract DeployScroll is DeterminsticDeployment {
address internal L1_WETH_GATEWAY_IMPLEMENTATION_ADDR;
address internal L1_WETH_GATEWAY_PROXY_ADDR;
address internal L1_WHITELIST_ADDR;
address internal L1_ZKEVM_VERIFIER_V1_ADDR;
address internal L1_ZKEVM_VERIFIER_V2_ADDR;
address internal L2_GAS_PRICE_ORACLE_IMPLEMENTATION_ADDR;
address internal L2_GAS_PRICE_ORACLE_PROXY_ADDR;
address internal L1_GAS_TOKEN_ADDR;
Expand Down Expand Up @@ -349,7 +349,7 @@ contract DeployScroll is DeterminsticDeployment {
deployL1ScrollChainProxy();
deployL1ScrollMessengerProxy();
deployL1EnforcedTxGateway();
deployL1ZkEvmVerifierV1();
deployL1ZkEvmVerifier();
deployL1MultipleVersionRollupVerifier();
deployL1MessageQueue();
deployL1ScrollChain();
Expand Down Expand Up @@ -550,16 +550,18 @@ contract DeployScroll is DeterminsticDeployment {
);
}

function deployL1ZkEvmVerifierV1() private {
bytes memory args = abi.encode(notnull(L1_PLONK_VERIFIER_ADDR));
L1_ZKEVM_VERIFIER_V1_ADDR = deploy("L1_ZKEVM_VERIFIER_V1", type(ZkEvmVerifierV1).creationCode, args);
function deployL1ZkEvmVerifier() private {
bytes memory args = abi.encode(notnull(L1_PLONK_VERIFIER_ADDR), V4_VERIFIER_DIGEST);
L1_ZKEVM_VERIFIER_V2_ADDR = deploy("L1_ZKEVM_VERIFIER_V2", type(ZkEvmVerifierV2).creationCode, args);
}

function deployL1MultipleVersionRollupVerifier() private {
uint256[] memory _versions = new uint256[](1);
address[] memory _verifiers = new address[](1);
_versions[0] = 1;
_verifiers[0] = notnull(L1_ZKEVM_VERIFIER_V1_ADDR);

// register V4 verifier: DarwinV2 upgrade, plonk verifier v0.13.1
_versions[0] = 4;
_verifiers[0] = notnull(L1_ZKEVM_VERIFIER_V2_ADDR);

bytes memory args = abi.encode(DEPLOYER_ADDR, _versions, _verifiers);

Expand Down
Loading