Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ahamlat
Copy link
Contributor

@ahamlat ahamlat commented Sep 25, 2025

PR description

This PR continues the work started in #9193 to improve performance under non-finality conditions.
It includes a new flag --cache-last-block-headers, to store the last block headers from the blocks persisted to the blockchain.
This flag works with --cache-last-block flag with no issues, because we can imagine a case where we want to store the last 1024 blocks and the last 10_000 block headers.

image

Fixed Issue(s)

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:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests
  • hive tests: Engine or other RPCs modified?

Signed-off-by: Ameziane H. <[email protected]>
@ahamlat ahamlat added doc-change-required Indicates an issue or PR that requires doc to be updated performance labels Sep 25, 2025
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 few typos and suggestion for code improvements.

ahamlat and others added 9 commits September 25, 2025 12:51
…n/DefaultBlockchain.java

Co-authored-by: Fabio Di Fabio <[email protected]>
Signed-off-by: ahamlat <[email protected]>
…n/DefaultBlockchain.java

Co-authored-by: Fabio Di Fabio <[email protected]>
Signed-off-by: ahamlat <[email protected]>
…n/DefaultBlockchain.java

Co-authored-by: Fabio Di Fabio <[email protected]>
Signed-off-by: ahamlat <[email protected]>
…n/DefaultBlockchain.java

Co-authored-by: Fabio Di Fabio <[email protected]>
Signed-off-by: ahamlat <[email protected]>
…n/DefaultBlockchain.java

Co-authored-by: Fabio Di Fabio <[email protected]>
Signed-off-by: ahamlat <[email protected]>
…n/DefaultBlockchain.java

Co-authored-by: Fabio Di Fabio <[email protected]>
Signed-off-by: ahamlat <[email protected]>
…n/DefaultBlockchainTest.java

Co-authored-by: Fabio Di Fabio <[email protected]>
Signed-off-by: ahamlat <[email protected]>
…n/DefaultBlockchain.java

Co-authored-by: Fabio Di Fabio <[email protected]>
Signed-off-by: ahamlat <[email protected]>
@fab-10
Copy link
Contributor

fab-10 commented Sep 25, 2025

Forgot to say to also add a CHANGELOG entry

@ahamlat ahamlat changed the title Add --cache-last-block-headers flag to cache the last n block header Add --cache-last-block-headers flag to cache the last n block headers Sep 25, 2025
Signed-off-by: Ameziane H. <[email protected]>
@ahamlat ahamlat merged commit e5ae8d2 into hyperledger:main Sep 25, 2025
46 checks passed
AliZDev-v0 pushed a commit to AliZDev-v0/besu that referenced this pull request Oct 5, 2025
…hyperledger#9223)

* Add --cache-last-block-headers flag to cache the last n block headers stored in the blockchain

Signed-off-by: Ameziane H. <[email protected]>
Co-authored-by: Fabio Di Fabio <[email protected]>
Signed-off-by: Ali Zhagparov <[email protected]>
jflo pushed a commit to jflo/besu that referenced this pull request Oct 13, 2025
…hyperledger#9223)

* Add --cache-last-block-headers flag to cache the last n block headers stored in the blockchain

Signed-off-by: Ameziane H. <[email protected]>
Co-authored-by: Fabio Di Fabio <[email protected]>
Signed-off-by: jflo <[email protected]>
@alexandratran alexandratran removed the doc-change-required Indicates an issue or PR that requires doc to be updated label Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants