Skip to content

fix(store): Properly prune extended commits - #5276

Merged
aljo242 merged 3 commits into
mainfrom
jasmina/pruning_ec_fix
Aug 29, 2025
Merged

aljo242 merged 3 commits into
mainfrom
jasmina/pruning_ec_fix

Conversation

@jmalicevic

@jmalicevic jmalicevic commented Jul 25, 2025 •

Copy link
Copy Markdown
Collaborator

Closes #5275

This should be back ported all the way to 0.38. Note that in v1 and 0.38 there is no blockCommitCache so that part should be left out. 

PR checklist

  • Tests written/updated
  • [ x] Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

@jmalicevic
jmalicevic requested review from a team as code owners July 25, 2025 07:41
@jmalicevic jmalicevic changed the title fix:(store) Properly prune extended commits fix (store): Properly prune extended commits Jul 25, 2025
@jmalicevic jmalicevic changed the title fix (store): Properly prune extended commits fix(store): Properly prune extended commits Jul 25, 2025
@aljo242 aljo242 added backport-to-v0.38.x Tell Mergify to backport the PR to v0.38.x backport-to-v1.x labels Aug 26, 2025
@aljo242
aljo242 enabled auto-merge (squash) August 29, 2025 20:08
@aljo242
aljo242 disabled auto-merge August 29, 2025 20:08
@aljo242
aljo242 merged commit ca44468 into main Aug 29, 2025
@aljo242
aljo242 deleted the jasmina/pruning_ec_fix branch August 29, 2025 20:08
mergify Bot pushed a commit that referenced this pull request Aug 29, 2025
Closes #5275

This should be back ported all the way to 0.38. Note that in v1 and 0.38
there is no blockCommitCache so that part should be left out.
---

#### PR checklist

- [ ] Tests written/updated
- [ x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments

---------

Co-authored-by: jmalicevic <[email protected]>
(cherry picked from commit ca44468)

# Conflicts:
#	.changelog/v1.0.1/bug-fixes/5275-pruning-ext-commit-fix.md
mergify Bot pushed a commit that referenced this pull request Aug 29, 2025
Closes #5275

This should be back ported all the way to 0.38. Note that in v1 and 0.38
there is no blockCommitCache so that part should be left out.
---

#### PR checklist

- [ ] Tests written/updated
- [ x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments

---------

Co-authored-by: jmalicevic <[email protected]>
(cherry picked from commit ca44468)

# Conflicts:
#	store/store.go
#	store/store_test.go
mergify Bot pushed a commit that referenced this pull request Aug 29, 2025
Closes #5275

This should be back ported all the way to 0.38. Note that in v1 and 0.38
there is no blockCommitCache so that part should be left out.
---

#### PR checklist

- [ ] Tests written/updated
- [ x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments

---------

Co-authored-by: jmalicevic <[email protected]>
(cherry picked from commit ca44468)
aljo242 added a commit that referenced this pull request Sep 1, 2025
Closes #5275 


This should be back ported all the way to 0.38. Note that in v1 and 0.38
there is no blockCommitCache so that part should be left out.
---

#### PR checklist

- [ ] Tests written/updated
- [ x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments
<hr>This is an automatic backport of pull request #5276 done by
[Mergify](https://mergify.com).

---------

Co-authored-by: Jasmina Malicevic <[email protected]>
Co-authored-by: aljo242 <[email protected]>
tqin7 pushed a commit to dydxprotocol/cometbft that referenced this pull request Oct 14, 2025
…ometbft#5313)

Closes cometbft#5275 


This should be back ported all the way to 0.38. Note that in v1 and 0.38
there is no blockCommitCache so that part should be left out.
---

#### PR checklist

- [ ] Tests written/updated
- [ x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments
<hr>This is an automatic backport of pull request cometbft#5276 done by
[Mergify](https://mergify.com).

---------

Co-authored-by: Jasmina Malicevic <[email protected]>
Co-authored-by: aljo242 <[email protected]>
beer-1 pushed a commit to initia-labs/cometbft that referenced this pull request Oct 15, 2025
…ometbft#5313)

Closes cometbft#5275 


This should be back ported all the way to 0.38. Note that in v1 and 0.38
there is no blockCommitCache so that part should be left out.
---

#### PR checklist

- [ ] Tests written/updated
- [ x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments
<hr>This is an automatic backport of pull request cometbft#5276 done by
[Mergify](https://mergify.com).

---------

Co-authored-by: Jasmina Malicevic <[email protected]>
Co-authored-by: aljo242 <[email protected]>
rootulp added a commit to celestiaorg/celestia-core that referenced this pull request Jun 2, 2026
## Overview

`BlockStore.PruneBlocks` deleted block meta, hash, commit, seen-commit,
and part keys, but **never deleted the extended-commit key**
(`calcExtCommitKey`) nor evicted `blockExtendedCommitCache`. Extended
commits (vote-extension data) were therefore written but never pruned,
causing **unbounded storage growth** on nodes that use vote extensions.

This deletes the extended commit alongside the block commit — gated on
the same evidence-retention point (`h < evidencePoint`) so evidence data
is preserved — and evicts the LRU cache entry to keep the cache
consistent with the DB.

## Testing

Extended `TestPruneBlocks` to assert that the extended commit is
retained for heights within the evidence window and pruned for heights
below it. Verified the assertions fail before the fix (extended commit
for the pruned height was still loadable) and pass after.

## Notes

Backport of upstream
[cometbft/cometbft#5276](cometbft/cometbft#5276)
(shipped in v0.38.19). Surfaced by the upstream-audit issue.

Closes PROTOCO-1868

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v0.38.x Tell Mergify to backport the PR to v0.38.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(store/pruning): Pruner does not prune commits with vote extensions

3 participants