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

Deprecate Xsnapsync-bft-enabled option , to be removed in future release #7930

Merged
merged 28 commits into from
Mar 10, 2025

Conversation

pullurib
Copy link
Contributor

@pullurib pullurib commented Nov 26, 2024

PR description

Adding deprecation notice and marking for removal in future release.

Fixed Issue(s)

#7924

Bhanu Pulluri and others added 2 commits November 26, 2024 13:17
Copy link
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

needs a changelog entry - this will be a breaking change

@macfarla macfarla added the doc-change-required Indicates an issue or PR that requires doc to be updated label Nov 27, 2024
Copy link
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

you'll also want to remove
hidden = true,
so the option shows in the help

Copy link
Contributor

@siladu siladu left a comment

Choose a reason for hiding this comment

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

IMO better to avoid the breaking change and make this an alias and call out the deprecation of the X version, e.g. see

// TODO --Xbonsai-limit-trie-logs-enabled and --Xbonsai-trie-log-pruning-enabled are deprecated,
// remove in a future release
@SuppressWarnings("ExperimentalCliOptionMustBeCorrectlyDisplayed")
@Option(
names = {
LIMIT_TRIE_LOGS_ENABLED,
"--Xbonsai-limit-trie-logs-enabled", // deprecated
"--Xbonsai-trie-log-pruning-enabled" // deprecated
},
fallbackValue = "true",
description = "Limit the number of trie logs that are retained. (default: ${DEFAULT-VALUE})")
private Boolean limitTrieLogsEnabled = DEFAULT_LIMIT_TRIE_LOGS_ENABLED;

Then can add entry to changelog under "Upcoming Breaking Changes"

@pullurib
Copy link
Contributor Author

Thanks for the suggestions. So currently I will

  • add comments in the code to indicate deprecation in future release
  • Add changelog entry for upcoming breaking changes
  • Update documentation to indicate this option deprecation soon and that it will be enabled by default then

@matthew1001
Copy link
Contributor

Yes I think I we should remove the option, not promote it to non-experimental.

So I can see the case for making this PR a changelog entry to mark it deprecated, followed by a PR after the next release or two have gone out, which basically reverses the PR I originally added the new flag under.

@macfarla macfarla marked this pull request as draft November 27, 2024 22:49
Bhanu Pulluri added 2 commits November 28, 2024 11:44
Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
@pullurib pullurib changed the title Move snapsync-bft-enabled to stable options Deprecate Xsnapsync-bft-enabled option , to be removed in future release Nov 28, 2024
Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
Copy link
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

ok so if I don't specify this option, does my QBFT network work with SNAP/CHECKPOINT sync ? Have you tried it? Can you add a test for this too

take a look at this code in BesuCommand -

  private void validateConsensusSyncCompatibilityOptions() {
    // snap and checkpoint are experimental for BFT
    if ((genesisConfigOptionsSupplier.get().isIbftLegacy()
            || genesisConfigOptionsSupplier.get().isIbft2()
            || genesisConfigOptionsSupplier.get().isQbft())
        && !unstableSynchronizerOptions.isSnapSyncBftEnabled()) {
      final String errorSuffix = "can't be used with BFT networks";
      if (SyncMode.CHECKPOINT.equals(syncMode)) {
        throw new ParameterException(
            commandLine, String.format("%s %s", "Checkpoint sync", errorSuffix));
      }
      if (syncMode == SyncMode.SNAP) {
        throw new ParameterException(commandLine, String.format("%s %s", "Snap sync", errorSuffix));
      }
    }
  }

@matthew1001
Copy link
Contributor

ok so if I don't specify this option, does my QBFT network work with SNAP/CHECKPOINT sync ? Have you tried it?

Yeah I've tested all combinations of QBFT/IBFT/SNAP/CHECKPOINT and can confirm that they all work. @pullurib could you look at which tests already exist for QBFT sync modes and see if we can add one or two for SNAP and CHECKPOINT please?

@matthew1001
Copy link
Contributor

Suggest that since we're not removing the validation logic in this PR and we add additional tests under the PR where we do remove it if that's OK with you @macfarla

Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Bhanu Pulluri <59369753+pullurib@users.noreply.github.com>
@pullurib pullurib requested a review from macfarla December 2, 2024 17:01
@pullurib pullurib marked this pull request as ready for review December 2, 2024 17:03
@pullurib
Copy link
Contributor Author

pullurib commented Dec 2, 2024

Sure, I'll take a look and add any missing tests in a following PR which would remove the option and cleanup the validation checks .

@macfarla
Copy link
Contributor

macfarla commented Dec 2, 2024

Suggest that since we're not removing the validation logic in this PR and we add additional tests under the PR where we do remove it if that's OK with you @macfarla

Disagree - deprecation is a signal to users that they should stop using this flag. However if I'm a user, I can't stop using this flag until SNAP & BFT work together without it. It will be confusing for users to deprecate the flag first without removing the part of the code that prevents startup with SNAP & BFT unless you specify this flag.

I would suggest

  1. remove the restriction on SNAP+BFT - fine to do this in a separate PR - effectively this makes the --Xsnap-bft-enabled flag useless but users don't need to do anything
  2. signal deprecation of the flag - users can remove use of the flag during the deprecation period
  3. remove the flag - breaking change

@macfarla
Copy link
Contributor

macfarla commented Dec 2, 2024

this is what I get right now if I try SNAP + BFT without using this flag

2024-12-03 09:06:37.550+10:00 | main | INFO  | Besu | Starting Besu
2024-12-03 09:06:38.049+10:00 | main | ERROR | Besu | Failed to start Besu Snap sync can't be used with BFT networks
Snap sync can't be used with BFT networks

To display full help:
besu [COMMAND] --help

@matthew1001
Copy link
Contributor

Apologies, I thought this was just a deprecation announce via changelog but I'm fine with changing the logic at the same time and making the flag redundant (but valid). Sound OK to you @pullurib ?

@alexandratran alexandratran removed the doc-change-required Indicates an issue or PR that requires doc to be updated label Dec 3, 2024
@pullurib
Copy link
Contributor Author

pullurib commented Dec 3, 2024

Sounds good, @matthew1001 . Thanks for clarifying @macfarla . I'll go ahead and include those changes too in this PR .

Bhanu Pulluri added 2 commits December 6, 2024 15:41
…'s now supported by default

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
…4-bft-snapsync

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
Bhanu Pulluri and others added 4 commits February 25, 2025 00:03
Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
@pullurib pullurib marked this pull request as ready for review February 26, 2025 07:21
@github-actions github-actions bot removed the Stale label Feb 27, 2025
Copy link
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

looking good. an extra level of niceness is if I specify this option, to log a warning to say it's now deprecated and ignored

@macfarla macfarla dismissed their stale review February 27, 2025 05:47

requested changes have been made.

pullurib and others added 2 commits February 27, 2025 10:01
…erOptions.java

Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Bhanu Pulluri <59369753+pullurib@users.noreply.github.com>
@macfarla macfarla enabled auto-merge (squash) March 3, 2025 02:19
@macfarla macfarla disabled auto-merge March 3, 2025 23:47
@macfarla
Copy link
Contributor

macfarla commented Mar 3, 2025

AT failure -
https://github.com/hyperledger/besu/actions/runs/13622026362/job/38135471845?pr=7930

> Task :acceptance-tests:tests:acceptanceTestNotPrivacy
BftSyncAcceptanceTest > shouldSyncValidatorNode(String, BftAcceptanceTestParameterization, SyncMode) > 1: ibft2 with FULL sync FAILED
    java.lang.AssertionError: 
    Expecting actual:
      -1
    to be greater than or equal to:
      1
        at org.hyperledger.besu.tests.acceptance.bft.BftSyncAcceptanceTest.shouldSyncValidatorNode(BftSyncAcceptanceTest.java:79)
BftSyncAcceptanceTest > shouldSyncValidatorNode(String, BftAcceptanceTestParameterization, SyncMode) > 3: ibft2 with SNAP sync FAILED
    java.lang.AssertionError: 
    Expecting actual:
      -1
    to be greater than or equal to:
      1
        at org.hyperledger.besu.tests.acceptance.bft.BftSyncAcceptanceTest.shouldSyncValidatorNode(BftSyncAcceptanceTest.java:79)

Bhanu Pulluri and others added 3 commits March 4, 2025 16:04
@pullurib
Copy link
Contributor Author

pullurib commented Mar 4, 2025

AT failure - https://github.com/hyperledger/besu/actions/runs/13622026362/job/38135471845?pr=7930

> Task :acceptance-tests:tests:acceptanceTestNotPrivacy
BftSyncAcceptanceTest > shouldSyncValidatorNode(String, BftAcceptanceTestParameterization, SyncMode) > 1: ibft2 with FULL sync FAILED
    java.lang.AssertionError: 
    Expecting actual:
      -1
    to be greater than or equal to:
      1
        at org.hyperledger.besu.tests.acceptance.bft.BftSyncAcceptanceTest.shouldSyncValidatorNode(BftSyncAcceptanceTest.java:79)
BftSyncAcceptanceTest > shouldSyncValidatorNode(String, BftAcceptanceTestParameterization, SyncMode) > 3: ibft2 with SNAP sync FAILED
    java.lang.AssertionError: 
    Expecting actual:
      -1
    to be greater than or equal to:
      1
        at org.hyperledger.besu.tests.acceptance.bft.BftSyncAcceptanceTest.shouldSyncValidatorNode(BftSyncAcceptanceTest.java:79)

Looks like a timing issue - has been passing locally. Added some delay to let the new node come up and sync.

@macfarla
Copy link
Contributor

macfarla commented Mar 5, 2025

I don't love fixing the failing test with a sleep tbh, is there another option

Bhanu Pulluri and others added 4 commits March 5, 2025 17:03
Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
Signed-off-by: Bhanu Pulluri <59369753+pullurib@users.noreply.github.com>
@pullurib
Copy link
Contributor Author

pullurib commented Mar 5, 2025

I don't love fixing the failing test with a sleep tbh, is there another option

Updated with conditions and timeouts

@matthew1001 matthew1001 merged commit e0bad46 into hyperledger:main Mar 10, 2025
43 checks passed
@pullurib pullurib deleted the 7924-bft-snapsync branch March 10, 2025 15:23
marcosio pushed a commit to IoBuilders/besu that referenced this pull request Mar 12, 2025
…ase (hyperledger#7930)

* Move snapsync-bft-enabled to stable options

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>

* Add deprecation comments:

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>

* Changelog entry for deprecation

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>

* spotlessApply

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>

* Update CHANGELOG.md

Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Bhanu Pulluri <59369753+pullurib@users.noreply.github.com>

* Removed option value checking to enable snapsync for bft networks. It's now supported by default

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>

* Add acceptance tests for QBFT sync

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>

* Update test

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>

* update CHANGELOG

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>

* Update besu/src/main/java/org/hyperledger/besu/cli/options/SynchronizerOptions.java

Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Bhanu Pulluri <59369753+pullurib@users.noreply.github.com>

* add delay to let the new validator sync

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>

* update BFT sync AT to use conditions and timeouts

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>

---------

Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
Signed-off-by: Bhanu Pulluri <59369753+pullurib@users.noreply.github.com>
Co-authored-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
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.

5 participants