fix(contracts + proposer): checkpoint block hash #184
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
L2OutputOracle
initializer pattern to reduce the diff. Remove theowner
role, which is covered by the owner of the proxy.chainId
from the initialization parameters, as therollupConfigHash
includes thechainId
.checkpointBlockHash
to handle non-zero block hashes only: This fix ensures that only non-zero block hashes are stored, preventing a potential attack. The attack allowed users to set the blockHash for blocks older than 256 blocks to bytes32(0), which could block proofs that took over one hour to generate from being submitted on-chain. Generating proofs typically takes much less than an hour, so in practice this would have been difficult to exploit.checkpointBlockHash
andproposeL2Output
functions to accept only thel1BlockNumber
, as passingl1BlockHash
is redundant in this context.Additional Context
Note: This PR has a breaking change to the binaries, so we'll need to re-compile them along with the contract changes.
Note: This PR also has a breaking change to the contract, so we'll need to re-deploy, rather than upgrading.