Skip to content

Use MaxUint64 as return value to HistoryStartFrom() if no files present#17308

Merged
antonis19 merged 7 commits into
mainfrom
fix-history-start-from
Oct 2, 2025
Merged

Use MaxUint64 as return value to HistoryStartFrom() if no files present#17308
antonis19 merged 7 commits into
mainfrom
fix-history-start-from

Conversation

@antonis19

@antonis19 antonis19 commented Oct 1, 2025

Copy link
Copy Markdown
Contributor

Currently default return value of 0 leads to PrunedError not being thrown when commitment history is not available when eth_getProof is invoked. This leads to incorrect root hash error, but instead a PrunedError should be thrown.

A default value of +∞ is more appropriate, and fixes #16776 as well.

UPDATE: It could happen that there are no history files, but there is history in MDBX, so the function is now updated to look into MDBX for the first txnum if there are history files in snapshots.

@antonis19 antonis19 changed the title use MaxUint64 as return value to HistoryStartFrom() if no files present Use MaxUint64 as return value to HistoryStartFrom() if no files present Oct 1, 2025
Comment thread db/state/aggregator.go Outdated
Comment thread db/state/domain.go Outdated
Comment thread db/state/domain.go Outdated
Comment thread db/kv/temporal/kv_temporal.go

@sudeepdino008 sudeepdino008 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm apart from 1 comment

@antonis19 antonis19 enabled auto-merge (squash) October 1, 2025 17:43
Comment thread db/state/history.go Outdated
Comment thread db/state/history.go Outdated
@antonis19 antonis19 merged commit cc428cb into main Oct 2, 2025
17 of 18 checks passed
@antonis19 antonis19 deleted the fix-history-start-from branch October 2, 2025 13:19
@mriccobene

Copy link
Copy Markdown
Member

The RPC tests are broken in this PR

antonis19 added a commit that referenced this pull request Oct 2, 2025
@awskii awskii mentioned this pull request Oct 2, 2025
15 tasks
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.

eth_getProof: nil-ptr when block not found

5 participants