Skip to content

Commit

Permalink
Merge branch 'enable-lint-ci' into merge-v1.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan-Wilson authored Aug 9, 2023
2 parents 31addf8 + 13a226a commit 8aea202
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ type Message struct {
// account nonce in state. It also disables checking that the sender is an EOA.
// This field will be set to true for operations like RPC eth_call.
SkipAccountChecks bool
// L1 charging is disabled when SkipL1Charging is true.
// This field might be set to true for operations like RPC eth_call.
SkipL1Charging bool
}

type MessageRunMode uint8
Expand Down
3 changes: 3 additions & 0 deletions ethclient/ethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,9 @@ func toCallArg(msg ethereum.CallMsg) interface{} {
if msg.GasPrice != nil {
arg["gasPrice"] = (*hexutil.Big)(msg.GasPrice)
}
if msg.SkipL1Charging {
arg["skipL1Charging"] = msg.SkipL1Charging
}
return arg
}

Expand Down
3 changes: 2 additions & 1 deletion interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ type CallMsg struct {
Value *big.Int // amount of wei sent along with the call
Data []byte // input data, usually an ABI-encoded contract method invocation

AccessList types.AccessList // EIP-2930 access list.
AccessList types.AccessList // EIP-2930 access list.
SkipL1Charging bool // L1 charging is disabled when SkipL1Charging is true
}

// A ContractCaller provides contract calls, essentially transactions that are executed by
Expand Down
7 changes: 7 additions & 0 deletions internal/ethapi/transaction_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type TransactionArgs struct {
MaxPriorityFeePerGas *hexutil.Big `json:"maxPriorityFeePerGas"`
Value *hexutil.Big `json:"value"`
Nonce *hexutil.Uint64 `json:"nonce"`
SkipL1Charging *bool `json:"skipL1Charging"`

// We accept "data" and "input" for backwards-compatibility reasons.
// "input" is the newer name and should be preferred by clients.
Expand Down Expand Up @@ -267,6 +268,11 @@ func (args *TransactionArgs) ToMessage(globalGasCap uint64, header *types.Header
accessList = *args.AccessList
}

skipL1Charging := false
if args.SkipL1Charging != nil {
skipL1Charging = *args.SkipL1Charging
}

msg := &core.Message{
From: addr,
To: args.To,
Expand All @@ -279,6 +285,7 @@ func (args *TransactionArgs) ToMessage(globalGasCap uint64, header *types.Header
AccessList: accessList,
SkipAccountChecks: true,
TxRunMode: runMode,
SkipL1Charging: skipL1Charging,
}
// Arbitrum: raise the gas cap to ignore L1 costs so that it's compute-only
if core.InterceptRPCGasCap != nil && state != nil {
Expand Down

0 comments on commit 8aea202

Please sign in to comment.