feat: add automatic DA retriever walkback when P2P stalls and DA blocks too far ahead#3262
feat: add automatic DA retriever walkback when P2P stalls and DA blocks too far ahead#3262julienrbrt wants to merge 7 commits intomainfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @julienrbrt's task in 3m 26s —— View job Code Review — feat: add automatic DA retriever walkback when P2P stallsSummary: The PR introduces a walkback mechanism so that when P2P stalls and the DA follower has already advanced well past the node's current height, the DA subscriber rewinds to re-fetch earlier DA heights. The core idea is sound, but there are several correctness bugs and architectural concerns worth addressing before merge. Critical Issues1. Potential nil-pointer panic on data-only DA events
// syncer.go:551-557
minHeight := events[0].Header.Height() // ← panics if Header == nil
for _, e := range events[1:] {
if e.Header.Height() < minHeight {
minHeight = e.Header.Height()
}
}Fix: skip events with a nil 2. Infinite rewind loop when walkback reaches the DA floor
The syncer would spin at the floor, never progressing and spamming logs. Fix: clear 3. Duplicate event processing after walkback When This needs either: idempotent event piping confirmation (cite the deduplication path), or the walkback must only rewind without re-piping the already-processed height. Significant Issues4. Unused Added in 5. Walkback log fires on every step — extremely verbose The 6. Leaky abstraction: events bubbled up through The 7.
events, err := follower.HandleCatchup(t.Context(), s.daHeight)
// ...
_ = events // ← return value completely ignoredThe signature change is the whole point of this PR; the test should assert that returned events match the events emitted by the mock retriever. Minor Issues8.
9.
10. One-at-a-time walkback performance Each walkback step rewinds exactly one DA height. For large gaps this triggers Test Coverage AssessmentThe new
SummaryThe PR's author note ("I do not like what the LLM has produced") is well-founded. The core concept is valid but the current implementation has correctness issues (#1, #2, #3) that need fixing before this is production-safe. I'd recommend:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3262 +/- ##
==========================================
+ Coverage 61.84% 61.87% +0.03%
==========================================
Files 122 122
Lines 16241 16299 +58
==========================================
+ Hits 10044 10085 +41
- Misses 5312 5325 +13
- Partials 885 889 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Overview
Add automatic DA retriever walkback when P2P stalls and DA blocks too far ahead
Early WIP, i do not like what the LLM has produced.