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, 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