Skip to content

Commit

Permalink
rename to RPCPostingGasHook
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed Nov 7, 2024
1 parent 319e72f commit 973f8a3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/arbitrum_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ var InterceptRPCMessage = func(
// Gets ArbOS's maximum intended gas per second
var GetArbOSSpeedLimitPerSecond func(statedb *state.StateDB) (uint64, error)

// Allows ArbOS to update the gas cap so that it ignores the message's specific L1 poster costs.
var PostingGasHook = func(msg *Message, header *types.Header, statedb *state.StateDB) (uint64, error) { return 0, nil }
// While processing RPC only - Ask ArbOS what are the poster costs for this message.
var RPCPostingGasHook = func(msg *Message, header *types.Header, statedb *state.StateDB) (uint64, error) { return 0, nil }

// Renders a solidity error in human-readable form
var RenderRPCError func(data []byte) error
Expand Down
2 changes: 1 addition & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr

// Arbitrum: raise the gas cap to ignore L1 costs so that it's compute-only
{
postingGas, err := core.PostingGasHook(call, header, state)
postingGas, err := core.RPCPostingGasHook(call, header, state)
if err != nil {
return 0, err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/ethapi/transaction_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ func (args *TransactionArgs) ToMessage(baseFee *big.Int, globalGasCap uint64, he
if state != nil && !skipL1Charging {
// ToMessage recurses once to allow ArbOS to intercept the result for all callers
// ArbOS uses this to modify globalGasCap so that the cap will ignore this tx's specific L1 data costs
postingGas, err := core.PostingGasHook(msg, header, state)
postingGas, err := core.RPCPostingGasHook(msg, header, state)
if err == nil {
args.setGasUsingCap(globalGasCap + postingGas)
msg.GasLimit = uint64(*args.Gas)
Expand Down

0 comments on commit 973f8a3

Please sign in to comment.