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

Experimental --Xchain-pruning-enabled=true doesn't work with documented QBFT defaults #7963

Open
matthew1001 opened this issue Nov 29, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@matthew1001
Copy link
Contributor

matthew1001 commented Nov 29, 2024

When a Bonsai QBFT node with --Xchain-pruning-enabled=true is stopped and restarted, it errors with:

2024-11-29 15:26:30.120+00:00 | main | ERROR | Runner | unable to start main loop
com.google.common.util.concurrent.UncheckedExecutionException: java.util.NoSuchElementException: Supplied block was on a orphaned chain, unable to generate VoteTally.
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2085)
        at com.google.common.cache.LocalCache.get(LocalCache.java:4017)
        at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4898)
        at org.hyperledger.besu.consensus.common.validator.blockbased.VoteTallyCache.getVoteTallyAfterBlock(VoteTallyCache.java:76)
        at org.hyperledger.besu.consensus.common.validator.blockbased.BlockValidatorProvider.getValidatorsAfterBlock(BlockValidatorProvider.java:97)
        at org.hyperledger.besu.consensus.qbft.validator.ForkingValidatorProvider.getValidatorsAfterBlock(ForkingValidatorProvider.java:66)
        at org.hyperledger.besu.consensus.qbft.validator.ForkingValidatorProvider.getValidatorsAtHead(ForkingValidatorProvider.java:60)
        at org.hyperledger.besu.consensus.common.bft.statemachine.BftFinalState.getValidators(BftFinalState.java:93)
        at org.hyperledger.besu.consensus.common.bft.statemachine.BftFinalState.isLocalNodeValidator(BftFinalState.java:130)
        at org.hyperledger.besu.consensus.qbft.statemachine.QbftBlockHeightManagerFactory.create(QbftBlockHeightManagerFactory.java:69)
        at org.hyperledger.besu.consensus.qbft.statemachine.QbftController.createNewHeightManager(QbftController.java:118)
        at org.hyperledger.besu.consensus.common.bft.statemachine.BaseBftController.startNewHeightManager(BaseBftController.java:210)
        at org.hyperledger.besu.consensus.common.bft.statemachine.BaseBftController.start(BaseBftController.java:79)
        at org.hyperledger.besu.consensus.common.bft.blockcreation.BftMiningCoordinator.start(BftMiningCoordinator.java:101)
        at org.hyperledger.besu.controller.QbftBesuControllerBuilder$1.onInitialSyncCompleted(QbftBesuControllerBuilder.java:323)

Steps to Reproduce

  1. Create 4-node QBFT chain
    • I used a mix of FOREST and BONSAI nodes, all with FULL sync mode
  2. Configure one of the BONSAI nodes to have --Xchain-pruning-enabled
  3. Start the chain (2s block period) and leave it for long enough to produce 7200 blocks (the min default for pruning)
  4. At e.g. 10k blocks, stop all the nodes
  5. Restart all the nodes
  6. Nodes 1-3 start producing blocks again. Node 4 errors with above stack trace.

Version

24.11-develop-5596cbd

@matthew1001 matthew1001 added the bug Something isn't working label Nov 29, 2024
@matthew1001
Copy link
Contributor Author

It looks like this is due to the default epochlength in the docs being set to 30000 blocks, where pruning only retains the previous 7200 blocks. So changing config does fix the issue, but I think the flag should check if epochlength > --Xchain-pruning-blocks-retained and fail validation if it does. I'll leave this issue open and will maybe find time to fix it shortly.

@matthew1001 matthew1001 changed the title Experimental --Xchain-pruning-enabled=true doesn't work with QBFT Experimental --Xchain-pruning-enabled=true doesn't work with documented QBFT defaults Dec 2, 2024
@matthew1001 matthew1001 self-assigned this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant