Skip to content

Commit 8f84332

Browse files
fix(tx_pool_latency_analysis): remove unnecessary retry logic and handle transaction send failure more gracefully
1 parent ec6739a commit 8f84332

File tree

1 file changed

+2
-14
lines changed
  • pkg/coordinator/tasks/tx_pool_latency_analysis

1 file changed

+2
-14
lines changed

pkg/coordinator/tasks/tx_pool_latency_analysis/task.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ func (t *Task) Execute(ctx context.Context) error {
114114
var latencies []time.Duration
115115

116116
var txs []*ethtypes.Transaction
117-
retryCount := 0
118117

119118
for i := 0; i < t.config.TxCount; i++ {
120119
tx, err := t.generateTransaction(ctx)
@@ -127,24 +126,13 @@ func (t *Task) Execute(ctx context.Context) error {
127126
startTx := time.Now()
128127

129128
err = client.GetRPCClient().SendTransaction(ctx, tx)
130-
131129
if err != nil {
132130
t.logger.Errorf("Failed to send transaction: %v. Nonce: %d. ", err, tx.Nonce())
133-
134-
i--
135-
retryCount++
136-
137-
if retryCount > 1000 {
138-
t.logger.Errorf("Too many retries")
139-
t.ctx.SetResult(types.TaskResultFailure)
140-
return nil
141-
}
142-
143-
continue
131+
t.ctx.SetResult(types.TaskResultFailure)
132+
return nil
144133
}
145134

146135
txs = append(txs, tx)
147-
retryCount = 0
148136

149137
// Create a context with timeout for reading transaction messages
150138
readCtx, cancel := context.WithTimeout(ctx, 10*time.Second)

0 commit comments

Comments
 (0)