Skip to content

add Xchain-pruning-blocks-retained must be >= epochlength (#7963)#8140

Merged
jframe merged 12 commits intobesu-eth:mainfrom
philosup:fix-7963
Feb 4, 2025
Merged

add Xchain-pruning-blocks-retained must be >= epochlength (#7963)#8140
jframe merged 12 commits intobesu-eth:mainfrom
philosup:fix-7963

Conversation

@philosup
Copy link
Copy Markdown
Contributor

PR description

Fixed Issue(s)

fixes #7963

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

@philosup philosup force-pushed the fix-7963 branch 2 times, most recently from e4a731f to 86764b9 Compare January 20, 2025 09:05
…dation if it does(besu-eth#7963)

Signed-off-by: philosup <philosup@gmail.com>
Signed-off-by: philosup <philosup@gmail.com>
Copy link
Copy Markdown
Contributor

@jframe jframe left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

Just one small suggestion to check other consensus mechanism that also have an epoch.

this.commandLine,
"--Xchain-pruning-blocks-retained must be >= "
+ unstableChainPruningOptions.getChainDataPruningBlocksRetainedLimit());
} else if (genesisConfigOptions.isQbft()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ibft and Clique also have epochs and will have the same issue. Suggest using isPoa() here instead.

Signed-off-by: philosup <philosup@gmail.com>
Signed-off-by: philosup <philosup@gmail.com>
+ unstableChainPruningOptions.getChainDataPruningBlocksRetainedLimit());
} else if (genesisConfigOptions.isPoa()
&& unstableChainPruningOptions.getChainDataPruningBlocksRetained()
< genesisConfigOptions.getQbftConfigOptions().getEpochLength()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also need to check the epoch length for clique and ibft2 not just qbft.

Doing something this should work
`< (genesisConfigOptions.getBftConfigOptions().getEpochLength() || genesisConfigOptions.getCliqueConfigOptions.getEpochLength())

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Modified to handle epochLength per consensus mechanism, as genesisConfigOptions.getCliqueConfigOptions().getEpochLength() returns a default value of 30000 even when Clique is not configured.

Signed-off-by: philosup <philosup@gmail.com>
Signed-off-by: philosup <philosup@gmail.com>
Copy link
Copy Markdown
Contributor

@jframe jframe left a comment

Choose a reason for hiding this comment

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

LGTM

@macfarla macfarla enabled auto-merge (squash) February 4, 2025 05:55
@jframe jframe disabled auto-merge February 4, 2025 06:10
@jframe jframe enabled auto-merge (squash) February 4, 2025 06:10
@jframe jframe disabled auto-merge February 4, 2025 06:10
@jframe jframe enabled auto-merge (squash) February 4, 2025 06:11
@jframe jframe merged commit b74a7f2 into besu-eth:main Feb 4, 2025
pullurib pushed a commit to pullurib/besu that referenced this pull request Feb 6, 2025
) (besu-eth#8140)

Signed-off-by: philosup <philosup@gmail.com>
Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
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.

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

4 participants