forked from ethereum-optimism/op-geth
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifications to support snap sync #152
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
piersy
force-pushed
the
piersy/modifications-to-support-snap-sync
branch
from
June 24, 2024 10:56
5ae796d
to
f6b1f51
Compare
This pr adds code to handle the extra block receipt added by celo to the list of receipts in a block and also adds the GetBlockReceipt rpc api which was an additional api added by celo to allow retrieveal of the block receipt.
Nil difficulty in headers causes problems because it is assumed by the go-ethereum codebase that difficulty is non nil. The specific problem requiring this fix was a NPE in Downloader.processHeaders where the total difficulty (td) is calculated by adding individual header difficulty values. Rather than try to fix this specific case it seems safer to ensure blocks have a non nil Difficulty which should help future proof since it upholds the assumptions of the go-ethereum codebase.
Pre gingerbread headers do not have a valid uncle hash because they have no notion of uncles.
piersy
force-pushed
the
piersy/modifications-to-support-snap-sync
branch
from
June 24, 2024 11:16
f6b1f51
to
9795aca
Compare
palango
reviewed
Jun 24, 2024
This reverts commit 9795aca.
If the parent block has a base fee then we use that, otherwise we use the initial base fee.
palango
approved these changes
Jun 25, 2024
karlb
pushed a commit
that referenced
this pull request
Jul 10, 2024
* Add code to handle block receipts Add code to handle the extra block receipt added by celo to the list of receipts in a block and also adds the GetBlockReceipt rpc api which was an additional api added by celo to allow retrieveal of the block receipt. * Ensure non nil difficulty in pre-gingerbread blocks Nil difficulty in headers causes problems because it is assumed by the go-ethereum codebase that difficulty is non nil. The specific problem requiring this fix was a NPE in Downloader.processHeaders where the total difficulty (td) is calculated by adding individual header difficulty values. Rather than try to fix this specific case it seems safer to ensure blocks have a non nil Difficulty which should help future proof our code since it upholds the assumptions of the go-ethereum codebase. * Skip uncle hash check for pre gingerbread headers Pre gingerbread headers do not have a valid uncle hash because they have no notion of uncles. * Handle choosing the cel2 transition block base fee If the parent block has a base fee then we use that, otherwise we use the initial base fee.
karlb
pushed a commit
that referenced
this pull request
Jul 10, 2024
* Add code to handle block receipts Add code to handle the extra block receipt added by celo to the list of receipts in a block and also adds the GetBlockReceipt rpc api which was an additional api added by celo to allow retrieveal of the block receipt. * Ensure non nil difficulty in pre-gingerbread blocks Nil difficulty in headers causes problems because it is assumed by the go-ethereum codebase that difficulty is non nil. The specific problem requiring this fix was a NPE in Downloader.processHeaders where the total difficulty (td) is calculated by adding individual header difficulty values. Rather than try to fix this specific case it seems safer to ensure blocks have a non nil Difficulty which should help future proof our code since it upholds the assumptions of the go-ethereum codebase. * Skip uncle hash check for pre gingerbread headers Pre gingerbread headers do not have a valid uncle hash because they have no notion of uncles. * Handle choosing the cel2 transition block base fee If the parent block has a base fee then we use that, otherwise we use the initial base fee.
karlb
pushed a commit
that referenced
this pull request
Jul 12, 2024
* Add code to handle block receipts Add code to handle the extra block receipt added by celo to the list of receipts in a block and also adds the GetBlockReceipt rpc api which was an additional api added by celo to allow retrieveal of the block receipt. * Ensure non nil difficulty in pre-gingerbread blocks Nil difficulty in headers causes problems because it is assumed by the go-ethereum codebase that difficulty is non nil. The specific problem requiring this fix was a NPE in Downloader.processHeaders where the total difficulty (td) is calculated by adding individual header difficulty values. Rather than try to fix this specific case it seems safer to ensure blocks have a non nil Difficulty which should help future proof our code since it upholds the assumptions of the go-ethereum codebase. * Skip uncle hash check for pre gingerbread headers Pre gingerbread headers do not have a valid uncle hash because they have no notion of uncles. * Handle choosing the cel2 transition block base fee If the parent block has a base fee then we use that, otherwise we use the initial base fee.
karlb
pushed a commit
that referenced
this pull request
Aug 20, 2024
* Add code to handle block receipts Add code to handle the extra block receipt added by celo to the list of receipts in a block and also adds the GetBlockReceipt rpc api which was an additional api added by celo to allow retrieveal of the block receipt. * Ensure non nil difficulty in pre-gingerbread blocks Nil difficulty in headers causes problems because it is assumed by the go-ethereum codebase that difficulty is non nil. The specific problem requiring this fix was a NPE in Downloader.processHeaders where the total difficulty (td) is calculated by adding individual header difficulty values. Rather than try to fix this specific case it seems safer to ensure blocks have a non nil Difficulty which should help future proof our code since it upholds the assumptions of the go-ethereum codebase. * Skip uncle hash check for pre gingerbread headers Pre gingerbread headers do not have a valid uncle hash because they have no notion of uncles. * Handle choosing the cel2 transition block base fee If the parent block has a base fee then we use that, otherwise we use the initial base fee.
karlb
pushed a commit
that referenced
this pull request
Aug 26, 2024
* Add code to handle block receipts Add code to handle the extra block receipt added by celo to the list of receipts in a block and also adds the GetBlockReceipt rpc api which was an additional api added by celo to allow retrieveal of the block receipt. * Ensure non nil difficulty in pre-gingerbread blocks Nil difficulty in headers causes problems because it is assumed by the go-ethereum codebase that difficulty is non nil. The specific problem requiring this fix was a NPE in Downloader.processHeaders where the total difficulty (td) is calculated by adding individual header difficulty values. Rather than try to fix this specific case it seems safer to ensure blocks have a non nil Difficulty which should help future proof our code since it upholds the assumptions of the go-ethereum codebase. * Skip uncle hash check for pre gingerbread headers Pre gingerbread headers do not have a valid uncle hash because they have no notion of uncles. * Handle choosing the cel2 transition block base fee If the parent block has a base fee then we use that, otherwise we use the initial base fee.
karlb
pushed a commit
that referenced
this pull request
Aug 30, 2024
* Add code to handle block receipts Add code to handle the extra block receipt added by celo to the list of receipts in a block and also adds the GetBlockReceipt rpc api which was an additional api added by celo to allow retrieveal of the block receipt. * Ensure non nil difficulty in pre-gingerbread blocks Nil difficulty in headers causes problems because it is assumed by the go-ethereum codebase that difficulty is non nil. The specific problem requiring this fix was a NPE in Downloader.processHeaders where the total difficulty (td) is calculated by adding individual header difficulty values. Rather than try to fix this specific case it seems safer to ensure blocks have a non nil Difficulty which should help future proof our code since it upholds the assumptions of the go-ethereum codebase. * Skip uncle hash check for pre gingerbread headers Pre gingerbread headers do not have a valid uncle hash because they have no notion of uncles. * Handle choosing the cel2 transition block base fee If the parent block has a base fee then we use that, otherwise we use the initial base fee.
karlb
pushed a commit
that referenced
this pull request
Oct 11, 2024
* Add code to handle block receipts Add code to handle the extra block receipt added by celo to the list of receipts in a block and also adds the GetBlockReceipt rpc api which was an additional api added by celo to allow retrieveal of the block receipt. * Ensure non nil difficulty in pre-gingerbread blocks Nil difficulty in headers causes problems because it is assumed by the go-ethereum codebase that difficulty is non nil. The specific problem requiring this fix was a NPE in Downloader.processHeaders where the total difficulty (td) is calculated by adding individual header difficulty values. Rather than try to fix this specific case it seems safer to ensure blocks have a non nil Difficulty which should help future proof our code since it upholds the assumptions of the go-ethereum codebase. * Skip uncle hash check for pre gingerbread headers Pre gingerbread headers do not have a valid uncle hash because they have no notion of uncles. * Handle choosing the cel2 transition block base fee If the parent block has a base fee then we use that, otherwise we use the initial base fee.
piersy
added a commit
that referenced
this pull request
Oct 15, 2024
* Add code to handle block receipts Add code to handle the extra block receipt added by celo to the list of receipts in a block and also adds the GetBlockReceipt rpc api which was an additional api added by celo to allow retrieveal of the block receipt. * Ensure non nil difficulty in pre-gingerbread blocks Nil difficulty in headers causes problems because it is assumed by the go-ethereum codebase that difficulty is non nil. The specific problem requiring this fix was a NPE in Downloader.processHeaders where the total difficulty (td) is calculated by adding individual header difficulty values. Rather than try to fix this specific case it seems safer to ensure blocks have a non nil Difficulty which should help future proof our code since it upholds the assumptions of the go-ethereum codebase. * Skip uncle hash check for pre gingerbread headers Pre gingerbread headers do not have a valid uncle hash because they have no notion of uncles. * Handle choosing the cel2 transition block base fee If the parent block has a base fee then we use that, otherwise we use the initial base fee.
karlb
pushed a commit
that referenced
this pull request
Dec 13, 2024
* Add code to handle block receipts Add code to handle the extra block receipt added by celo to the list of receipts in a block and also adds the GetBlockReceipt rpc api which was an additional api added by celo to allow retrieveal of the block receipt. * Ensure non nil difficulty in pre-gingerbread blocks Nil difficulty in headers causes problems because it is assumed by the go-ethereum codebase that difficulty is non nil. The specific problem requiring this fix was a NPE in Downloader.processHeaders where the total difficulty (td) is calculated by adding individual header difficulty values. Rather than try to fix this specific case it seems safer to ensure blocks have a non nil Difficulty which should help future proof our code since it upholds the assumptions of the go-ethereum codebase. * Skip uncle hash check for pre gingerbread headers Pre gingerbread headers do not have a valid uncle hash because they have no notion of uncles. * Handle choosing the cel2 transition block base fee If the parent block has a base fee then we use that, otherwise we use the initial base fee.
karlb
pushed a commit
that referenced
this pull request
Dec 16, 2024
* Add code to handle block receipts Add code to handle the extra block receipt added by celo to the list of receipts in a block and also adds the GetBlockReceipt rpc api which was an additional api added by celo to allow retrieveal of the block receipt. * Ensure non nil difficulty in pre-gingerbread blocks Nil difficulty in headers causes problems because it is assumed by the go-ethereum codebase that difficulty is non nil. The specific problem requiring this fix was a NPE in Downloader.processHeaders where the total difficulty (td) is calculated by adding individual header difficulty values. Rather than try to fix this specific case it seems safer to ensure blocks have a non nil Difficulty which should help future proof our code since it upholds the assumptions of the go-ethereum codebase. * Skip uncle hash check for pre gingerbread headers Pre gingerbread headers do not have a valid uncle hash because they have no notion of uncles. * Handle choosing the cel2 transition block base fee If the parent block has a base fee then we use that, otherwise we use the initial base fee.
karlb
pushed a commit
that referenced
this pull request
Dec 17, 2024
* Add code to handle block receipts Add code to handle the extra block receipt added by celo to the list of receipts in a block and also adds the GetBlockReceipt rpc api which was an additional api added by celo to allow retrieveal of the block receipt. * Ensure non nil difficulty in pre-gingerbread blocks Nil difficulty in headers causes problems because it is assumed by the go-ethereum codebase that difficulty is non nil. The specific problem requiring this fix was a NPE in Downloader.processHeaders where the total difficulty (td) is calculated by adding individual header difficulty values. Rather than try to fix this specific case it seems safer to ensure blocks have a non nil Difficulty which should help future proof our code since it upholds the assumptions of the go-ethereum codebase. * Skip uncle hash check for pre gingerbread headers Pre gingerbread headers do not have a valid uncle hash because they have no notion of uncles. * Handle choosing the cel2 transition block base fee If the parent block has a base fee then we use that, otherwise we use the initial base fee.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR contains a collection of additional changes that were required to support snap syncing.
They are:
params.InitialBaseFee
which is a hardcoded value. That doesn't work in our case because we probably want to set the base fee to match that defined at the transition point which can vary, so instead we take the value of the parent block, and if that is missing fall back to the base fee.