Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat: update code
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed May 3, 2024
1 parent 65122f9 commit 89acb3a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions proposer/proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,12 @@ func (p *Proposer) ProposeOp(ctx context.Context) error {
g, gCtx := errgroup.WithContext(ctx)
// Propose all L2 transactions lists.
for _, txs := range txLists[:utils.Min(p.MaxProposedTxListsPerEpoch, uint64(len(txLists)-1))] {
var nonce uint64
nonce, err = p.rpc.L1.PendingNonceAt(ctx, p.proposerAddress)
nonce, err := p.rpc.L1.PendingNonceAt(ctx, p.proposerAddress)
if err != nil {
err = fmt.Errorf("failed to get proposer nonce: %w", err)
log.Error("Failed to get proposer nonce", "error", err)
break
}

txs := txs
g.Go(func() error {
txListBytes, err := rlp.EncodeToBytes(txs)
if err != nil {
Expand All @@ -324,11 +322,11 @@ func (p *Proposer) ProposeOp(ctx context.Context) error {
log.Error("Failed to wait for new pending transaction", "error", err)
}
}
if gErr := g.Wait(); gErr != nil {
return gErr
if err := g.Wait(); err != nil {
return err
}

return err
return nil
}

// ProposeTxList proposes the given transactions list to TaikoL1 smart contract.
Expand Down

0 comments on commit 89acb3a

Please sign in to comment.