Skip to content

Commit aba683e

Browse files
authoredJun 5, 2024··
Merge branch 'main' into chore/db/default-pebbledb
2 parents ebcbf4e + bbcc6f8 commit aba683e

19 files changed

+70
-161
lines changed
 

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6767
- [#1889](https://github.com/NibiruChain/nibiru/pull/1889) - feat: implemented basic evm tx methods
6868
- [#1895](https://github.com/NibiruChain/nibiru/pull/1895) - refactor(geth): Reference go-ethereum as a submodule for easier change tracking with upstream
6969
- [#1901](https://github.com/NibiruChain/nibiru/pull/1901) - test(evm): more e2e test contracts for edge cases
70+
- [#1909](https://github.com/NibiruChain/nibiru/pull/1909) - chore(evm): set is_london true by default and removed from config
7071

7172
#### Dapp modules: perp, spot, oracle, etc
7273

‎app/evmante_eth.go

+14-16
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func (anteDec AnteDecEthGasConsume) AnteHandle(
157157

158158
// Use the lowest priority of all the messages as the final one.
159159
minPriority := int64(math.MaxInt64)
160-
baseFee := anteDec.EvmKeeper.GetBaseFee(ctx, ethCfg)
160+
baseFee := anteDec.EvmKeeper.GetBaseFee(ctx)
161161

162162
for _, msg := range tx.GetMsgs() {
163163
msgEthTx, ok := msg.(*evm.MsgEthereumTx)
@@ -284,7 +284,7 @@ func (ctd CanTransferDecorator) AnteHandle(
284284
return ctx, errors.Wrapf(errortypes.ErrUnknownRequest, "invalid message type %T, expected %T", msg, (*evm.MsgEthereumTx)(nil))
285285
}
286286

287-
baseFee := ctd.EvmKeeper.GetBaseFee(ctx, ethCfg)
287+
baseFee := ctd.EvmKeeper.GetBaseFee(ctx)
288288

289289
coreMsg, err := msgEthTx.AsMessage(signer, baseFee)
290290
if err != nil {
@@ -294,20 +294,18 @@ func (ctd CanTransferDecorator) AnteHandle(
294294
)
295295
}
296296

297-
if evm.IsLondon(ethCfg, ctx.BlockHeight()) {
298-
if baseFee == nil {
299-
return ctx, errors.Wrap(
300-
evm.ErrInvalidBaseFee,
301-
"base fee is supported but evm block context value is nil",
302-
)
303-
}
304-
if coreMsg.GasFeeCap().Cmp(baseFee) < 0 {
305-
return ctx, errors.Wrapf(
306-
errortypes.ErrInsufficientFee,
307-
"max fee per gas less than block base fee (%s < %s)",
308-
coreMsg.GasFeeCap(), baseFee,
309-
)
310-
}
297+
if baseFee == nil {
298+
return ctx, errors.Wrap(
299+
evm.ErrInvalidBaseFee,
300+
"base fee is supported but evm block context value is nil",
301+
)
302+
}
303+
if coreMsg.GasFeeCap().Cmp(baseFee) < 0 {
304+
return ctx, errors.Wrapf(
305+
errortypes.ErrInsufficientFee,
306+
"max fee per gas less than block base fee (%s < %s)",
307+
coreMsg.GasFeeCap(), baseFee,
308+
)
311309
}
312310

313311
// NOTE: pass in an empty coinbase address and nil tracer as we don't need them for the check below

‎app/evmante_fee_checker.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
// a) feeCap = tx.fees / tx.gas
2424
// b) tipFeeCap = tx.MaxPriorityPrice (default) or MaxInt64
2525
// - when `ExtensionOptionDynamicFeeTx` is omitted, `tipFeeCap` defaults to `MaxInt64`.
26-
// - when london hardfork is not enabled, it falls back to SDK default behavior (validator min-gas-prices).
2726
// - Tx priority is set to `effectiveGasPrice / DefaultPriorityReduction`.
2827
func NewDynamicFeeChecker(k evmkeeper.Keeper) ante.TxFeeChecker {
2928
return func(ctx sdk.Context, feeTx sdk.FeeTx) (sdk.Coins, int64, error) {
@@ -34,13 +33,8 @@ func NewDynamicFeeChecker(k evmkeeper.Keeper) ante.TxFeeChecker {
3433
}
3534
params := k.GetParams(ctx)
3635
denom := params.EvmDenom
37-
ethCfg := params.ChainConfig.EthereumConfig(k.EthChainID(ctx))
3836

39-
baseFee := k.GetBaseFee(ctx, ethCfg)
40-
if baseFee == nil {
41-
// london hardfork is not enabled: fallback to min-gas-prices logic
42-
return checkTxFeeWithValidatorMinGasPrices(ctx, feeTx)
43-
}
37+
baseFee := k.GetBaseFee(ctx)
4438

4539
// default to `MaxInt64` when there's no extension option.
4640
maxPriorityPrice := sdkmath.NewInt(math.MaxInt64)

‎app/evmante_fee_market.go

+1-10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
package app
33

44
import (
5-
"math/big"
6-
75
"cosmossdk.io/errors"
86
sdk "github.com/cosmos/cosmos-sdk/types"
97
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
@@ -30,15 +28,8 @@ func NewGasWantedDecorator(
3028
func (gwd GasWantedDecorator) AnteHandle(
3129
ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler,
3230
) (newCtx sdk.Context, err error) {
33-
evmParams := gwd.EvmKeeper.GetParams(ctx)
34-
chainCfg := evmParams.GetChainConfig()
35-
ethCfg := chainCfg.EthereumConfig(gwd.EvmKeeper.EthChainID(ctx))
36-
37-
blockHeight := big.NewInt(ctx.BlockHeight())
38-
isLondon := ethCfg.IsLondon(blockHeight)
39-
4031
feeTx, ok := tx.(sdk.FeeTx)
41-
if !ok || !isLondon {
32+
if !ok {
4233
return next(ctx, tx, simulate)
4334
}
4435

‎app/evmante_fees.go

+2-68
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,23 @@ import (
1515

1616
var (
1717
_ sdk.AnteDecorator = EthMinGasPriceDecorator{}
18-
_ sdk.AnteDecorator = EthMempoolFeeDecorator{}
1918
)
2019

2120
// EthMinGasPriceDecorator will check if the transaction's fee is at least as large
2221
// as the MinGasPrices param. If fee is too low, decorator returns error and tx
2322
// is rejected. This applies to both CheckTx and DeliverTx and regardless
24-
// if London hard fork or fee market params (EIP-1559) are enabled.
23+
// fee market params (EIP-1559) are enabled.
2524
// If fee is high enough, then call next AnteHandler
2625
type EthMinGasPriceDecorator struct {
2726
AppKeepers
2827
}
2928

30-
// EthMempoolFeeDecorator will check if the transaction's effective fee is at
31-
// least as large as the local validator's minimum gasFee (defined in validator
32-
// config).
33-
// If fee is too low, decorator returns error and tx is rejected from mempool.
34-
// Note this only applies when ctx.CheckTx = true
35-
// If fee is high enough or not CheckTx, then call next AnteHandler
36-
// CONTRACT: Tx must implement FeeTx to use MempoolFeeDecorator
37-
type EthMempoolFeeDecorator struct {
38-
AppKeepers
39-
}
40-
4129
// NewEthMinGasPriceDecorator creates a new MinGasPriceDecorator instance used only for
4230
// Ethereum transactions.
4331
func NewEthMinGasPriceDecorator(k AppKeepers) EthMinGasPriceDecorator {
4432
return EthMinGasPriceDecorator{AppKeepers: k}
4533
}
4634

47-
// NewEthMempoolFeeDecorator creates a new NewEthMempoolFeeDecorator instance used only for
48-
// Ethereum transactions.
49-
func NewEthMempoolFeeDecorator(k AppKeepers) EthMempoolFeeDecorator {
50-
return EthMempoolFeeDecorator{
51-
AppKeepers: k,
52-
}
53-
}
54-
5535
// AnteHandle ensures that the effective fee from the transaction is greater than the
5636
// minimum global fee, which is defined by the MinGasPrice (parameter) * GasLimit (tx argument).
5737
func (empd EthMinGasPriceDecorator) AnteHandle(
@@ -67,9 +47,7 @@ func (empd EthMinGasPriceDecorator) AnteHandle(
6747
return next(ctx, tx, simulate)
6848
}
6949

70-
chainCfg := evmParams.GetChainConfig()
71-
ethCfg := chainCfg.EthereumConfig(empd.EvmKeeper.EthChainID(ctx))
72-
baseFee := empd.EvmKeeper.GetBaseFee(ctx, ethCfg)
50+
baseFee := empd.EvmKeeper.GetBaseFee(ctx)
7351

7452
for _, msg := range tx.GetMsgs() {
7553
ethMsg, ok := msg.(*evm.MsgEthereumTx)
@@ -117,47 +95,3 @@ func (empd EthMinGasPriceDecorator) AnteHandle(
11795

11896
return next(ctx, tx, simulate)
11997
}
120-
121-
// AnteHandle ensures that the provided fees meet a minimum threshold for the validator.
122-
// This check only for local mempool purposes, and thus it is only run on (Re)CheckTx.
123-
// The logic is also skipped if the London hard fork and EIP-1559 are enabled.
124-
func (mfd EthMempoolFeeDecorator) AnteHandle(
125-
ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler,
126-
) (newCtx sdk.Context, err error) {
127-
if !ctx.IsCheckTx() || simulate {
128-
return next(ctx, tx, simulate)
129-
}
130-
evmParams := mfd.EvmKeeper.GetParams(ctx)
131-
chainCfg := evmParams.GetChainConfig()
132-
ethCfg := chainCfg.EthereumConfig(mfd.EvmKeeper.EthChainID(ctx))
133-
134-
baseFee := mfd.EvmKeeper.GetBaseFee(ctx, ethCfg)
135-
// skip check as the London hard fork and EIP-1559 are enabled
136-
if baseFee != nil {
137-
return next(ctx, tx, simulate)
138-
}
139-
140-
evmDenom := evmParams.GetEvmDenom()
141-
minGasPrice := ctx.MinGasPrices().AmountOf(evmDenom)
142-
143-
for _, msg := range tx.GetMsgs() {
144-
ethMsg, ok := msg.(*evm.MsgEthereumTx)
145-
if !ok {
146-
return ctx, errors.Wrapf(errortypes.ErrUnknownRequest, "invalid message type %T, expected %T", msg, (*evm.MsgEthereumTx)(nil))
147-
}
148-
149-
fee := sdk.NewDecFromBigInt(ethMsg.GetFee())
150-
gasLimit := sdk.NewDecFromBigInt(new(big.Int).SetUint64(ethMsg.GetGas()))
151-
requiredFee := minGasPrice.Mul(gasLimit)
152-
153-
if fee.LT(requiredFee) {
154-
return ctx, errors.Wrapf(
155-
errortypes.ErrInsufficientFee,
156-
"insufficient fee; got: %s required: %s",
157-
fee, requiredFee,
158-
)
159-
}
160-
}
161-
162-
return next(ctx, tx, simulate)
163-
}

‎app/evmante_handler.go

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ func NewAnteHandlerEVM(
1414
return sdk.ChainAnteDecorators(
1515
// outermost AnteDecorator. SetUpContext must be called first
1616
NewEthSetUpContextDecorator(k),
17-
// Check eth effective gas price against the node's minimal-gas-prices config
18-
NewEthMempoolFeeDecorator(k),
1917
// Check eth effective gas price against the global MinGasPrice
2018
NewEthMinGasPriceDecorator(k),
2119
NewEthValidateBasicDecorator(k),

‎app/evmante_setup_ctx.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ func NewEthSetUpContextDecorator(k AppKeepers) EthSetupContextDecorator {
2828
}
2929
}
3030

31-
func (esc EthSetupContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) {
31+
func (esc EthSetupContextDecorator) AnteHandle(
32+
ctx sdk.Context,
33+
tx sdk.Tx,
34+
simulate bool,
35+
next sdk.AnteHandler,
36+
) (newCtx sdk.Context, err error) {
3237
// all transactions must implement GasTx
3338
_, ok := tx.(authante.GasTx)
3439
if !ok {
@@ -145,10 +150,7 @@ func (vbd EthValidateBasicDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu
145150
txGasLimit := uint64(0)
146151

147152
evmParams := vbd.EvmKeeper.GetParams(ctx)
148-
chainCfg := evmParams.GetChainConfig()
149-
chainID := vbd.EvmKeeper.EthChainID(ctx)
150-
ethCfg := chainCfg.EthereumConfig(chainID)
151-
baseFee := vbd.EvmKeeper.GetBaseFee(ctx, ethCfg)
153+
baseFee := vbd.EvmKeeper.GetBaseFee(ctx)
152154
enableCreate := evmParams.GetEnableCreate()
153155
enableCall := evmParams.GetEnableCall()
154156
evmDenom := evmParams.GetEvmDenom()

‎app/upgrades.go

+2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ import (
99
"github.com/NibiruChain/nibiru/app/upgrades/v1_1_0"
1010
"github.com/NibiruChain/nibiru/app/upgrades/v1_2_0"
1111
"github.com/NibiruChain/nibiru/app/upgrades/v1_3_0"
12+
"github.com/NibiruChain/nibiru/app/upgrades/v1_4_0"
1213
)
1314

1415
var Upgrades = []upgrades.Upgrade{
1516
v1_1_0.Upgrade,
1617
v1_2_0.Upgrade,
1718
v1_3_0.Upgrade,
19+
v1_4_0.Upgrade,
1820
}
1921

2022
func (app *NibiruApp) setupUpgrades() {

‎app/upgrades/v1_4_0/constants.go

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package v1_4_0
2+
3+
import (
4+
"github.com/cosmos/cosmos-sdk/store/types"
5+
sdk "github.com/cosmos/cosmos-sdk/types"
6+
"github.com/cosmos/cosmos-sdk/types/module"
7+
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
8+
9+
"github.com/NibiruChain/nibiru/app/upgrades"
10+
)
11+
12+
const UpgradeName = "v1.4.0"
13+
14+
var Upgrade = upgrades.Upgrade{
15+
UpgradeName: UpgradeName,
16+
CreateUpgradeHandler: func(mm *module.Manager, cfg module.Configurator) upgradetypes.UpgradeHandler {
17+
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
18+
return mm.RunMigrations(ctx, cfg, fromVM)
19+
}
20+
},
21+
StoreUpgrades: types.StoreUpgrades{
22+
Added: []string{},
23+
},
24+
}

‎eth/rpc/backend/call_tx.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func (b *Backend) SetTxDefaults(args evm.JsonTxArgs) (evm.JsonTxArgs, error) {
175175
}
176176

177177
// If user specifies both maxPriorityfee and maxFee, then we do not
178-
// need to consult the chain for defaults. It's definitely a London tx.
178+
// need to consult the chain for defaults.
179179
if args.MaxPriorityFeePerGas == nil || args.MaxFeePerGas == nil {
180180
// In this clause, user left some fields unspecified.
181181
if head.BaseFee != nil && args.GasPrice == nil {

‎eth/rpc/backend/chain_info.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,10 @@ func (b *Backend) ChainConfig() *params.ChainConfig {
5252

5353
// BaseFee returns the base fee tracked by the Fee Market module.
5454
// If the base fee is not enabled globally, the query returns nil.
55-
// If the London hard fork is not activated at the current height, the query will
56-
// return nil.
5755
func (b *Backend) BaseFee(
5856
blockRes *tmrpctypes.ResultBlockResults,
5957
) (baseFee *big.Int, err error) {
60-
// return BaseFee if London hard fork is activated and feemarket is enabled
58+
// return BaseFee if feemarket is enabled
6159
res, err := b.queryClient.BaseFee(rpc.NewContextWithHeight(blockRes.Height), &evm.QueryBaseFeeRequest{})
6260
if err != nil || res.BaseFee == nil {
6361
baseFee = nil

‎eth/rpc/backend/utils.go

+5-8
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,12 @@ func (b *Backend) processBlock(
120120
// set basefee
121121
targetOneFeeHistory.BaseFee = blockBaseFee
122122
cfg := b.ChainConfig()
123-
if cfg.IsLondon(big.NewInt(blockHeight + 1)) {
124-
header, err := b.CurrentHeader()
125-
if err != nil {
126-
return err
127-
}
128-
targetOneFeeHistory.NextBaseFee = misc.CalcBaseFee(cfg, header)
129-
} else {
130-
targetOneFeeHistory.NextBaseFee = new(big.Int)
123+
header, err := b.CurrentHeader()
124+
if err != nil {
125+
return err
131126
}
127+
targetOneFeeHistory.NextBaseFee = misc.CalcBaseFee(cfg, header)
128+
132129
// set gas used ratio
133130
gasLimitUint64, ok := (*ethBlock)["gasLimit"].(hexutil.Uint64)
134131
if !ok {

‎x/evm/keeper/grpc_query.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,7 @@ func (k Keeper) BaseFee(
165165
goCtx context.Context, _ *evm.QueryBaseFeeRequest,
166166
) (*evm.QueryBaseFeeResponse, error) {
167167
ctx := sdk.UnwrapSDKContext(goCtx)
168-
params := k.GetParams(ctx)
169-
ethCfg := params.ChainConfig.EthereumConfig(k.EthChainID(ctx))
170-
baseFee := sdkmath.NewIntFromBigInt(k.GetBaseFee(ctx, ethCfg))
168+
baseFee := sdkmath.NewIntFromBigInt(k.GetBaseFee(ctx))
171169
return &evm.QueryBaseFeeResponse{
172170
BaseFee: &baseFee,
173171
}, nil
@@ -512,7 +510,7 @@ func (k Keeper) TraceTx(
512510
}
513511

514512
// compute and use base fee of the height that is being traced
515-
baseFee := k.GetBaseFee(ctx, cfg.ChainConfig)
513+
baseFee := k.GetBaseFee(ctx)
516514
if baseFee != nil {
517515
cfg.BaseFee = baseFee
518516
}
@@ -613,7 +611,7 @@ func (k Keeper) TraceBlock(
613611
}
614612

615613
// compute and use base fee of height that is being traced
616-
baseFee := k.GetBaseFeeNoCfg(ctx)
614+
baseFee := k.GetBaseFee(ctx)
617615
if baseFee != nil {
618616
cfg.BaseFee = baseFee
619617
}

‎x/evm/keeper/keeper.go

+3-10
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,15 @@ func (k Keeper) GetMinGasMultiplier(ctx sdk.Context) math.LegacyDec {
111111
return math.LegacyNewDecWithPrec(50, 2) // 50%
112112
}
113113

114-
func (k Keeper) GetBaseFee(
115-
ctx sdk.Context, ethCfg *gethparams.ChainConfig,
116-
) *big.Int {
117-
isLondon := evm.IsLondon(ethCfg, ctx.BlockHeight())
118-
if !isLondon {
119-
return nil
120-
}
114+
func (k Keeper) GetBaseFee(ctx sdk.Context) *big.Int {
115+
// TODO: plug in fee market keeper
121116
return big.NewInt(0)
122117
}
123118

124119
func (k Keeper) GetBaseFeeNoCfg(
125120
ctx sdk.Context,
126121
) *big.Int {
127-
ethChainId := k.EthChainID(ctx)
128-
ethCfg := k.GetParams(ctx).ChainConfig.EthereumConfig(ethChainId)
129-
return k.GetBaseFee(ctx, ethCfg)
122+
return k.GetBaseFee(ctx)
130123
}
131124

132125
// Logger returns a module-specific logger.

‎x/evm/keeper/msg_server.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ func (k *Keeper) ApplyEvmMsg(ctx sdk.Context,
423423

424424
sender := vm.AccountRef(msg.From())
425425
contractCreation := msg.To() == nil
426-
isLondon := cfg.ChainConfig.IsLondon(evmObj.Context.BlockNumber)
427426

428427
intrinsicGas, err := k.GetEthIntrinsicGas(ctx, msg, cfg.ChainConfig, contractCreation)
429428
if err != nil {
@@ -455,12 +454,8 @@ func (k *Keeper) ApplyEvmMsg(ctx sdk.Context,
455454
ret, leftoverGas, vmErr = evmObj.Call(sender, *msg.To(), msg.Data(), leftoverGas, msg.Value())
456455
}
457456

458-
refundQuotient := params.RefundQuotient
459-
460457
// After EIP-3529: refunds are capped to gasUsed / 5
461-
if isLondon {
462-
refundQuotient = params.RefundQuotientEIP3529
463-
}
458+
refundQuotient := params.RefundQuotientEIP3529
464459

465460
// calculate gas refund
466461
if msg.Gas() < leftoverGas {

‎x/evm/keeper/vm_config.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (k *Keeper) GetEVMConfig(
2727
return nil, errors.Wrap(err, "failed to obtain coinbase address")
2828
}
2929

30-
baseFee := k.GetBaseFee(ctx, ethCfg)
30+
baseFee := k.GetBaseFee(ctx)
3131
return &statedb.EVMConfig{
3232
Params: params,
3333
ChainConfig: ethCfg,
@@ -48,17 +48,12 @@ func (k *Keeper) TxConfig(
4848
)
4949
}
5050

51-
// DEFAULT_NO_BASE_FEE: Toggles whether or not a base fee will be used. It should
52-
// always be on, since Nibiru EVM starts from a post-London upgrade state.
53-
const DEFAULT_NO_BASE_FEE = false
54-
5551
// VMConfig creates an EVM configuration from the debug setting and the extra
5652
// EIPs enabled on the module parameters. The config generated uses the default
5753
// JumpTable from the EVM.
5854
func (k Keeper) VMConfig(
5955
ctx sdk.Context, _ core.Message, cfg *statedb.EVMConfig, tracer vm.EVMLogger,
6056
) vm.Config {
61-
noBaseFee := DEFAULT_NO_BASE_FEE
6257
var debug bool
6358
if _, ok := tracer.(evm.NoOpTracer); !ok {
6459
debug = true
@@ -67,7 +62,7 @@ func (k Keeper) VMConfig(
6762
return vm.Config{
6863
Debug: debug,
6964
Tracer: tracer,
70-
NoBaseFee: noBaseFee,
65+
NoBaseFee: false,
7166
ExtraEips: cfg.Params.EIPs(),
7267
}
7368
}

‎x/evm/params.go

-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package evm
33

44
import (
55
"fmt"
6-
"math/big"
76
"sort"
87
"strings"
98

@@ -14,7 +13,6 @@ import (
1413

1514
"github.com/ethereum/go-ethereum/common"
1615
"github.com/ethereum/go-ethereum/core/vm"
17-
"github.com/ethereum/go-ethereum/params"
1816
"golang.org/x/exp/slices"
1917

2018
"github.com/NibiruChain/nibiru/eth"
@@ -246,8 +244,3 @@ func ValidatePrecompiles(i interface{}) error {
246244

247245
return nil
248246
}
249-
250-
// IsLondon returns if london hardfork is enabled.
251-
func IsLondon(ethConfig *params.ChainConfig, height int64) bool {
252-
return ethConfig.IsLondon(big.NewInt(height))
253-
}

‎x/evm/statedb/state_object.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (s *stateObject) setBalance(amount *big.Int) {
127127
// Attribute accessors
128128
//
129129

130-
// Returns the address of the contract/account
130+
// Address returns the address of the contract/account
131131
func (s *stateObject) Address() common.Address {
132132
return s.address
133133
}
@@ -168,7 +168,7 @@ func (s *stateObject) setCode(codeHash common.Hash, code []byte) {
168168
s.dirtyCode = true
169169
}
170170

171-
// SetCode set nonce to account
171+
// SetNonce set nonce to account
172172
func (s *stateObject) SetNonce(nonce uint64) {
173173
s.db.journal.append(nonceChange{
174174
account: &s.address,

‎x/evm/tx.go

-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ var DefaultPriorityReduction = sdk.DefaultPowerReduction
4646
func GetTxPriority(txData TxData, baseFee *big.Int) (priority int64) {
4747
// calculate priority based on effective gas price
4848
tipPrice := txData.EffectiveGasPrice(baseFee)
49-
// if london hardfork is not enabled, tipPrice is the gasPrice
50-
if baseFee != nil {
51-
tipPrice = new(big.Int).Sub(tipPrice, baseFee)
52-
}
5349

5450
priority = math.MaxInt64
5551
priorityBig := new(big.Int).Quo(tipPrice, DefaultPriorityReduction.BigInt())

0 commit comments

Comments
 (0)
Please sign in to comment.