diff --git a/core/chains/evm/txmgr/builder.go b/core/chains/evm/txmgr/builder.go index f31e5026cae..480b17bb7d4 100644 --- a/core/chains/evm/txmgr/builder.go +++ b/core/chains/evm/txmgr/builder.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore" ) -var blockTime time.Duration = 2 * time.Second +var blockTime time.Duration = 12 * time.Second func NewOptimisticTxm( db *sqlx.DB, diff --git a/core/chains/evm/txmgr/optimistictxm/broadcaster.go b/core/chains/evm/txmgr/optimistictxm/broadcaster.go index 0c9c4b5da0c..f72dbf581b7 100644 --- a/core/chains/evm/txmgr/optimistictxm/broadcaster.go +++ b/core/chains/evm/txmgr/optimistictxm/broadcaster.go @@ -328,6 +328,10 @@ func (b *Broadcaster) handleInProgressTx(ctx context.Context, tx Tx) error { return fmt.Errorf("error while sending transaction %s (tx ID %d): %w", attempt.Hash.String(), tx.ID, err) } err = b.client.SendTransaction(ctx, signedTx) + timeStamp := time.Now() + tx.InitialBroadcastAt = &timeStamp + tx.BroadcastAt = &timeStamp + lgr.Infow("Sent transaction", "tx", tx.PrettyPrint(), "attempt", attempt.PrettyPrint(), "error", err) if err != nil { @@ -342,10 +346,6 @@ func (b *Broadcaster) handleInProgressTx(ctx context.Context, tx Tx) error { } } - timeStamp := time.Now() - tx.InitialBroadcastAt = &timeStamp - tx.BroadcastAt = &timeStamp - err = b.txStore.UpdateTxInProgressToUnconfirmed(ctx, &tx) if err != nil { return err diff --git a/core/chains/evm/txmgr/optimistictxm/resender.go b/core/chains/evm/txmgr/optimistictxm/resender.go index 0cc28605f0b..cd6c0786225 100644 --- a/core/chains/evm/txmgr/optimistictxm/resender.go +++ b/core/chains/evm/txmgr/optimistictxm/resender.go @@ -179,7 +179,7 @@ func (r *Resender) bumpAttempt(ctx context.Context, tx Tx, marketAttempt TxAttem var err error bumpedAttempt := marketAttempt - bumpingCycles := int(time.Since(*tx.BroadcastAt) / r.config.BumpAfterThreshold / time.Nanosecond) + bumpingCycles := int(time.Since(*tx.InitialBroadcastAt) / r.config.BumpAfterThreshold / time.Nanosecond) bumpingCycles = min(bumpingCycles, r.config.MaxBumpCycles) // Don't bump more than MaxBumpCycles var i int @@ -257,7 +257,7 @@ func batchSendTransactions( if err := client.BatchCallContextAll(ctx, reqs[i:j]); err != nil { return broadcastTime, successfulBroadcastIDs, fmt.Errorf("failed to batch send transactions: %w", err) } - lggr.Debugw("Batch requests", reqs) + lggr.Debug("Batch requests", reqs) for k, req := range reqs[i:j] { lggr.Debugw("Batch tx", "result", req.Result, "error", req.Error) if req.Result.(*common.Hash).String() == attempts[k+i].Hash.String() {