optimism
optimism copied to clipboard
Consider replacing the CTC_DEPLOYMENT_HEIGHT parameter
There doesn't seem to be any reason for us to be supplying this parameter. It just happens to be that the CTC is deployed at block 8 right now. Let's make an issue for this.
Originally posted by @snario in https://github.com/ethereum-optimism/optimism/pull/981#r655740036
This parameter is required to fetch the initial OVM blocknumber and timestamp. When the sequencer starts up, it needs to be able to know what timestamp and blocknumber to start with after the genesis state. If a deposit is the first transaction, then it is possible for the sequencer to induce a monotonicity error right off the bat if it chooses a number that is too high. This config option allows the sequencer to set the initial timestamp/blocknumber to the smallest possible values that can be found on a deposit.
A way to eliminate the need for this parameter is to add a dependency on an archival node and do a binary search for the deploy height of the contract by calling getCode over and over again to find the height at which the contract was deployed.
I think that adding the dependency of using an archive node outweighs the benefit from removing this config option.
Another solution would be to have all of the contracts inherit from an OVM_Base contract that emits an event in its constructor and then we can query for those events to determine when the contract was created.
Let's close this, no point in doing this anymore now that we're moving to Bedrock