Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/chains/legacyevm/evm_txm.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func newEvmTxm(
logPoller,
opts.KeyStore,
estimator,
cfg.GasEstimator().LimitTransfer(),
cfg.GasEstimator(),
)
if cfg.Transactions().TransactionManagerV2().DualBroadcast() == nil || !*cfg.Transactions().TransactionManagerV2().DualBroadcast() {
return txmv2, err
Expand Down
29 changes: 22 additions & 7 deletions pkg/txm/attempt_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,30 @@ func (a *attemptBuilder) NewAgnosticBumpAttempt(ctx context.Context, lggr logger
if err != nil {
return nil, err
}
bumps := min(maxBumpThreshold, tx.AttemptCount)
for range bumps {
bumpedAttempt, err := a.NewBumpAttempt(ctx, lggr, tx, *attempt)
if err != nil {
lggr.Errorf("error bumping attempt: %v for txID: %v", err, tx.ID)
return attempt, nil

// bump purge attempts
if tx.IsPurgeable {
for {
// TODO: add better handling
bumpedAttempt, err := a.NewBumpAttempt(ctx, lggr, tx, *attempt)
if err != nil {
return attempt, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we select for that specific error so we reduce possibility of halting on a different error?

}
attempt = bumpedAttempt
}
} else {
// bump regular attempts
bumps := min(maxBumpThreshold, tx.AttemptCount)
for range bumps {
bumpedAttempt, err := a.NewBumpAttempt(ctx, lggr, tx, *attempt)
if err != nil {
lggr.Errorf("error bumping attempt: %v for txID: %v", err, tx.ID)
return attempt, nil
}
attempt = bumpedAttempt
}
attempt = bumpedAttempt
}

return attempt, nil
}

Expand Down
12 changes: 9 additions & 3 deletions pkg/txmgr/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package txmgr

import (
"context"
"errors"
"fmt"
"math/big"
"time"
Expand Down Expand Up @@ -113,7 +114,7 @@ func NewTxmV2(
logPoller logpoller.LogPoller,
keyStore keys.ChainStore,
estimator gas.EvmFeeEstimator,
emptyTxLimitDefault uint64,
gasEstimatorConfig config.GasEstimator,
) (TxManager, error) {
var fwdMgr *forwarders.FwdMgr
if txConfig.ForwardersEnabled() {
Expand All @@ -138,14 +139,19 @@ func NewTxmV2(
stuckTxDetector = txm.NewStuckTxDetector(lggr, chainConfig.ChainType(), stuckTxDetectorConfig)
}

attemptBuilder := txm.NewAttemptBuilder(fCfg.PriceMaxKey, estimator, keyStore, emptyTxLimitDefault)
// TODO: temporary check until we implement the required methods on the estimator interface
if gasEstimatorConfig.Mode() != "BlockHistory" || gasEstimatorConfig.BlockHistory().CheckInclusionBlocks() == 0 {
return nil, errors.New("only BlockHistory mode with CheckInclusionBlocks > 0 is supported for TXMv2")
}

attemptBuilder := txm.NewAttemptBuilder(fCfg.PriceMaxKey, estimator, keyStore, gasEstimatorConfig.LimitTransfer())
inMemoryStoreManager := storage.NewInMemoryStoreManager(lggr, chainID)
config := txm.Config{
EIP1559: fCfg.EIP1559DynamicFees(),
BlockTime: *txmV2Config.BlockTime(),
//nolint:gosec // reuse existing config until migration
RetryBlockThreshold: uint16(fCfg.BumpThreshold()),
EmptyTxLimitDefault: emptyTxLimitDefault,
EmptyTxLimitDefault: gasEstimatorConfig.LimitTransfer(),
}
var eh txm.ErrorHandler
var c txm.Client
Expand Down
Loading