From 2eb1520241c5f506a35b8c45440f6d44631fa303 Mon Sep 17 00:00:00 2001 From: holmeschina Date: Sun, 6 Dec 2026 09:28:20 +0800 Subject: [PATCH] docs(cache): clarify partial DA submissions Signed-off-by: holmeschina --- block/internal/cache/pending_data.go | 18 ++++++------------ block/internal/cache/pending_headers.go | 17 ++++++----------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/block/internal/cache/pending_data.go b/block/internal/cache/pending_data.go index b29b9f0490..4c948733fe 100644 --- a/block/internal/cache/pending_data.go +++ b/block/internal/cache/pending_data.go @@ -14,18 +14,12 @@ import ( // LastSubmittedDataHeightKey is the key used for persisting the last submitted data height in store. const LastSubmittedDataHeightKey = "last-submitted-data-height" -// PendingData maintains Data that need to be published to DA layer -// -// Important assertions: -// - data is safely stored in database before submission to DA -// - data is always pushed to DA in order (by height) -// - DA submission of multiple data is atomic - it's impossible to submit only part of a batch -// -// lastSubmittedDataHeight is updated only after receiving confirmation from DA. -// Worst case scenario is when data was successfully submitted to DA, but confirmation was not received (e.g. node was -// restarted, networking issue occurred). In this case data is re-submitted to DA (it's extra cost). -// evolve is able to skip duplicate data so this shouldn't affect full nodes. -// Note: Submission of pending data to DA should account for the DA max blob size. +// PendingData tracks stored block data awaiting publication to the DA layer. +// The submitter sends non-empty data in height order in size-limited batches. +// It advances the cursor through the prefix a DA response reports as +// submitted, which can be shorter than the batch. The cursor can also skip +// empty blocks, blocks from other proposers, or heights already included in DA. +// If a response is lost, the same data may be submitted again. type PendingData struct { base *pendingBase[*types.Data] } diff --git a/block/internal/cache/pending_headers.go b/block/internal/cache/pending_headers.go index d5e570c118..ff087a05de 100644 --- a/block/internal/cache/pending_headers.go +++ b/block/internal/cache/pending_headers.go @@ -11,17 +11,12 @@ import ( "github.com/evstack/ev-node/types" ) -// PendingHeaders maintains headers that need to be published to DA layer -// -// Important assertions: -// - headers are safely stored in database before submission to DA -// - headers are always pushed to DA in order (by height) -// - DA submission of multiple headers is atomic - it's impossible to submit only part of a batch -// -// lastSubmittedHeaderHeight is updated only after receiving confirmation from DA. -// Worst case scenario is when headers were successfully submitted to DA, but confirmation was not received (e.g. node was -// restarted, networking issue occurred). In this case headers are re-submitted to DA (it's extra cost). -// evolve is able to skip duplicate headers so this shouldn't affect full nodes. +// PendingHeaders tracks stored headers awaiting publication to the DA layer. +// The submitter sends headers in height order in size-limited batches. It +// advances the cursor through the prefix a DA response reports as submitted, +// which can be shorter than the batch. The cursor can also skip headers from +// other proposers or heights already included in DA. +// If a response is lost, the same headers may be submitted again. type PendingHeaders struct { base *pendingBase[*types.SignedHeader] }