-
Notifications
You must be signed in to change notification settings - Fork 899
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
Default receipt compaction to be enabled and update latest db version… #7450
Conversation
… to receipt compaction Signed-off-by: Jason Frame <jason.frame@consensys.net>
Just to make check my understanding, does this mean that the following scenarios hold? Scenario A
Scenario B
Scenario C
Scenario D Scenario E |
Not sure if this is related to the change of default directly, but is it intended that you have to give an explicit "true" value for the option to work?
Think I had a similar issue when I enabled bonsai-limit-trie-logs-enabled by default and had to use a fallbackValue: 7c21eed#diff-694f097ee7fb3140c34f4aed55d05b024c8faf509b09e71643d16ed68e1db67bR90 |
Yes
Yes
Yes
Yes it will remain on version 3, but if receipt compaction isn't enabled then a warning is printed in case they wanted to remove the compacted receipts
Yes in this Besu won't start and there will be an error saying the database is incompatible |
Signed-off-by: Jason Frame <jason.frame@consensys.net>
…nto receipt_compaction_enabled
I broke this in the original PR accidentally by adding arity=1 option. That was added so it would work with a default false value, fallback might have worked in that case. Now it defaults to true don't need either trick. Updated the PR so works with an implicit true value. |
Signed-off-by: Jason Frame <jason.frame@consensys.net>
…nto receipt_compaction_enabled
Now, this silently sets receipt-compaction-enabled=false...
That's why I had to add Also, I had to add my own log to test this - reckon it's worth adding this to the config overview table? |
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 waiting for resolve the comments on the options definition
@@ -95,8 +95,7 @@ public class DataStorageOptions implements CLIOptions<DataStorageConfiguration> | |||
|
|||
@Option( | |||
names = "--receipt-compaction-enabled", | |||
description = "Enables compact storing of receipts (default: ${DEFAULT-VALUE}).", | |||
arity = "1") | |||
description = "Enables compact storing of receipts (default: ${DEFAULT-VALUE})") |
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.
you could also set arity = "0..1"
so it works with or without the boolean parameter
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.
In the docs of the version we're using: https://javadoc.io/doc/info.picocli/picocli/4.7.5/picocli/CommandLine.Option.html#arity--
By default, flags (boolean options) have arity "0..1",
Not sure if this once used to work, but the behaviour I see is that a valueless option now acts as a toggle. So if we enable it by default, specifying --receipt-compaction-enabled
toggles and therefore disables the feature 😓
https://picocli.info/#_toggle_boolean_flags
When a flag option is specified on the command line picocli will set its value to the opposite of its default value.
Specifying fallBackValue="true"
was the only way I could get this to work as intended.
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've changed to use fallBackValue="true"
. I forgot to push the updated changes on Friday. I think it's working now.
|
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
reckon it's worth adding this to the config overview table?
Probably only useful in the short term when users who set it are wanting to remove it once its default. Maybe we should just print a less readable but catch-all "effective config" line for times like this.
Signed-off-by: Jason Frame <jason.frame@consensys.net>
Signed-off-by: Jason Frame <jason.frame@consensys.net> Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
Signed-off-by: Jason Frame <jason.frame@consensys.net> Signed-off-by: gconnect <agatevureglory@gmail.com>
PR description
Enable receipt compaction by default. This also updates the database version to use receipt compaction for all new databases simplifying database version logic. Whether receipt compaction is enabled or not still depends on the --receipt-compaction-enabled flag.
Performance testing
No noticeable difference in engine API times over 7 days

Fixed Issue(s)
fixes #7157
Thanks for sending a pull request! Have you done the following?
doc-change-required
label to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build
./gradlew acceptanceTest
./gradlew integrationTest
./gradlew ethereum:referenceTests:referenceTests