Skip to content

Commit

Permalink
Merge branch 'feat-deterministic-deployment' into feat-clean-up-config
Browse files Browse the repository at this point in the history
  • Loading branch information
yiweichi authored Sep 2, 2024
2 parents ab84d1e + 187d29a commit 076b1e9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
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 = ""
L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR = ""
L1_MESSAGE_QUEUE_IMPLEMENTATION_ADDR = ""
L1_MESSAGE_QUEUE_PROXY_ADDR = ""
Expand Down
16 changes: 12 additions & 4 deletions docker/templates/coordinator-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@
"batch_collection_time_sec": 600,
"bundle_collection_time_sec": 600,
"verifier": {
"fork_name": "darwin",
"mock_mode": false,
"params_path": "/verifier/params",
"assets_path_lo": "/verifier/assets/lo",
"assets_path_hi": "/verifier/assets/hi"
"low_version_circuit": {
"params_path": "/verifier/params",
"assets_path": "/verifier/assets/lo",
"fork_name": "darwin",
"min_prover_version": "v4.4.43"
},
"high_version_circuit": {
"params_path": "/verifier/params",
"assets_path": "/verifier/assets/hi",
"fork_name": "darwinV2",
"min_prover_version": "v4.4.56"
}
},
"max_verifier_workers": 4,
"min_prover_version": "v4.3.41"
Expand Down
1 change: 1 addition & 0 deletions docker/templates/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"bernoulliBlock": 0,
"curieBlock": 0,
"darwinTime": 0,
"darwinV2Time": 0,
"clique": {
"period": 3,
"epoch": 30000
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

0 comments on commit 076b1e9

Please sign in to comment.