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

fix(e2store): era missing a beacon block off by 1 error #1372

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

KolbyML
Copy link
Member

@KolbyML KolbyML commented Aug 12, 2024

What was wrong?

When I was testing reading beacon blocks from era files when I compared the result of era 600 and era 601 their execution numbers didn't line up by 1 block, when I fixed this they lined up and I could linearly scan blocks from era files

I tested this for a few other sequential era files and the issues remained the same

How was it fixed?

change the 4 to a 3

@@ -50,7 +50,7 @@ impl Era {

// Iterate over the block entries. Skip the first and last 3 entries.
let mut next_slot = slot_index_block.slot_index.starting_slot;
for idx in 1..entries_length - 4 {
for idx in 1..entries_length - 3 {
let entry: Entry = file.entries[idx].clone();
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: While you are at it, this cloning seems completely unnecessary (we can just pass &file.entries[idx] below).

@KolbyML KolbyML force-pushed the fix-bug-in-era-implementation branch from a1483c2 to 716f281 Compare August 13, 2024 06:12
@KolbyML KolbyML merged commit a9bdfd3 into ethereum:master Aug 13, 2024
8 checks passed
@KolbyML KolbyML deleted the fix-bug-in-era-implementation branch January 22, 2025 07:52
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.

2 participants