diff --git a/CHANGELOG.md b/CHANGELOG.md index 2be45af7632..deab90d1df2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ ## 👌 Improvements - fix(gateway): return `ErrFilterNotFound` error instead of empty result for unknown filter IDs in `EthGetFilterLogs` ([filecoin-project/lotus#13519](https://github.com/filecoin-project/lotus/pull/13519)) -- feat(basefee)!: premium-based base fee adjustment, activating in nv28 ([filecoin-project/lotus#13531](https://github.com/filecoin-project/lotus/pull/13531)) +- feat(basefee)!: premium-based base fee adjustment (FIP-0115), which may be included in a future upgrade ([filecoin-project/lotus#13531](https://github.com/filecoin-project/lotus/pull/13531)) # Node and Miner v1.35.0 / 2026-02-19 diff --git a/chain/store/basefee.go b/chain/store/basefee.go index 4ebcc65656c..f549bb98af9 100644 --- a/chain/store/basefee.go +++ b/chain/store/basefee.go @@ -54,10 +54,10 @@ func (cs *ChainStore) ComputeBaseFee(ctx context.Context, ts *types.TipSet) (abi if buildconstants.UpgradeBreezeHeight >= 0 && ts.Height() > buildconstants.UpgradeBreezeHeight && ts.Height() < buildconstants.UpgradeBreezeHeight+buildconstants.BreezeGasTampingDuration { return abi.NewTokenAmount(100), nil } - if ts.Height() < buildconstants.UpgradeXxHeight { - return cs.ComputeNextBaseFeeFromUtilization(ctx, ts) + if cs.fip0115BaseFeeHeight >= 0 && ts.Height() >= cs.fip0115BaseFeeHeight { + return cs.ComputeNextBaseFeeFromPremiums(ctx, ts) } - return cs.ComputeNextBaseFeeFromPremiums(ctx, ts) + return cs.ComputeNextBaseFeeFromUtilization(ctx, ts) } func (cs *ChainStore) ComputeNextBaseFeeFromUtilization(ctx context.Context, ts *types.TipSet) (abi.TokenAmount, error) { diff --git a/chain/store/store.go b/chain/store/store.go index 438c0a7855e..c28ddcd1613 100644 --- a/chain/store/store.go +++ b/chain/store/store.go @@ -129,6 +129,8 @@ type ChainStore struct { storeEvents bool + fip0115BaseFeeHeight abi.ChainEpoch + cancelFn context.CancelFunc wg sync.WaitGroup } @@ -156,6 +158,7 @@ func NewChainStore(chainBs bstore.Blockstore, stateBs bstore.Blockstore, ds dsto tsCache: tsc, cancelFn: cancel, journal: j, + fip0115BaseFeeHeight: -1, } cs.evtTypes = [1]journal.EventType{ @@ -1329,6 +1332,12 @@ func (cs *ChainStore) IsStoringEvents() bool { return cs.storeEvents } +// SetFIP0115Height sets the epoch at which FIP-0115 base fee calculation activates. +// A value of -1 disables it. +func (cs *ChainStore) SetFIP0115Height(height int64) { + cs.fip0115BaseFeeHeight = abi.ChainEpoch(height) +} + // true if ts1 wins according to the filecoin tie-break rule func breakWeightTie(ts1, ts2 *types.TipSet) bool { s := len(ts1.Blocks()) diff --git a/documentation/en/default-lotus-config.toml b/documentation/en/default-lotus-config.toml index 43d549766cc..473375588f6 100644 --- a/documentation/en/default-lotus-config.toml +++ b/documentation/en/default-lotus-config.toml @@ -147,6 +147,14 @@ # env var: LOTUS_FEES_DEFAULTMAXFEE #DefaultMaxFee = "0.07 FIL" + # FIP0115Height sets the epoch at which FIP-0115 base fee calculation activates. + # Set to -1 to disable. + # WARNING: This is a consensus-breaking change and should only be used for testing. + # + # type: int64 + # env var: LOTUS_FEES_FIP0115HEIGHT + #FIP0115Height = -1 + [Chainstore] # type: bool diff --git a/node/builder.go b/node/builder.go index 107c0e6f4e5..a87437b3e37 100644 --- a/node/builder.go +++ b/node/builder.go @@ -134,6 +134,7 @@ const ( SetApiEndpointKey StoreEventsKey + SetFIP0115BaseFeeHeightKey InitChainIndexerKey InitApiV2Key diff --git a/node/builder_chain.go b/node/builder_chain.go index 4bcaf578b37..9f862173326 100644 --- a/node/builder_chain.go +++ b/node/builder_chain.go @@ -267,6 +267,10 @@ func ConfigFullNode(c interface{}) Option { // as it enables us to serve logs in eth_getTransactionReceipt. If(cfg.Fevm.EnableEthRPC || cfg.Events.EnableActorEventsAPI || cfg.ChainIndexer.EnableIndexer, Override(StoreEventsKey, modules.EnableStoringEvents)), + Override(SetFIP0115BaseFeeHeightKey, func(cs *store.ChainStore) { + cs.SetFIP0115Height(cfg.Fees.FIP0115Height) + }), + If(cfg.Wallet.RemoteBackend != "", Override(new(*remotewallet.RemoteWallet), remotewallet.SetupRemoteWallet(cfg.Wallet.RemoteBackend)), ), diff --git a/node/config/def.go b/node/config/def.go index 5f8fab4b2ef..0599a812535 100644 --- a/node/config/def.go +++ b/node/config/def.go @@ -67,6 +67,7 @@ func DefaultFullNode() *FullNode { Fees: FeeConfig{ DefaultMaxFee: DefaultDefaultMaxFee(), + FIP0115Height: -1, }, Chainstore: Chainstore{ diff --git a/node/config/doc_gen.go b/node/config/doc_gen.go index ba82e1e3405..47f1f9083c3 100644 --- a/node/config/doc_gen.go +++ b/node/config/doc_gen.go @@ -270,6 +270,14 @@ rewards. This address should have adequate funds to cover gas fees.`, Comment: ``, }, + { + Name: "FIP0115Height", + Type: "int64", + + Comment: `FIP0115Height sets the epoch at which FIP-0115 base fee calculation activates. +Set to -1 to disable. +WARNING: This is a consensus-breaking change and should only be used for testing.`, + }, }, "FevmConfig": { { diff --git a/node/config/types.go b/node/config/types.go index f6a6e026007..fb8ebb60cfb 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -525,6 +525,11 @@ type Wallet struct { type FeeConfig struct { DefaultMaxFee types.FIL + + // FIP0115Height sets the epoch at which FIP-0115 base fee calculation activates. + // Set to -1 to disable. + // WARNING: This is a consensus-breaking change and should only be used for testing. + FIP0115Height int64 } type FevmConfig struct {