Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions block/internal/cache/pending_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down
17 changes: 6 additions & 11 deletions block/internal/cache/pending_headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down