Skip to content
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

Enable --Xbonsai-limit-trie-logs-enabled by default #7181

Merged

Conversation

siladu
Copy link
Contributor

@siladu siladu commented Jun 5, 2024

PR description

Enable --Xbonsai-limit-trie-logs-enabled by default, unless sync-mode=FULL.
More info: https://wiki.hyperledger.org/display/BESU/Limit+Trie+Logs+for+Bonsai

When sync-mode=FULL and data-storage-format=BONSAI you get a config validation error at startup...

besu --sync-mode=FULL --data-storage-format=BONSAI
2024-06-06 17:36:12.806+01:00 | main | INFO  | Besu | Starting Besu
2024-06-06 17:36:13.027+01:00 | main | ERROR | Besu | Failed to start Besu
...
Cannot enable --Xbonsai-limit-trie-logs-enabled with sync mode FULL

I will promote to a Stable option in a separate PR.

This option has been tested on our canaries and by the community since https://github.com/hyperledger/besu/releases/tag/24.3.0

Added a fallback value for the option otherwise specifying --Xbonsai-limit-trie-logs-enabled on the command line, without a value, toggles it back off again.

The minimalist-profile has been updated from bonsai-historical-block-limit=128 to bonsai-historical-block-limit=512 to avoid further code changes and because I believe there is only a ~60MB difference so using 128 has limited value, see #6560 (comment)

I will conservatively set Xbonsai-limit-trie-logs-enabled=false in the enterprise profile for now as not sure it is desirable.

Fixed Issue(s)

Fixes #6560

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
@@ -86,6 +86,8 @@ public static class Unstable {
@CommandLine.Option(
hidden = true,
names = {BONSAI_LIMIT_TRIE_LOGS_ENABLED, "--Xbonsai-trie-log-pruning-enabled"},
defaultValue = "true",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be enabled by default for all profiles? In the The enterprise-private profile probably makes more sense to not prune I think. @non-fungible-nelson What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not. I thought it might be alright initially since it's scoped to BONSAI, but I know we have a follow-on story related to profiles somewhere...I will check if we need to play that at the same time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is relevant #6560

I think this may have been the PR I was thinking about, which doesn't actually touch the profiles directly but had some impact on them #6561

Copy link
Contributor Author

@siladu siladu Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disabled this in enterprise-profile 👍 - side note: was surprised to find enterprise was defaulting to BONSAI, addressed that here: #7186

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
…ogs-enabled-by-default

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
@siladu siladu marked this pull request as ready for review June 6, 2024 11:31
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Copy link
Contributor

@fab-10 fab-10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a couple of nits

@@ -1244,8 +1244,13 @@ public void ethStatsContactOptionCannotBeUsedWithoutEthStatsServerProvided() {
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any test to verify it is enabled by default?

Copy link
Contributor Author

@siladu siladu Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added here 100bf43 (#7181)

long MINIMUM_BONSAI_TRIE_LOG_RETENTION_LIMIT = DEFAULT_BONSAI_MAX_LAYERS_TO_LOAD;
int DEFAULT_BONSAI_TRIE_LOG_PRUNING_WINDOW_SIZE = 30_000;
boolean DEFAULT_BONSAI_FULL_FLAT_DB_ENABLED = true;
boolean DEFAULT_BONSAI_CODE_USING_CODE_HASH_ENABLED = true;

DataStorageConfiguration.Unstable DEFAULT =
ImmutableDataStorageConfiguration.Unstable.builder().build();
ImmutableDataStorageConfiguration.Unstable.builder()
.bonsaiLimitTrieLogsEnabled(true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be redundant since the default is true now, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well spotted, an artefact from an earlier implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed here 100bf43 (#7181)

Address PR comments

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
@non-fungible-nelson
Copy link
Contributor

Commit LGTM - thanks @siladu for the last minute fixes.

@jframe jframe merged commit 7c21eed into hyperledger:main Jun 6, 2024
40 checks passed
@siladu siladu deleted the bonsai-limit-trie-logs-enabled-by-default branch June 7, 2024 05:28
@matthew1001
Copy link
Contributor

FYI @siladu in PR #7140 I was planning to change the fail-on-start behaviour if FULL sync mode is enabled and bonsai-trie-log-pruning-enabled is set, and instead set bonsai-trie-log-pruning-enabled to false if sync mode is FULL (with a log message to state that the default has been overridden).

Let me know if you have any concerns about that change - maybe via comments in that PR?

gtebrean pushed a commit to gtebrean/besu that referenced this pull request Jun 26, 2024
* Enable --Xbonsai-limit-trie-logs-enabled by default
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: George Tebrean <george@web3labs.com>
gtebrean pushed a commit to gtebrean/besu that referenced this pull request Jun 26, 2024
* Enable --Xbonsai-limit-trie-logs-enabled by default
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

default for bonsai-limit-trie-logs-enabled=True
5 participants