Skip to content

Conversation

@VolodymyrBg
Copy link
Contributor

Replace TruncateTail(0) with TruncateHead(0) in basicWrite. TruncateTail only advances the tail (prunes prunable tables) and does not reset the head/items count, so it does not “truncate everything.” Using TruncateHead(0) properly clears the ancient store to an empty state, allowing re-appending from index 0 and aligning with existing tests and the documented semantics in ethdb.

@rjl493456442
Copy link
Member

Thanks for catching it.

Can you please also add the error handling around all op.AppendRaw? Just realize that
the error is silently ignored and it's the reason why the test can still pass.

@VolodymyrBg
Copy link
Contributor Author

Thanks for catching it.

Can you please also add the error handling around all op.AppendRaw? Just realize that the error is silently ignored and it's the reason why the test can still pass.

Done

@rjl493456442 rjl493456442 added this to the 1.16.4 milestone Sep 9, 2025
@rjl493456442 rjl493456442 changed the title core/rawdb: use TruncateHead(0) to truly reset before re-appending core/rawdb: improve the test suite for ancient store Sep 9, 2025
@rjl493456442 rjl493456442 merged commit 5035064 into ethereum:master Sep 9, 2025
6 of 7 checks passed
Sahil-4555 pushed a commit to Sahil-4555/go-ethereum that referenced this pull request Oct 12, 2025
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