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

Disable bonsai-limit-trie-logs-enabled if sync-mode=FULL #7357

Merged
merged 6 commits into from
Jul 25, 2024

Conversation

siladu
Copy link
Contributor

@siladu siladu commented Jul 22, 2024

Since bonsai-limit-trie-logs-enabled has been defaulted to true, instead of preventing startup, implicitly set bonsai-limit-trie-logs-enabled=false and warn...

besu --sync-mode=FULL
...
2024-07-22 13:34:52.764+10:00 | main | WARN  | Besu | Cannot enable --bonsai-limit-trie-logs-enabled with --sync-mode FULL and --data-storage-format BONSAI. --bonsai-limit-trie-logs-enabled has been automatically disabled.

However, if you explicitly try to set it to true, you get a startup error...

besu --sync-mode=FULL --bonsai-limit-trie-logs-enabled=true
...
2024-07-22 14:56:11.189+10:00 | main | ERROR | Besu | Failed to start Besu
picocli.CommandLine$ParameterException: Cannot enable --bonsai-limit-trie-logs-enabled with --sync-mode FULL and --data-storage-format=BONSAI. You must set --bonsai-limit-trie-logs-enabled=false or use a different sync-mode
BESU_SYNC_MODE=FULL BESU_BONSAI_LIMIT_TRIE_LOGS_ENABLED=TRUE besu
...
2024-07-22 15:32:09.687+10:00 | main | ERROR | Besu | Failed to start Besu
picocli.CommandLine$ParameterException: Cannot enable --bonsai-limit-trie-logs-enabled with --sync-mode=FULL and --data-storage-format=BONSAI. You must set --bonsai-limit-trie-logs-enabled=false or use a different sync-mode

This also avoids a scenario where private networks can end up starting with sync-mode=FULL and bonsai-limit-trie-logs-enabled=true.

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

Locally, you can run these tests to catch failures early:

  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

siladu added 3 commits July 22, 2024 13:39
Instead of preventing startup
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 July 22, 2024 06:03
siladu added 2 commits July 22, 2024 16:23
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
@siladu siladu self-assigned this Jul 23, 2024
Copy link
Contributor

@garyschulte garyschulte left a comment

Choose a reason for hiding this comment

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

LGTM.

One ask though, it would be helpful to see these configs (--bonsai-limit-trie-logs-enabled, and --bonsai-trie-logs-pruning-window-size) in the startup banner logs since they have a significant impact to linea and fleet mode operations

@siladu
Copy link
Contributor Author

siladu commented Jul 25, 2024

@garyschulte its been in the startup banner from the get go 🙂

@garyschulte
Copy link
Contributor

garyschulte commented Jul 25, 2024

@garyschulte its been in the startup banner from the get go 🙂

I thought that was the case but I didn't see it when I didn't specify it on the command line

➜  besu git:(limit-trie-logs-false-for-full-sync) ./build/install/besu/bin/besu --sync-mode=FULL               
2024-07-25 15:01:05.464-07:00 | main | INFO  | Besu | Starting Besu
2024-07-25 15:01:05.893-07:00 | main | WARN  | Besu | Engine API authentication enabled without key file. Expect ephemeral jwt.hex file in datadir
2024-07-25 15:01:05.895-07:00 | main | WARN  | Besu | Forcing --bonsai-limit-trie-logs-enabled=false, since it cannot be enabled with --sync-mode=FULL and --data-storage-format=BONSAI.
2024-07-25 15:01:05.896-07:00 | main | INFO  | Besu | Connecting to 0 static nodes.
2024-07-25 15:01:05.928-07:00 | main | INFO  | Besu | 
####################################################################################################
#                                                                                                  #
# Besu version 24.7-develop-851c535                                                                #
#                                                                                                  #
# Configuration:                                                                                   #
# Network: Mainnet                                                                                 #
# Network Id: 1                                                                                    #
# Data storage: Bonsai                                                                             #
# Sync mode: Full                                                                                  #
# Engine APIs: ENGINE,ETH                                                                          #
# Engine port: 8551                                                                                #
# Engine JWT: /Users/garyschulte/dev/besu/build/install/besu/jwt.hex                               #
# Using LAYERED transaction pool implementation                                                    #
# Using STACKED worldstate update mode                                                             #
#                                                                                                  #
# Host:                                                                                            #
# Java: corretto-java-22                                                                           #
# Maximum heap size: 16.00 GB                                                                      #
# OS: osx-aarch_64                                                                                 #
# Total memory: 64.00 GB                                                                           #
# CPU cores: 12                                                                                    #
#                                                                                                  #
# Plugin Registration Summary:                                                                     #
# No plugins have been registered.                                                                 #
# TOTAL = 0 of 0 plugins successfully registered.                                                  #
#                                                                                                  #
####################################################################################################
2024-07-25 15:01:05.928-07:00 | main | INFO  | Besu | Security Module: localfile
2024-07-25 15:01:05.929-07:00 | main | INFO  | VersionMetadata | Lookup version metadata file in data

@siladu
Copy link
Contributor Author

siladu commented Jul 25, 2024

@garyschulte ahh it's only present when it's enabled. In this case, FULL sync has auto-disabled it and printed a warning log.

Are you suggesting explicitly stating it's disabled in the banner? I'm not sure there's precedent for that with other disabled features but it does seem reasonable since it's no longer experimental and is enabled by default for bonsai.

@garyschulte
Copy link
Contributor

I think it was an expectation issue on my part. I was thinking of adding it as a static element, but of course it only makes sense for bonsai storage format.

It seems reasonable to just rely on its absence to indicate it is disabled 👍

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
@siladu siladu enabled auto-merge (squash) July 25, 2024 22:58
@siladu siladu merged commit 4a670a1 into hyperledger:main Jul 25, 2024
40 checks passed
@siladu siladu deleted the limit-trie-logs-false-for-full-sync branch July 25, 2024 23:23
gconnect pushed a commit to gconnect/besu that referenced this pull request Aug 26, 2024
…#7357)

There is still a startup error when bonsai-limit-trie-logs-enabled is explicitly set to true

---------

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: gconnect <agatevureglory@gmail.com>
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.

2 participants