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

Commit

Permalink
feat(proposer): fix an issue in ProposeTxLists (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Apr 26, 2024
1 parent d2f88a1 commit 150217c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions proposer/proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,12 @@ func (p *Proposer) ProposeOp(ctx context.Context) error {

// ProposeTxLists proposes the given transaction lists to TaikoL1 contract.
func (p *Proposer) ProposeTxLists(ctx context.Context, txListsBytes [][]byte) []error {
txCandidates := make([]txmgr.TxCandidate, len(txListsBytes))
txCandidates := make([]txmgr.TxCandidate, 0)

for i, txListBytes := range txListsBytes {
compressedTxListBytes, err := utils.Compress(txListBytes)
if err != nil {
log.Warn("Failed to compress transactions list", "index", i, "error", err)
log.Error("Failed to compress transactions list", "index", i, "error", err)
break
}

Expand All @@ -356,11 +356,15 @@ func (p *Proposer) ProposeTxLists(ctx context.Context, txListsBytes [][]byte) []
compressedTxListBytes,
)
if err != nil {
log.Warn("Failed to build TaikoL1.proposeBlock transaction", "error", err)
log.Error("Failed to build TaikoL1.proposeBlock transaction", "error", err)
break
}

txCandidates[i] = *candidate
txCandidates = append(txCandidates, *candidate)
}

if len(txCandidates) == 0 {
return []error{}
}

// Send the transactions to the TaikoL1 contract, and if any of them fails, try
Expand Down

0 comments on commit 150217c

Please sign in to comment.