Skip to content

Commit

Permalink
Revert "feat(txmgr): call CreateAccessList (#9)"
Browse files Browse the repository at this point in the history
This reverts commit 6873eca.
  • Loading branch information
YoGhurt111 committed Jun 27, 2024
1 parent 0789e68 commit 7bdca6a
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions op-service/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 7bdca6a

Please sign in to comment.