diff --git a/op-service/txmgr/txmgr.go b/op-service/txmgr/txmgr.go index c10165b341a3..8b493fb54297 100644 --- a/op-service/txmgr/txmgr.go +++ b/op-service/txmgr/txmgr.go @@ -108,8 +108,6 @@ type ETHBackend interface { // EstimateGas returns an estimate of the amount of gas needed to execute the given // transaction against the current pending block. EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error) - // CreateAccessList returns an estimate of the AccessList - CreateAccessList(ctx context.Context, msg ethereum.CallMsg) (*types.AccessList, uint64, string, error) // Close the underlying eth connection Close() } @@ -266,21 +264,18 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (* gasLimit := candidate.GasLimit - callArgs := ethereum.CallMsg{ - From: m.cfg.From, - To: candidate.To, - GasTipCap: gasTipCap, - GasFeeCap: gasFeeCap, - Data: candidate.TxData, - Value: candidate.Value, - } - - accessList, _, _, err := m.backend.CreateAccessList(ctx, callArgs) - if err != nil { - return nil, err - } // If the gas limit is set, we can use that as the gas if gasLimit == 0 { + callArgs := ethereum.CallMsg{ + From: m.cfg.From, + To: candidate.To, + GasTipCap: gasTipCap, + GasFeeCap: gasFeeCap, + Data: candidate.TxData, + Value: candidate.Value, + AccessList: candidate.AccessList, + } + for _, blob := range candidate.Blobs { commitment, err := blob.ComputeKZGCommitment() if err != nil { @@ -324,7 +319,7 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (* Gas: gasLimit, BlobHashes: blobHashes, Sidecar: sidecar, - AccessList: *accessList, + AccessList: candidate.AccessList, } if err := finishBlobTx(message, m.chainID, gasTipCap, gasFeeCap, blobFeeCap, candidate.Value); err != nil { return nil, fmt.Errorf("failed to create blob transaction: %w", err) @@ -339,7 +334,7 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (* Value: candidate.Value, Data: candidate.TxData, Gas: gasLimit, - AccessList: *accessList, + AccessList: candidate.AccessList, } } return m.signWithNextNonce(ctx, txMessage) // signer sets the nonce field of the tx