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.
This changes the way that we detect pre-gingerbread headers when encoding.
Closes https://github.com/celo-org/celo-blockchain-planning/issues/588
Previously we would interpret a
gasLimit
of zero to indicate pre-gingerbread headers, since prior to the gingerbread hardfork celo blocks lacked thegasLimit
field.This however caused lots of problems with the go tests (existing and ones that continue to be added) that routinely use blocks where gasLimit has not been set.
So now we detect pre-gingerbread blocks when decoding and set a flag on the struct that is used to select the encoding.
New blocks are assumed to be post gingerbread, which is ok because it's not possible to run op-geth without gingerbread set, because we haven't ported across the pre-gingerbread state transition logic.
I was able to revert some test modifications because of this but this didn't fix the tests that broke during the celo11 rebase (skipped in this commit), it seems like those problems were caused by something else.