Commit 0783222c authored by Wyatt Barnes's avatar Wyatt Barnes Committed by GitHub

Refactor L2 genesis generation - Predeploys (#9292)

* Refactor L2 genesis generation - Predeploys

* Update packages/contracts-bedrock/scripts/L2Genesis.s.sol
Co-authored-by: default avatarMatt Solomon <matt@mattsolomon.dev>

* Update packages/contracts-bedrock/scripts/L2Genesis.s.sol
Co-authored-by: default avatarMatt Solomon <matt@mattsolomon.dev>

* Update packages/contracts-bedrock/scripts/L2Genesis.s.sol
Co-authored-by: default avatarMatt Solomon <matt@mattsolomon.dev>

* Update packages/contracts-bedrock/scripts/L2Genesis.s.sol
Co-authored-by: default avatarMatt Solomon <matt@mattsolomon.dev>

* Update packages/contracts-bedrock/scripts/L2Genesis.s.sol
Co-authored-by: default avatarMatt Solomon <matt@mattsolomon.dev>

* Update packages/contracts-bedrock/scripts/L2Genesis.s.sol
Co-authored-by: default avatarMatt Solomon <matt@mattsolomon.dev>

* Update packages/contracts-bedrock/scripts/L2Genesis.s.sol
Co-authored-by: default avatarMatt Solomon <matt@mattsolomon.dev>

* Fix commit history

---------
Co-authored-by: default avatarMatt Solomon <matt@mattsolomon.dev>
parent 43aa20a5
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000", "baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000", "l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000", "sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": "remote", "baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": "remote", "l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": "remote", "sequencerFeeVaultWithdrawalNetwork": 0,
"proxyAdminOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "proxyAdminOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"finalSystemOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "finalSystemOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"superchainConfigGuardian": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "superchainConfigGuardian": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
......
...@@ -55,5 +55,6 @@ ...@@ -55,5 +55,6 @@
"proofMaturityDelaySeconds": 12, "proofMaturityDelaySeconds": 12,
"disputeGameFinalityDelaySeconds": 6, "disputeGameFinalityDelaySeconds": 6,
"respectedGameType": 0, "respectedGameType": 0,
"useFaultProofs": false "useFaultProofs": false,
"fundDevAccounts": false
} }
...@@ -9,7 +9,7 @@ import { Chains } from "scripts/Chains.sol"; ...@@ -9,7 +9,7 @@ import { Chains } from "scripts/Chains.sol";
// Global constant for the `useFaultProofs` slot in the DeployConfig contract, which can be overridden in the testing // Global constant for the `useFaultProofs` slot in the DeployConfig contract, which can be overridden in the testing
// environment. // environment.
bytes32 constant USE_FAULT_PROOFS_SLOT = bytes32(uint256(61)); bytes32 constant USE_FAULT_PROOFS_SLOT = bytes32(uint256(63));
/// @title DeployConfig /// @title DeployConfig
/// @notice Represents the configuration required to deploy the system. It is expected /// @notice Represents the configuration required to deploy the system. It is expected
...@@ -35,6 +35,7 @@ contract DeployConfig is Script { ...@@ -35,6 +35,7 @@ contract DeployConfig is Script {
address public l2OutputOracleProposer; address public l2OutputOracleProposer;
address public l2OutputOracleChallenger; address public l2OutputOracleChallenger;
uint256 public finalizationPeriodSeconds; uint256 public finalizationPeriodSeconds;
bool public fundDevAccounts;
address public proxyAdminOwner; address public proxyAdminOwner;
address public baseFeeVaultRecipient; address public baseFeeVaultRecipient;
uint256 public baseFeeVaultMinimumWithdrawalAmount; uint256 public baseFeeVaultMinimumWithdrawalAmount;
...@@ -42,6 +43,7 @@ contract DeployConfig is Script { ...@@ -42,6 +43,7 @@ contract DeployConfig is Script {
uint256 public l1FeeVaultMinimumWithdrawalAmount; uint256 public l1FeeVaultMinimumWithdrawalAmount;
address public sequencerFeeVaultRecipient; address public sequencerFeeVaultRecipient;
uint256 public sequencerFeeVaultMinimumWithdrawalAmount; uint256 public sequencerFeeVaultMinimumWithdrawalAmount;
uint256 public sequencerFeeVaultWithdrawalNetwork;
string public governanceTokenName; string public governanceTokenName;
string public governanceTokenSymbol; string public governanceTokenSymbol;
address public governanceTokenOwner; address public governanceTokenOwner;
...@@ -49,6 +51,7 @@ contract DeployConfig is Script { ...@@ -49,6 +51,7 @@ contract DeployConfig is Script {
uint256 public l2GenesisBlockBaseFeePerGas; uint256 public l2GenesisBlockBaseFeePerGas;
uint256 public gasPriceOracleOverhead; uint256 public gasPriceOracleOverhead;
uint256 public gasPriceOracleScalar; uint256 public gasPriceOracleScalar;
bool public enableGovernance;
uint256 public eip1559Denominator; uint256 public eip1559Denominator;
uint256 public eip1559Elasticity; uint256 public eip1559Elasticity;
uint256 public faultGameAbsolutePrestate; uint256 public faultGameAbsolutePrestate;
...@@ -94,6 +97,7 @@ contract DeployConfig is Script { ...@@ -94,6 +97,7 @@ contract DeployConfig is Script {
l2OutputOracleProposer = stdJson.readAddress(_json, "$.l2OutputOracleProposer"); l2OutputOracleProposer = stdJson.readAddress(_json, "$.l2OutputOracleProposer");
l2OutputOracleChallenger = stdJson.readAddress(_json, "$.l2OutputOracleChallenger"); l2OutputOracleChallenger = stdJson.readAddress(_json, "$.l2OutputOracleChallenger");
finalizationPeriodSeconds = stdJson.readUint(_json, "$.finalizationPeriodSeconds"); finalizationPeriodSeconds = stdJson.readUint(_json, "$.finalizationPeriodSeconds");
fundDevAccounts = stdJson.readBool(_json, "$.fundDevAccounts");
proxyAdminOwner = stdJson.readAddress(_json, "$.proxyAdminOwner"); proxyAdminOwner = stdJson.readAddress(_json, "$.proxyAdminOwner");
baseFeeVaultRecipient = stdJson.readAddress(_json, "$.baseFeeVaultRecipient"); baseFeeVaultRecipient = stdJson.readAddress(_json, "$.baseFeeVaultRecipient");
baseFeeVaultMinimumWithdrawalAmount = stdJson.readUint(_json, "$.baseFeeVaultMinimumWithdrawalAmount"); baseFeeVaultMinimumWithdrawalAmount = stdJson.readUint(_json, "$.baseFeeVaultMinimumWithdrawalAmount");
...@@ -101,6 +105,7 @@ contract DeployConfig is Script { ...@@ -101,6 +105,7 @@ contract DeployConfig is Script {
l1FeeVaultMinimumWithdrawalAmount = stdJson.readUint(_json, "$.l1FeeVaultMinimumWithdrawalAmount"); l1FeeVaultMinimumWithdrawalAmount = stdJson.readUint(_json, "$.l1FeeVaultMinimumWithdrawalAmount");
sequencerFeeVaultRecipient = stdJson.readAddress(_json, "$.sequencerFeeVaultRecipient"); sequencerFeeVaultRecipient = stdJson.readAddress(_json, "$.sequencerFeeVaultRecipient");
sequencerFeeVaultMinimumWithdrawalAmount = stdJson.readUint(_json, "$.sequencerFeeVaultMinimumWithdrawalAmount"); sequencerFeeVaultMinimumWithdrawalAmount = stdJson.readUint(_json, "$.sequencerFeeVaultMinimumWithdrawalAmount");
sequencerFeeVaultWithdrawalNetwork = stdJson.readUint(_json, "$.sequencerFeeVaultWithdrawalNetwork");
governanceTokenName = stdJson.readString(_json, "$.governanceTokenName"); governanceTokenName = stdJson.readString(_json, "$.governanceTokenName");
governanceTokenSymbol = stdJson.readString(_json, "$.governanceTokenSymbol"); governanceTokenSymbol = stdJson.readString(_json, "$.governanceTokenSymbol");
governanceTokenOwner = stdJson.readAddress(_json, "$.governanceTokenOwner"); governanceTokenOwner = stdJson.readAddress(_json, "$.governanceTokenOwner");
...@@ -108,6 +113,7 @@ contract DeployConfig is Script { ...@@ -108,6 +113,7 @@ contract DeployConfig is Script {
l2GenesisBlockBaseFeePerGas = stdJson.readUint(_json, "$.l2GenesisBlockBaseFeePerGas"); l2GenesisBlockBaseFeePerGas = stdJson.readUint(_json, "$.l2GenesisBlockBaseFeePerGas");
gasPriceOracleOverhead = stdJson.readUint(_json, "$.gasPriceOracleOverhead"); gasPriceOracleOverhead = stdJson.readUint(_json, "$.gasPriceOracleOverhead");
gasPriceOracleScalar = stdJson.readUint(_json, "$.gasPriceOracleScalar"); gasPriceOracleScalar = stdJson.readUint(_json, "$.gasPriceOracleScalar");
enableGovernance = stdJson.readBool(_json, "$.enableGovernance");
eip1559Denominator = stdJson.readUint(_json, "$.eip1559Denominator"); eip1559Denominator = stdJson.readUint(_json, "$.eip1559Denominator");
eip1559Elasticity = stdJson.readUint(_json, "$.eip1559Elasticity"); eip1559Elasticity = stdJson.readUint(_json, "$.eip1559Elasticity");
systemConfigStartBlock = stdJson.readUint(_json, "$.systemConfigStartBlock"); systemConfigStartBlock = stdJson.readUint(_json, "$.systemConfigStartBlock");
......
This diff is collapsed.
...@@ -1954,7 +1954,7 @@ ...@@ -1954,7 +1954,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000", "newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000", "previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false, "reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000038" "slot": "0x000000000000000000000000000000000000000000000000000000000000003a"
} }
], ],
"value": 0 "value": 0
...@@ -1980,7 +1980,7 @@ ...@@ -1980,7 +1980,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000", "newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000", "previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false, "reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000039" "slot": "0x000000000000000000000000000000000000000000000000000000000000003b"
} }
], ],
"value": 0 "value": 0
...@@ -2441,7 +2441,7 @@ ...@@ -2441,7 +2441,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000", "newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000", "previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false, "reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000038" "slot": "0x000000000000000000000000000000000000000000000000000000000000003a"
} }
], ],
"value": 0 "value": 0
...@@ -2519,7 +2519,7 @@ ...@@ -2519,7 +2519,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000", "newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000", "previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false, "reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000039" "slot": "0x000000000000000000000000000000000000000000000000000000000000003b"
} }
], ],
"value": 0 "value": 0
...@@ -6011,7 +6011,7 @@ ...@@ -6011,7 +6011,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000834", "newValue": "0x0000000000000000000000000000000000000000000000000000000000000834",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000834", "previousValue": "0x0000000000000000000000000000000000000000000000000000000000000834",
"reverted": false, "reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000002a" "slot": "0x000000000000000000000000000000000000000000000000000000000000002b"
} }
], ],
"value": 0 "value": 0
...@@ -6037,7 +6037,7 @@ ...@@ -6037,7 +6037,7 @@
"newValue": "0x00000000000000000000000000000000000000000000000000000000000f4240", "newValue": "0x00000000000000000000000000000000000000000000000000000000000f4240",
"previousValue": "0x00000000000000000000000000000000000000000000000000000000000f4240", "previousValue": "0x00000000000000000000000000000000000000000000000000000000000f4240",
"reverted": false, "reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000002b" "slot": "0x000000000000000000000000000000000000000000000000000000000000002c"
} }
], ],
"value": 0 "value": 0
...@@ -6063,7 +6063,7 @@ ...@@ -6063,7 +6063,7 @@
"newValue": "0x00000000000000000000000000000000000000000000000000000000017d7840", "newValue": "0x00000000000000000000000000000000000000000000000000000000017d7840",
"previousValue": "0x00000000000000000000000000000000000000000000000000000000017d7840", "previousValue": "0x00000000000000000000000000000000000000000000000000000000017d7840",
"reverted": false, "reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000028" "slot": "0x0000000000000000000000000000000000000000000000000000000000000029"
} }
], ],
"value": 0 "value": 0
...@@ -6772,7 +6772,7 @@ ...@@ -6772,7 +6772,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000834", "newValue": "0x0000000000000000000000000000000000000000000000000000000000000834",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000834", "previousValue": "0x0000000000000000000000000000000000000000000000000000000000000834",
"reverted": false, "reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000002a" "slot": "0x000000000000000000000000000000000000000000000000000000000000002b"
} }
], ],
"value": 0 "value": 0
...@@ -6850,7 +6850,7 @@ ...@@ -6850,7 +6850,7 @@
"newValue": "0x00000000000000000000000000000000000000000000000000000000000f4240", "newValue": "0x00000000000000000000000000000000000000000000000000000000000f4240",
"previousValue": "0x00000000000000000000000000000000000000000000000000000000000f4240", "previousValue": "0x00000000000000000000000000000000000000000000000000000000000f4240",
"reverted": false, "reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000002b" "slot": "0x000000000000000000000000000000000000000000000000000000000000002c"
} }
], ],
"value": 0 "value": 0
...@@ -7006,7 +7006,7 @@ ...@@ -7006,7 +7006,7 @@
"newValue": "0x00000000000000000000000000000000000000000000000000000000017d7840", "newValue": "0x00000000000000000000000000000000000000000000000000000000017d7840",
"previousValue": "0x00000000000000000000000000000000000000000000000000000000017d7840", "previousValue": "0x00000000000000000000000000000000000000000000000000000000017d7840",
"reverted": false, "reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000028" "slot": "0x0000000000000000000000000000000000000000000000000000000000000029"
} }
], ],
"value": 0 "value": 0
...@@ -7162,7 +7162,7 @@ ...@@ -7162,7 +7162,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000", "newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000", "previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false, "reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000037" "slot": "0x0000000000000000000000000000000000000000000000000000000000000039"
} }
], ],
"value": 0 "value": 0
......
...@@ -58,7 +58,7 @@ const knownChains = [ ...@@ -58,7 +58,7 @@ const knownChains = [
type ClientOptions = type ClientOptions =
// for known chains like base don't require an rpcUrl // for known chains like base don't require an rpcUrl
| { | {
chainId: typeof knownChains[number] chainId: (typeof knownChains)[number]
rpcUrl?: string rpcUrl?: string
nativeCurrency?: chains.Chain['nativeCurrency'] nativeCurrency?: chains.Chain['nativeCurrency']
} }
......
...@@ -231,15 +231,13 @@ describe('OptimismPlugin', () => { ...@@ -231,15 +231,13 @@ describe('OptimismPlugin', () => {
test('estimateFees', async () => test('estimateFees', async () =>
expect( expect(
await web3.op.estimateFees( await web3.op.estimateFees({
{
chainId: 10, chainId: 10,
data: encodedBurnMethod, data: encodedBurnMethod,
type: 2, type: 2,
to: optimistAddress[10], to: optimistAddress[10],
from: '0x77194aa25a06f932c10c0f25090f3046af2c85a6', from: '0x77194aa25a06f932c10c0f25090f3046af2c85a6',
} })
)
).toBeTypeOf('bigint')) ).toBeTypeOf('bigint'))
}) })
......
...@@ -128,9 +128,7 @@ export class OptimismPlugin extends Web3PluginBase { ...@@ -128,9 +128,7 @@ export class OptimismPlugin extends Web3PluginBase {
return Web3.utils.format( return Web3.utils.format(
{ format: 'uint' }, { format: 'uint' },
await this._getPriceOracleContractInstance() await this._getPriceOracleContractInstance()
.methods.getL1GasUsed( .methods.getL1GasUsed(this._serializeTransaction(transaction))
this._serializeTransaction(transaction)
)
.call(), .call(),
returnFormat ?? DEFAULT_RETURN_FORMAT returnFormat ?? DEFAULT_RETURN_FORMAT
) )
...@@ -257,10 +255,7 @@ export class OptimismPlugin extends Web3PluginBase { ...@@ -257,10 +255,7 @@ export class OptimismPlugin extends Web3PluginBase {
*/ */
public async estimateFees< public async estimateFees<
ReturnFormat extends DataFormat = typeof DEFAULT_RETURN_FORMAT ReturnFormat extends DataFormat = typeof DEFAULT_RETURN_FORMAT
>( >(transaction: Transaction, returnFormat?: ReturnFormat) {
transaction: Transaction,
returnFormat?: ReturnFormat
) {
const [l1Fee, l2Fee] = await Promise.all([ const [l1Fee, l2Fee] = await Promise.all([
this.getL1Fee(transaction), this.getL1Fee(transaction),
this.getL2Fee(transaction), this.getL2Fee(transaction),
......
...@@ -10,5 +10,5 @@ export default defineConfig({ ...@@ -10,5 +10,5 @@ export default defineConfig({
splitting: false, splitting: false,
sourcemap: true, sourcemap: true,
clean: false, clean: false,
dts: true dts: true,
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment