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 @@
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": "remote",
"l1FeeVaultWithdrawalNetwork": "remote",
"sequencerFeeVaultWithdrawalNetwork": "remote",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"proxyAdminOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"finalSystemOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"superchainConfigGuardian": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
......
......@@ -55,5 +55,6 @@
"proofMaturityDelaySeconds": 12,
"disputeGameFinalityDelaySeconds": 6,
"respectedGameType": 0,
"useFaultProofs": false
"useFaultProofs": false,
"fundDevAccounts": false
}
......@@ -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
// environment.
bytes32 constant USE_FAULT_PROOFS_SLOT = bytes32(uint256(61));
bytes32 constant USE_FAULT_PROOFS_SLOT = bytes32(uint256(63));
/// @title DeployConfig
/// @notice Represents the configuration required to deploy the system. It is expected
......@@ -35,6 +35,7 @@ contract DeployConfig is Script {
address public l2OutputOracleProposer;
address public l2OutputOracleChallenger;
uint256 public finalizationPeriodSeconds;
bool public fundDevAccounts;
address public proxyAdminOwner;
address public baseFeeVaultRecipient;
uint256 public baseFeeVaultMinimumWithdrawalAmount;
......@@ -42,6 +43,7 @@ contract DeployConfig is Script {
uint256 public l1FeeVaultMinimumWithdrawalAmount;
address public sequencerFeeVaultRecipient;
uint256 public sequencerFeeVaultMinimumWithdrawalAmount;
uint256 public sequencerFeeVaultWithdrawalNetwork;
string public governanceTokenName;
string public governanceTokenSymbol;
address public governanceTokenOwner;
......@@ -49,6 +51,7 @@ contract DeployConfig is Script {
uint256 public l2GenesisBlockBaseFeePerGas;
uint256 public gasPriceOracleOverhead;
uint256 public gasPriceOracleScalar;
bool public enableGovernance;
uint256 public eip1559Denominator;
uint256 public eip1559Elasticity;
uint256 public faultGameAbsolutePrestate;
......@@ -94,6 +97,7 @@ contract DeployConfig is Script {
l2OutputOracleProposer = stdJson.readAddress(_json, "$.l2OutputOracleProposer");
l2OutputOracleChallenger = stdJson.readAddress(_json, "$.l2OutputOracleChallenger");
finalizationPeriodSeconds = stdJson.readUint(_json, "$.finalizationPeriodSeconds");
fundDevAccounts = stdJson.readBool(_json, "$.fundDevAccounts");
proxyAdminOwner = stdJson.readAddress(_json, "$.proxyAdminOwner");
baseFeeVaultRecipient = stdJson.readAddress(_json, "$.baseFeeVaultRecipient");
baseFeeVaultMinimumWithdrawalAmount = stdJson.readUint(_json, "$.baseFeeVaultMinimumWithdrawalAmount");
......@@ -101,6 +105,7 @@ contract DeployConfig is Script {
l1FeeVaultMinimumWithdrawalAmount = stdJson.readUint(_json, "$.l1FeeVaultMinimumWithdrawalAmount");
sequencerFeeVaultRecipient = stdJson.readAddress(_json, "$.sequencerFeeVaultRecipient");
sequencerFeeVaultMinimumWithdrawalAmount = stdJson.readUint(_json, "$.sequencerFeeVaultMinimumWithdrawalAmount");
sequencerFeeVaultWithdrawalNetwork = stdJson.readUint(_json, "$.sequencerFeeVaultWithdrawalNetwork");
governanceTokenName = stdJson.readString(_json, "$.governanceTokenName");
governanceTokenSymbol = stdJson.readString(_json, "$.governanceTokenSymbol");
governanceTokenOwner = stdJson.readAddress(_json, "$.governanceTokenOwner");
......@@ -108,6 +113,7 @@ contract DeployConfig is Script {
l2GenesisBlockBaseFeePerGas = stdJson.readUint(_json, "$.l2GenesisBlockBaseFeePerGas");
gasPriceOracleOverhead = stdJson.readUint(_json, "$.gasPriceOracleOverhead");
gasPriceOracleScalar = stdJson.readUint(_json, "$.gasPriceOracleScalar");
enableGovernance = stdJson.readBool(_json, "$.enableGovernance");
eip1559Denominator = stdJson.readUint(_json, "$.eip1559Denominator");
eip1559Elasticity = stdJson.readUint(_json, "$.eip1559Elasticity");
systemConfigStartBlock = stdJson.readUint(_json, "$.systemConfigStartBlock");
......
This diff is collapsed.
......@@ -1954,7 +1954,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000038"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003a"
}
],
"value": 0
......@@ -1980,7 +1980,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000039"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003b"
}
],
"value": 0
......@@ -2441,7 +2441,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000038"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003a"
}
],
"value": 0
......@@ -2519,7 +2519,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000039"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003b"
}
],
"value": 0
......@@ -6011,7 +6011,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000834",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000834",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000002a"
"slot": "0x000000000000000000000000000000000000000000000000000000000000002b"
}
],
"value": 0
......@@ -6037,7 +6037,7 @@
"newValue": "0x00000000000000000000000000000000000000000000000000000000000f4240",
"previousValue": "0x00000000000000000000000000000000000000000000000000000000000f4240",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000002b"
"slot": "0x000000000000000000000000000000000000000000000000000000000000002c"
}
],
"value": 0
......@@ -6063,7 +6063,7 @@
"newValue": "0x00000000000000000000000000000000000000000000000000000000017d7840",
"previousValue": "0x00000000000000000000000000000000000000000000000000000000017d7840",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000028"
"slot": "0x0000000000000000000000000000000000000000000000000000000000000029"
}
],
"value": 0
......@@ -6772,7 +6772,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000834",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000834",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000002a"
"slot": "0x000000000000000000000000000000000000000000000000000000000000002b"
}
],
"value": 0
......@@ -6850,7 +6850,7 @@
"newValue": "0x00000000000000000000000000000000000000000000000000000000000f4240",
"previousValue": "0x00000000000000000000000000000000000000000000000000000000000f4240",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000002b"
"slot": "0x000000000000000000000000000000000000000000000000000000000000002c"
}
],
"value": 0
......@@ -7006,7 +7006,7 @@
"newValue": "0x00000000000000000000000000000000000000000000000000000000017d7840",
"previousValue": "0x00000000000000000000000000000000000000000000000000000000017d7840",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000028"
"slot": "0x0000000000000000000000000000000000000000000000000000000000000029"
}
],
"value": 0
......@@ -7162,7 +7162,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000037"
"slot": "0x0000000000000000000000000000000000000000000000000000000000000039"
}
],
"value": 0
......
......@@ -58,7 +58,7 @@ const knownChains = [
type ClientOptions =
// for known chains like base don't require an rpcUrl
| {
chainId: typeof knownChains[number]
chainId: (typeof knownChains)[number]
rpcUrl?: string
nativeCurrency?: chains.Chain['nativeCurrency']
}
......
......@@ -601,4 +601,4 @@ console.log(version) // 1.0.0
[1]: https://docs.web3js.org/api/web3-types#DataFormat
[2]: https://docs.web3js.org/api/web3-types#DEFAULT_RETURN_FORMAT
[3]: https://docs.web3js.org/api/web3-types#DataFormat
\ No newline at end of file
[3]: https://docs.web3js.org/api/web3-types#DataFormat
......@@ -231,15 +231,13 @@ describe('OptimismPlugin', () => {
test('estimateFees', async () =>
expect(
await web3.op.estimateFees(
{
chainId: 10,
data: encodedBurnMethod,
type: 2,
to: optimistAddress[10],
from: '0x77194aa25a06f932c10c0f25090f3046af2c85a6',
}
)
await web3.op.estimateFees({
chainId: 10,
data: encodedBurnMethod,
type: 2,
to: optimistAddress[10],
from: '0x77194aa25a06f932c10c0f25090f3046af2c85a6',
})
).toBeTypeOf('bigint'))
})
......
......@@ -128,9 +128,7 @@ export class OptimismPlugin extends Web3PluginBase {
return Web3.utils.format(
{ format: 'uint' },
await this._getPriceOracleContractInstance()
.methods.getL1GasUsed(
this._serializeTransaction(transaction)
)
.methods.getL1GasUsed(this._serializeTransaction(transaction))
.call(),
returnFormat ?? DEFAULT_RETURN_FORMAT
)
......@@ -257,10 +255,7 @@ export class OptimismPlugin extends Web3PluginBase {
*/
public async estimateFees<
ReturnFormat extends DataFormat = typeof DEFAULT_RETURN_FORMAT
>(
transaction: Transaction,
returnFormat?: ReturnFormat
) {
>(transaction: Transaction, returnFormat?: ReturnFormat) {
const [l1Fee, l2Fee] = await Promise.all([
this.getL1Fee(transaction),
this.getL2Fee(transaction),
......
......@@ -10,5 +10,5 @@ export default defineConfig({
splitting: false,
sourcemap: true,
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