Commit f8697a60 authored by Kelvin Fichter's avatar Kelvin Fichter

feat(ctb): remove historicalTotalBlocks

Removes historicalTotalBlocks from the L2OutputOracle.
parent 89526c42
---
'@eth-optimism/contracts-bedrock': patch
---
Removes historicalTotalBlocks from the L2OutputOracle
This diff is collapsed.
...@@ -277,7 +277,6 @@ func deployL1Contracts(config *DeployConfig, backend *backends.SimulatedBackend) ...@@ -277,7 +277,6 @@ func deployL1Contracts(config *DeployConfig, backend *backends.SimulatedBackend)
uint642Big(config.L2OutputOracleSubmissionInterval), uint642Big(config.L2OutputOracleSubmissionInterval),
[32]byte(config.L2OutputOracleGenesisL2Output), [32]byte(config.L2OutputOracleGenesisL2Output),
big.NewInt(0), big.NewInt(0),
big.NewInt(0),
uint642Big(uint64(config.L1GenesisBlockTimestamp)), uint642Big(uint64(config.L1GenesisBlockTimestamp)),
uint642Big(config.L2BlockTime), uint642Big(config.L2BlockTime),
config.L2OutputOracleProposer, config.L2OutputOracleProposer,
...@@ -342,9 +341,8 @@ func l1Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep ...@@ -342,9 +341,8 @@ func l1Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep
deployment.Args[2].(*big.Int), deployment.Args[2].(*big.Int),
deployment.Args[3].(*big.Int), deployment.Args[3].(*big.Int),
deployment.Args[4].(*big.Int), deployment.Args[4].(*big.Int),
deployment.Args[5].(*big.Int), deployment.Args[5].(common.Address),
deployment.Args[6].(common.Address), deployment.Args[6].(common.Address),
deployment.Args[7].(common.Address),
) )
case "OptimismPortal": case "OptimismPortal":
_, tx, _, err = bindings.DeployOptimismPortal( _, tx, _, err = bindings.DeployOptimismPortal(
......
...@@ -55,10 +55,6 @@ func TestBuildL1DeveloperGenesis(t *testing.T) { ...@@ -55,10 +55,6 @@ func TestBuildL1DeveloperGenesis(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, config.L2OutputOracleSubmissionInterval, interval.Uint64()) require.EqualValues(t, config.L2OutputOracleSubmissionInterval, interval.Uint64())
histBlocks, err := oracle.HISTORICALTOTALBLOCKS(callOpts)
require.NoError(t, err)
require.EqualValues(t, 0, histBlocks.Uint64())
startBlock, err := oracle.STARTINGBLOCKNUMBER(callOpts) startBlock, err := oracle.STARTINGBLOCKNUMBER(callOpts)
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, 0, startBlock.Uint64()) require.EqualValues(t, 0, startBlock.Uint64())
......
...@@ -160,11 +160,6 @@ func writeDefaultJWT(t *testing.T) string { ...@@ -160,11 +160,6 @@ func writeDefaultJWT(t *testing.T) string {
return jwtPath return jwtPath
} }
type L2OOContractConfig struct {
SubmissionFrequency *big.Int
HistoricalTotalBlocks *big.Int
}
type DepositContractConfig struct { type DepositContractConfig struct {
L2Oracle common.Address L2Oracle common.Address
FinalizationPeriod *big.Int FinalizationPeriod *big.Int
......
This diff is collapsed.
...@@ -21,11 +21,6 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { ...@@ -21,11 +21,6 @@ contract L2OutputOracle is OwnableUpgradeable, Semver {
*/ */
uint256 public immutable SUBMISSION_INTERVAL; uint256 public immutable SUBMISSION_INTERVAL;
/**
* @notice The number of blocks in the chain before the first block in this contract.
*/
uint256 public immutable HISTORICAL_TOTAL_BLOCKS;
/** /**
* @notice The number of the first L2 block recorded in this contract. * @notice The number of the first L2 block recorded in this contract.
*/ */
...@@ -105,7 +100,6 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { ...@@ -105,7 +100,6 @@ contract L2OutputOracle is OwnableUpgradeable, Semver {
* *
* @param _submissionInterval Interval in blocks at which checkpoints must be submitted. * @param _submissionInterval Interval in blocks at which checkpoints must be submitted.
* @param _genesisL2Output The initial L2 output of the L2 chain. * @param _genesisL2Output The initial L2 output of the L2 chain.
* @param _historicalTotalBlocks Number of blocks preceding this L2 chain.
* @param _startingBlockNumber The number of the first L2 block. * @param _startingBlockNumber The number of the first L2 block.
* @param _startingTimestamp The timestamp of the first L2 block. * @param _startingTimestamp The timestamp of the first L2 block.
* @param _l2BlockTime The time per L2 block, in seconds. * @param _l2BlockTime The time per L2 block, in seconds.
...@@ -115,7 +109,6 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { ...@@ -115,7 +109,6 @@ contract L2OutputOracle is OwnableUpgradeable, Semver {
constructor( constructor(
uint256 _submissionInterval, uint256 _submissionInterval,
bytes32 _genesisL2Output, bytes32 _genesisL2Output,
uint256 _historicalTotalBlocks,
uint256 _startingBlockNumber, uint256 _startingBlockNumber,
uint256 _startingTimestamp, uint256 _startingTimestamp,
uint256 _l2BlockTime, uint256 _l2BlockTime,
...@@ -128,7 +121,6 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { ...@@ -128,7 +121,6 @@ contract L2OutputOracle is OwnableUpgradeable, Semver {
); );
SUBMISSION_INTERVAL = _submissionInterval; SUBMISSION_INTERVAL = _submissionInterval;
HISTORICAL_TOTAL_BLOCKS = _historicalTotalBlocks;
STARTING_BLOCK_NUMBER = _startingBlockNumber; STARTING_BLOCK_NUMBER = _startingBlockNumber;
STARTING_TIMESTAMP = _startingTimestamp; STARTING_TIMESTAMP = _startingTimestamp;
L2_BLOCK_TIME = _l2BlockTime; L2_BLOCK_TIME = _l2BlockTime;
......
...@@ -98,7 +98,6 @@ contract L2OutputOracle_Initializer is CommonTest { ...@@ -98,7 +98,6 @@ contract L2OutputOracle_Initializer is CommonTest {
uint256 internal submissionInterval = 1800; uint256 internal submissionInterval = 1800;
uint256 internal l2BlockTime = 2; uint256 internal l2BlockTime = 2;
bytes32 internal genesisL2Output = keccak256(abi.encode(0)); bytes32 internal genesisL2Output = keccak256(abi.encode(0));
uint256 internal historicalTotalBlocks = 199;
uint256 internal startingBlockNumber = 200; uint256 internal startingBlockNumber = 200;
uint256 internal startingTimestamp = 1000; uint256 internal startingTimestamp = 1000;
...@@ -122,7 +121,6 @@ contract L2OutputOracle_Initializer is CommonTest { ...@@ -122,7 +121,6 @@ contract L2OutputOracle_Initializer is CommonTest {
oracleImpl = new L2OutputOracle( oracleImpl = new L2OutputOracle(
submissionInterval, submissionInterval,
genesisL2Output, genesisL2Output,
historicalTotalBlocks,
startingBlockNumber, startingBlockNumber,
startingTimestamp, startingTimestamp,
l2BlockTime, l2BlockTime,
......
...@@ -16,7 +16,6 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -16,7 +16,6 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
function test_constructor() external { function test_constructor() external {
assertEq(oracle.owner(), owner); assertEq(oracle.owner(), owner);
assertEq(oracle.SUBMISSION_INTERVAL(), submissionInterval); assertEq(oracle.SUBMISSION_INTERVAL(), submissionInterval);
assertEq(oracle.HISTORICAL_TOTAL_BLOCKS(), historicalTotalBlocks);
assertEq(oracle.latestBlockNumber(), startingBlockNumber); assertEq(oracle.latestBlockNumber(), startingBlockNumber);
assertEq(oracle.STARTING_BLOCK_NUMBER(), startingBlockNumber); assertEq(oracle.STARTING_BLOCK_NUMBER(), startingBlockNumber);
assertEq(oracle.STARTING_TIMESTAMP(), startingTimestamp); assertEq(oracle.STARTING_TIMESTAMP(), startingTimestamp);
...@@ -34,7 +33,6 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -34,7 +33,6 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
new L2OutputOracle( new L2OutputOracle(
submissionInterval, submissionInterval,
genesisL2Output, genesisL2Output,
historicalTotalBlocks,
startingBlockNumber, startingBlockNumber,
// startingTimestamp is in the future // startingTimestamp is in the future
block.timestamp + 1, block.timestamp + 1,
...@@ -367,7 +365,6 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer { ...@@ -367,7 +365,6 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer {
function test_initValuesOnProxy() external { function test_initValuesOnProxy() external {
assertEq(submissionInterval, oracleImpl.SUBMISSION_INTERVAL()); assertEq(submissionInterval, oracleImpl.SUBMISSION_INTERVAL());
assertEq(historicalTotalBlocks, oracleImpl.HISTORICAL_TOTAL_BLOCKS());
assertEq(startingBlockNumber, oracleImpl.STARTING_BLOCK_NUMBER()); assertEq(startingBlockNumber, oracleImpl.STARTING_BLOCK_NUMBER());
assertEq(startingTimestamp, oracleImpl.STARTING_TIMESTAMP()); assertEq(startingTimestamp, oracleImpl.STARTING_TIMESTAMP());
assertEq(l2BlockTime, oracleImpl.L2_BLOCK_TIME()); assertEq(l2BlockTime, oracleImpl.L2_BLOCK_TIME());
......
...@@ -32,7 +32,6 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -32,7 +32,6 @@ const deployFn: DeployFunction = async (hre) => {
args: [ args: [
hre.deployConfig.l2OutputOracleSubmissionInterval, hre.deployConfig.l2OutputOracleSubmissionInterval,
hre.deployConfig.l2OutputOracleGenesisL2Output, hre.deployConfig.l2OutputOracleGenesisL2Output,
hre.deployConfig.l2OutputOracleHistoricalTotalBlocks,
hre.deployConfig.l2OutputOracleStartingBlockNumber, hre.deployConfig.l2OutputOracleStartingBlockNumber,
deployL2StartingTimestamp, deployL2StartingTimestamp,
hre.deployConfig.l2BlockTime, hre.deployConfig.l2BlockTime,
...@@ -50,11 +49,6 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -50,11 +49,6 @@ const deployFn: DeployFunction = async (hre) => {
'STARTING_BLOCK_NUMBER', 'STARTING_BLOCK_NUMBER',
hre.deployConfig.l2OutputOracleStartingBlockNumber hre.deployConfig.l2OutputOracleStartingBlockNumber
) )
await assertContractVariable(
contract,
'HISTORICAL_TOTAL_BLOCKS',
hre.deployConfig.l2OutputOracleHistoricalTotalBlocks
)
await assertContractVariable( await assertContractVariable(
contract, contract,
'STARTING_TIMESTAMP', 'STARTING_TIMESTAMP',
......
...@@ -161,11 +161,6 @@ const config: HardhatUserConfig = { ...@@ -161,11 +161,6 @@ const config: HardhatUserConfig = {
type: 'string', type: 'string',
default: ethers.constants.HashZero, default: ethers.constants.HashZero,
}, },
// uint256 - Number of blocks preceding this L2 chain.
l2OutputOracleHistoricalTotalBlocks: {
type: 'number',
default: 0,
},
// uint256 - The number of the first L2 block. // uint256 - The number of the first L2 block.
l2OutputOracleStartingBlockNumber: { l2OutputOracleStartingBlockNumber: {
type: 'number', type: 'number',
......
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