Skip to content

Commit

Permalink
Merge pull request ethereum#90 from OffchainLabs/remove-support-for-tips
Browse files Browse the repository at this point in the history
Remove support for tips
  • Loading branch information
edfelten authored Apr 11, 2022
2 parents ca52300 + a4a2312 commit 256714e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,12 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
// 5. there is no overflow when calculating intrinsic gas
// 6. caller has enough balance to cover asset transfer for **topmost** call

// Arbitrum: drop support for tips from upgrade 2 onward
if st.evm.ProcessingHook.DropTip() && st.gasPrice.Cmp(st.evm.Context.BaseFee) > 0 {
st.gasPrice = st.evm.Context.BaseFee
st.gasTipCap = common.Big0
}

// Check clauses 1-3, buy gas if everything is correct
if err := st.preCheck(); err != nil {
return nil, err
Expand Down
12 changes: 7 additions & 5 deletions core/vm/evm_arbitrum.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type TxProcessingHook interface {
L1BlockNumber(blockCtx BlockContext) (uint64, error)
L1BlockHash(blockCtx BlockContext, l1BlocKNumber uint64) (common.Hash, error)
FillReceiptInfo(receipt *types.Receipt)
DropTip() bool
}

type DefaultTxProcessor struct{}
Expand All @@ -58,8 +59,7 @@ func (p DefaultTxProcessor) GasChargingHook(gasRemaining *uint64) (*common.Addre
return nil, nil
}

func (p DefaultTxProcessor) PushCaller(addr common.Address) {
}
func (p DefaultTxProcessor) PushCaller(addr common.Address) {}

func (p DefaultTxProcessor) PopCaller() {
}
Expand All @@ -72,8 +72,7 @@ func (p DefaultTxProcessor) NonrefundableGas() uint64 {
return 0
}

func (p DefaultTxProcessor) EndTxHook(totalGasUsed uint64, evmSuccess bool) {
}
func (p DefaultTxProcessor) EndTxHook(totalGasUsed uint64, evmSuccess bool) {}

func (p DefaultTxProcessor) ScheduledTxes() types.Transactions {
return types.Transactions{}
Expand All @@ -87,5 +86,8 @@ func (p DefaultTxProcessor) L1BlockHash(blockCtx BlockContext, l1BlocKNumber uin
return blockCtx.GetHash(l1BlocKNumber), nil
}

func (p DefaultTxProcessor) FillReceiptInfo(*types.Receipt) {
func (p DefaultTxProcessor) FillReceiptInfo(*types.Receipt) {}

func (p DefaultTxProcessor) DropTip() bool {
return false
}

0 comments on commit 256714e

Please sign in to comment.