-
Notifications
You must be signed in to change notification settings - Fork 847
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
Reduce receipt size #6602
Merged
Merged
Reduce receipt size #6602
Changes from 20 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
1500416
optional inclusion of bloom filter
jframe 373ff28
receipt compact encoding
jframe ce08110
additional tests
jframe c77b73b
Write receipt storage using writeTo
jframe a5be606
Fix error encoding multiple log data entries
jframe 61117be
Merge remote-tracking branch 'upstream/main' into receipt-size
jframe 32dac9c
Log test compacting with leading zeros
jframe 591b341
Add Javadoc
jframe b964c97
Rename TransactionReceipt writeToCompactedWithRevertReason to writeTo…
jframe 726f8a3
Rename TransactionReceipt writeTo to writeToForNetwork to make intent…
jframe 617ec3f
Add feature flag --receipt-compaction-enabled so this can be disabled
jframe 2ca6819
Merge remote-tracking branch 'upstream/main' into receipt-size
jframe 13c0152
Add database version metadata for receipt compaction
jframe 2c514ef
Include forest receipt compaction version
jframe 8fe47f1
Fix unit tests
jframe ffe2622
add changelog entry
jframe e16bc9d
add changelog downgrade warning
jframe 7cffb80
change default for KeyValueStoragePrefixedKeyBlockchainStorage receip…
jframe 3e14b5f
Revert "change default for KeyValueStoragePrefixedKeyBlockchainStorag…
jframe 6c94080
Change default for --receipt-compaction-enabled to false
jframe 2872e8c
Add v2 version for privacy so that public transactions receipts are v…
jframe c9aefb2
unit tests for db metadata version bump
jframe 49fab89
add warning for downgrade
jframe cb86582
javadoc
jframe 85ebf6e
Don't store null to represent not having bloom filter
jframe 1da59c0
Change StorageProvider to take DataStorageConfiguration instead of re…
jframe 1541e97
Merge plugin DataStorageFormat into DataStorageConfiguration
jframe 96618b2
Merge remote-tracking branch 'upstream/main' into receipt-size
jframe 8afa9b1
Fix build after merge
jframe 4530ed7
Merge remote-tracking branch 'upstream/main' into receipt-size
jframe 21acfa5
update plugin-api hash
jframe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
package org.hyperledger.besu.cli.options.stable; | ||
|
||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.DEFAULT_BONSAI_MAX_LAYERS_TO_LOAD; | ||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.DEFAULT_RECEIPT_COMPACTION_ENABLED; | ||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.Unstable.DEFAULT_BONSAI_CODE_USING_CODE_HASH_ENABLED; | ||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.Unstable.DEFAULT_BONSAI_LIMIT_TRIE_LOGS_ENABLED; | ||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.Unstable.DEFAULT_BONSAI_TRIE_LOG_PRUNING_WINDOW_SIZE; | ||
|
@@ -61,6 +62,12 @@ public class DataStorageOptions implements CLIOptions<DataStorageConfiguration> | |
arity = "1") | ||
private Long bonsaiMaxLayersToLoad = DEFAULT_BONSAI_MAX_LAYERS_TO_LOAD; | ||
|
||
@Option( | ||
names = "--receipt-compaction-enabled", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
description = "Enables compact storing of receipts (default: ${DEFAULT-VALUE}).", | ||
arity = "1") | ||
private Boolean receiptCompactionEnabled = DEFAULT_RECEIPT_COMPACTION_ENABLED; | ||
|
||
@CommandLine.ArgGroup(validate = false) | ||
private final DataStorageOptions.Unstable unstableOptions = new Unstable(); | ||
|
||
|
@@ -149,6 +156,7 @@ public static DataStorageOptions fromConfig(final DataStorageConfiguration domai | |
final DataStorageOptions dataStorageOptions = DataStorageOptions.create(); | ||
dataStorageOptions.dataStorageFormat = domainObject.getDataStorageFormat(); | ||
dataStorageOptions.bonsaiMaxLayersToLoad = domainObject.getBonsaiMaxLayersToLoad(); | ||
dataStorageOptions.receiptCompactionEnabled = domainObject.getReceiptCompactionEnabled(); | ||
dataStorageOptions.unstableOptions.bonsaiLimitTrieLogsEnabled = | ||
domainObject.getUnstable().getBonsaiLimitTrieLogsEnabled(); | ||
dataStorageOptions.unstableOptions.bonsaiTrieLogPruningWindowSize = | ||
|
@@ -164,6 +172,7 @@ public DataStorageConfiguration toDomainObject() { | |
return ImmutableDataStorageConfiguration.builder() | ||
.dataStorageFormat(dataStorageFormat) | ||
.bonsaiMaxLayersToLoad(bonsaiMaxLayersToLoad) | ||
.receiptCompactionEnabled(receiptCompactionEnabled) | ||
.unstable( | ||
ImmutableDataStorageConfiguration.Unstable.builder() | ||
.bonsaiLimitTrieLogsEnabled(unstableOptions.bonsaiLimitTrieLogsEnabled) | ||
|
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Have you evaluated the possibility to add a storage subcommand to revert to previous format? does it make sense?
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.
I tested some migration code as part of my testing as it took approximately 17 hours on mainnet so it would be better to just resync with it taking that long. It's not the exact code as I would use for a subcommand as this put the receipts in a different column family so I could compare sizes but I think it would take a similar time.