-
Notifications
You must be signed in to change notification settings - Fork 985
feat(history-expiry): save only headers for pre-merge blocks #8582
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
feat(history-expiry): save only headers for pre-merge blocks #8582
Conversation
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
… policy Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
…iel-Trintinalia/besu into sync-save-pre-merge-headers
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
pinges
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment :-)
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/DefaultBlockchain.java
Outdated
Show resolved
Hide resolved
...in/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/FastSyncDownloadPipelineFactory.java
Show resolved
Hide resolved
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
siladu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the testing and write up 👍
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/DefaultBlockchain.java
Show resolved
Hide resolved
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/SavePreMergeHeadersStep.java
Outdated
Show resolved
Hide resolved
|
|
||
| private long getPreMergeHeaderBlockNumber(final SyncState syncState) { | ||
| return syncConfig.isSnapSyncSavePreMergeHeadersOnlyEnabled() | ||
| ? syncState.getCheckpoint().map(checkpoint -> checkpoint.blockNumber() - 1).orElse(0L) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially a breaking change if any private networks make use of the existing checkpoint config?
We're kind of overloading the checkpoint concept, which I think makes sense for public networks as long as we're explicit about it. We should check usage for private.
In full 4444s, with rolling window, I guess this static checkpoint goes away entirely for public nets?
...c/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/SavePreMergeHeadersStepTest.java
Show resolved
Hide resolved
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/SavePreMergeHeadersStep.java
Outdated
Show resolved
Hide resolved
|
Missing changelog too - unless that's intentional? |
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
siladu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just the changelog missing potentially, especially if we want to mention breaking changes (e.g. to private networks) at this point.
Description
This pull request introduces a new feature to enable saving only pre-merge block headers during synchronisation, along with related enhancements to the synchronisation pipeline and blockchain storage.
New Feature: Save Pre-Merge Headers Only for Snap Sync
--Xsnapsync-synchronizer-pre-merge-headers-only-enabledto enable saving only pre-merge block headers during synchronizationSavePreMergeHeadersStepclass to handle the logic for storing pre-merge headers in the blockchain.Blockchain Storage
unsafeStoreHeaderinMutableBlockchainto store block headers updating the chain state.Synchronisation Pipeline Updates
FastSyncDownloadPipelineFactoryto includeSavePreMergeHeadersStepin the pipeline when the new feature is enabled.Configuration Update
Pipeline before the changes:
(headers: blue | bodies: red)
Pipeline with this PR:
(headers: blue | bodies: red)
Disk usage
Syncing logs: