From a30110f341a25907a77b6f99e19885c029704f0b Mon Sep 17 00:00:00 2001 From: yashnevatia Date: Fri, 9 Jan 2026 15:45:26 +0000 Subject: [PATCH 1/2] Adding MaxGasPrice to Tx and TxRequest --- chains/txmgr/types/tx.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chains/txmgr/types/tx.go b/chains/txmgr/types/tx.go index 98e39e8..d8e24b3 100644 --- a/chains/txmgr/types/tx.go +++ b/chains/txmgr/types/tx.go @@ -78,6 +78,7 @@ type TxRequest[ADDR chains.Hashable, TX_HASH chains.Hashable] struct { EncodedPayload []byte Value big.Int FeeLimit uint64 + MaxGasPrice *big.Int Meta *TxMeta[ADDR, TX_HASH] ForwarderAddress ADDR @@ -208,8 +209,9 @@ type Tx[ Value big.Int // FeeLimit on the Tx is always the conceptual gas limit, which is not // necessarily the same as the on-chain encoded value (i.e. Optimism) - FeeLimit uint64 - Error null.String + FeeLimit uint64 + MaxGasPrice *big.Int + Error null.String // BroadcastAt is updated every time an attempt for this tx is re-sent // In almost all cases it will be within a second or so of the actual send time. BroadcastAt *time.Time From 907ef99f2a14dc960ef375db7fc84c94f171471d Mon Sep 17 00:00:00 2001 From: yashnevatia Date: Wed, 14 Jan 2026 13:36:25 +0000 Subject: [PATCH 2/2] log --- chains/txmgr/broadcaster.go | 5 +++++ chains/txmgr/txmgr.go | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/chains/txmgr/broadcaster.go b/chains/txmgr/broadcaster.go index 305cccf..3152c90 100644 --- a/chains/txmgr/broadcaster.go +++ b/chains/txmgr/broadcaster.go @@ -407,6 +407,11 @@ func (eb *Broadcaster[CID, HEAD, ADDR, THASH, BHASH, SEQ, FEE]) handleUnstartedT return fmt.Errorf("invariant violation: expected transaction %v to be unstarted, it was %s", etx.ID, etx.State), false } + eb.lggr.Infow("DEBUG handleUnstartedTx loaded from DB", + "txID", etx.ID, + "maxGasPrice", etx.MaxGasPrice, + "maxGasPriceIsNil", etx.MaxGasPrice == nil) + attempt, _, _, retryable, err := eb.NewTxAttempt(ctx, *etx, eb.lggr) // Mark transaction as fatal if provided gas limit is set too low if errors.Is(err, fees.ErrFeeLimitTooLow) { diff --git a/chains/txmgr/txmgr.go b/chains/txmgr/txmgr.go index 4a398cd..73e83cb 100644 --- a/chains/txmgr/txmgr.go +++ b/chains/txmgr/txmgr.go @@ -538,6 +538,11 @@ func (b *Txm[CID, HEAD, ADDR, THASH, BHASH, R, SEQ, FEE]) Trigger(addr ADDR) { // CreateTransaction inserts a new transaction func (b *Txm[CID, HEAD, ADDR, THASH, BHASH, R, SEQ, FEE]) CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, THASH]) (tx txmgrtypes.Tx[CID, ADDR, THASH, BHASH, SEQ, FEE], err error) { + b.logger.Infow("DEBUG CreateTransaction entry", + "txRequest.MaxGasPrice", txRequest.MaxGasPrice, + "maxGasPriceIsNil", txRequest.MaxGasPrice == nil, + "idempotencyKey", txRequest.IdempotencyKey) + // Check for existing Tx with IdempotencyKey. If found, return the Tx and do nothing // Skipping CreateTransaction to avoid double send if b.txmv2wrapper != nil && txRequest.Meta != nil && txRequest.Meta.DualBroadcast != nil && *txRequest.Meta.DualBroadcast { @@ -903,10 +908,20 @@ func (b *Txm[CID, HEAD, ADDR, THASH, BHASH, R, SEQ, FEE]) pruneQueueAndCreateTxn ) } + b.logger.Infow("DEBUG pruneQueueAndCreateTxn BEFORE CreateTransaction", + "txRequest.MaxGasPrice", txRequest.MaxGasPrice, + "maxGasPriceIsNil", txRequest.MaxGasPrice == nil) + tx, err = b.txStore.CreateTransaction(ctx, txRequest, chainID) if err != nil { return tx, err } + + b.logger.Infow("DEBUG pruneQueueAndCreateTxn AFTER CreateTransaction", + "tx.ID", tx.ID, + "tx.MaxGasPrice", tx.MaxGasPrice, + "maxGasPriceIsNil", tx.MaxGasPrice == nil) + b.logger.Debugw("Created transaction", "fromAddress", txRequest.FromAddress, "toAddress", txRequest.ToAddress,