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

Save earliest slot block in a DB variable #8722

Merged

Conversation

gfukushima
Copy link
Contributor

@gfukushima gfukushima commented Oct 14, 2024

PR Description

During the investigation on the mainnet sync issue it was found that this query can take a descent amount of time (it can vary from a few ms to 2 digits seconds). This information is used when a peer send a BeaconBlocksByRangeRequestMessage ultimately causing a disconnection from the peer's side if this query times out.
This data fetch could be optimised by storing the earliest block slot in a variable in the database.

Fixed Issue(s)

Fixes #8658

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

…xt block after prune runs

Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
…le even when the slot after the last pruned is empty

Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
…xt block after prune runs

Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
…le even when the slot after the last pruned is empty

Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
…t slot after prune runs

Signed-off-by: Gabriel Fukushima <[email protected]>
…riable' into save-earliest-slot-block-in-dbvariable

# Conflicts:
#	storage/src/integration-test/java/tech/pegasys/teku/storage/server/kvstore/DatabaseTest.java
…ble which should trigger fallback to iterator

Signed-off-by: Gabriel Fukushima <[email protected]>
…riable' into save-earliest-slot-block-in-dbvariable
Signed-off-by: Gabriel Fukushima <[email protected]>
@gfukushima gfukushima marked this pull request as ready for review October 18, 2024 01:27
Copy link
Contributor

@rolfyone rolfyone left a comment

Choose a reason for hiding this comment

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

LGTM now

@gfukushima gfukushima enabled auto-merge (squash) October 21, 2024 23:44
@gfukushima gfukushima merged commit 2550254 into Consensys:master Oct 22, 2024
17 checks passed
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.

[RocksDB] Slow getEarliestAvailableBlockSlot
2 participants