Skip to content

Commit

Permalink
adds a todo
Browse files Browse the repository at this point in the history
  • Loading branch information
danwt committed May 8, 2024
1 parent 9b1f638 commit 43f02c5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions block/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,17 @@ type Manager struct {

// For aggregator: tracks the last height which was sent to SL and DA
// For non-aggregator: tracks the last height which is available on SL, and should be fetched
SyncTargetHeight atomic.Uint64
AccumulatedBatchSize atomic.Uint64
SyncTargetHeight atomic.Uint64
// For aggregator: the size of the batch that is being accumulated.
// It is set to 0 after SyncTargetHeight increases.
AccumulatedBatchSize uint64
/*
TODO(danwt): Where was I at?
1) SyncTarget height is a non concurrent variable on the aggregator, should be treated as such
2) the accumulated batch size is probably error prone because it doesnt stay in sync with the actual batch submissions
We should unify the approach and just have a list of heights on the submitter, which will be cleared as size needs dictate
*/
AccumulatedBatchSizeMu sync.Mutex // mutex to keep accumulated batch size in sync with SyncTargetHeight

// Block production
producedSizeCh chan uint64 // channel for the producer to report the size of the block it produced
Expand Down

0 comments on commit 43f02c5

Please sign in to comment.