Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions chains/txmgr/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
15 changes: 15 additions & 0 deletions chains/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions chains/txmgr/types/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Loading