Skip to content

Commit 58d5643

Browse files
refactor submitter
1 parent 0bda17f commit 58d5643

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

block/submitter.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,13 @@ func (m *Manager) createSignedDataFromBatch(batch *coresequencer.Batch) (*types.
199199
func (m *Manager) submitDataToDA(ctx context.Context, signedData *types.SignedData) error {
200200
var backoff time.Duration
201201
attempt := 0
202-
submitted := false
203202

204203
// Store initial values to be able to reset or compare later
205204
initialGasPrice := m.gasPrice
206205
gasPrice := initialGasPrice
207206

208207
daSubmitRetryLoop:
209-
for !submitted && attempt < maxSubmitAttempts {
208+
for attempt < maxSubmitAttempts {
210209
// Wait for backoff duration or exit if context is done
211210
select {
212211
case <-ctx.Done():
@@ -234,8 +233,6 @@ daSubmitRetryLoop:
234233
"gasPrice", gasPrice,
235234
"height", res.Height)
236235

237-
submitted = true
238-
239236
// Reset submission parameters after success
240237
backoff = 0
241238

@@ -274,11 +271,5 @@ daSubmitRetryLoop:
274271
}
275272

276273
// Return error if not all transactions were submitted after all attempts
277-
if !submitted {
278-
return fmt.Errorf(
279-
"failed to submit data to DA layer after %d attempts",
280-
attempt,
281-
)
282-
}
283-
return nil
274+
return fmt.Errorf("failed to submit data to DA layer after %d attempts", attempt)
284275
}

node/full.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ func (n *FullNode) Run(parentCtx context.Context) error {
381381
spawnWorker(func() { n.blockManager.AggregationLoop(ctx, errCh) })
382382
spawnWorker(func() { n.reaper.Start(ctx) })
383383
spawnWorker(func() { n.blockManager.HeaderSubmissionLoop(ctx) })
384-
spawnWorker(func() { n.blockManager.BatchSubmissionLoop(ctx) })
384+
spawnWorker(func() { n.blockManager.DataSubmissionLoop(ctx) })
385385
spawnWorker(func() { n.blockManager.DAIncluderLoop(ctx, errCh) })
386386
} else {
387387
spawnWorker(func() { n.blockManager.RetrieveLoop(ctx) })

0 commit comments

Comments
 (0)