Skip to content

Commit

Permalink
Updates for Sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
dimriou committed Feb 13, 2024
1 parent afcad0f commit 4774965
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/chains/evm/txmgr/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions core/chains/evm/txmgr/optimistictxm/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions core/chains/evm/txmgr/optimistictxm/resender.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 4774965

Please sign in to comment.