Backport giga-1: Retain Autobahn lane last block across prune - #4210
Conversation
## Summary - After a CommitQC drains `[first, next)`, keep the last local lane proposal so the next produced/pushed block still names a real parent instead of the zero hash (which stalled the lane). - Persist that last block when it has left the active range and has not been flushed, restore it from the WAL on restart, and never rewind `nextBlockToPersist`. - Jump-prune (Anchor `Next` past the local tip / empty-range zero `LastHash`) is left as a TODO; this change only covers last-seen local production. ## Test plan - [x] `GOWORK=off go test ./sei-tendermint/internal/autobahn/avail/ -count=1` Made with [Cursor](https://cursor.com) (cherry picked from commit 36bcce7)
PR SummaryMedium Risk Overview Per-lane block storage is a new
Reviewed by Cursor Bugbot for commit 1cdaf8e. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## giga-1 #4210 +/- ##
==========================================
- Coverage 65.55% 65.51% -0.04%
==========================================
Files 2081 2076 -5
Lines 157460 156930 -530
==========================================
- Hits 103222 102813 -409
+ Misses 54097 53976 -121
Partials 141 141
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Faithful backport of merged PR #4199 (identical per-file stats); the retained-last logic, WAL retention floor, and persistence-cursor changes all hold up under tracing, including the persistBlock sequence check and RecvBatch cursor monotonicity. One non-blocking comment issue: the rewritten comment in PushBlock deletes the invariant that justified skipping the parent-hash check after prune.
Findings: 0 blocking | 1 non-blocking | 1 posted inline
Blockers
- None at the file/PR level.
Non-blocking
- None at the file/PR level.
- 1 suggestion(s)/nit(s) flagged inline on specific lines.
Inline comments (could not post inline; listed here)
sei-tendermint/internal/autobahn/avail/state.go:470(RIGHT) -- [suggestion] The replacement comment restates the condition (first < next) but drops the invariant that makes skipping the check safe: the old NOTE recorded thatheaders()never follows the first block'sparentHashwithin aLaneRange. That is still true (headers()at state.go:536 seedswantfromlr.LastHash()and walks back only tolr.First()), and it is the reason an unverifiable parent below the anchor cannot deadlock header reconstruction. AGENTS.md is explicit that relocating a load-bearing invariant is the move, never deleting it to tidy up — please keep that sentence here (or move it to theheaders()godoc and point at it).
The same applies to the comment replaced in restoreBlocks (inner.go:146): the dropped rationale that the WAL prunes lazily on disk, so blocks below the anchor are expected on startup, is exactly what the new b.Number < q.next branch depends on.
Backport of #4199 to
giga-1.