Skip to content

Commit 3fb1877

Browse files
committed
feat: remove fip-0115 feature flag
1 parent 462e824 commit 3fb1877

7 files changed

Lines changed: 29 additions & 28 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@
2929

3030
### Added
3131

32-
- [#6913](https://github.com/ChainSafe/forest/issues/6913): Added support for NV28 for devnets. Use `FOREST_FIREHORSE_HEIGHT` environment variable to set the upgrade height. Note that `FIP-0115` is not yet automatically activated with this change.
32+
- [#6913](https://github.com/ChainSafe/forest/issues/6913): Added support for NV28 for devnets. Use `FOREST_FIREHORSE_HEIGHT` environment variable to set the upgrade height.
3333

3434
### Changed
3535

3636
### Removed
3737

38+
- [#6948](https://github.com/ChainSafe/forest/pull/6948): Removed the `FOREST_FEES_FIP0115HEIGHT` environment variable. The `FIP-0115` will be automatically activated at `FireHorse` network upgrade.
39+
3840
### Fixed
3941

4042
## Forest v0.33.0 "Patroclus"

scripts/devnet/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LOTUS_IMAGE=ghcr.io/chainsafe/lotus-devnet:2026-04-20-4f7bde5
1+
LOTUS_IMAGE=ghcr.io/chainsafe/lotus-devnet:2026-04-21-adb50d9
22
FOREST_DATA_DIR=/forest_data
33
LOTUS_DATA_DIR=/lotus_data
44
FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters

scripts/devnet/lotus.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --profile mini
1313

1414
ENV PATH="/root/.cargo/bin:${PATH}"
1515

16-
RUN git clone https://github.com/filecoin-project/lotus.git . && git reset --hard d036ad9521d6621b5393d3d1b707a9994e94feed
16+
RUN git clone https://github.com/filecoin-project/lotus.git . && git reset --hard 7db670848518732139425d36f8baaad7518e569a
1717

1818
# https://github.com/Filecoin-project/filecoin-ffi?tab=readme-ov-file#building-from-source
1919
RUN CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" \

src/chain/store/base_fee.rs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
// Copyright 2019-2026 ChainSafe Systems
22
// SPDX-License-Identifier: Apache-2.0, MIT
33

4-
use std::sync::LazyLock;
5-
64
use crate::blocks::Tipset;
75
use crate::message::MessageReadWrite;
86
use crate::shim::clock::ChainEpoch;
97
use crate::shim::econ::{BLOCK_GAS_LIMIT, TokenAmount};
10-
use crate::utils::misc::env::env_or_default;
118
use ahash::{HashSet, HashSetExt};
129
use fvm_ipld_blockstore::Blockstore;
1310

1411
use super::weighted_quick_select::weighted_quick_select;
1512

16-
/// FIP-0115 base fee activation epoch, controlled via `FOREST_FEES_FIP0115HEIGHT`.
17-
/// Defaults to `-1` (disabled). Setting to a non-negative value activates premium-based
18-
/// base fee computation at that epoch.
19-
/// WARNING: This is a consensus-breaking change and should only be used for testing.
20-
static FIP0115_HEIGHT: LazyLock<ChainEpoch> =
21-
LazyLock::new(|| env_or_default("FOREST_FEES_FIP0115HEIGHT", -1));
22-
2313
pub const BLOCK_GAS_TARGET_INDEX: u64 = BLOCK_GAS_LIMIT * 80 / 100 - 1;
2414

2515
/// Used in calculating the base fee change.
@@ -64,17 +54,15 @@ pub fn compute_base_fee<DB>(
6454
db: &DB,
6555
ts: &Tipset,
6656
smoke_height: ChainEpoch,
57+
firehorse_height: ChainEpoch,
6758
) -> Result<TokenAmount, crate::chain::Error>
6859
where
6960
DB: Blockstore,
7061
{
71-
// FIP-0115: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0115.md
72-
let fip0115_height = *FIP0115_HEIGHT;
73-
if fip0115_height >= 0 && ts.epoch() >= fip0115_height {
74-
return compute_next_base_fee_from_premiums(db, ts);
62+
if ts.epoch() < firehorse_height {
63+
return compute_next_base_fee_from_utlilization(db, ts, smoke_height);
7564
}
76-
77-
compute_next_base_fee_from_utlilization(db, ts, smoke_height)
65+
compute_next_base_fee_from_premiums(db, ts)
7866
}
7967

8068
fn compute_next_base_fee_from_premiums<DB>(
@@ -229,7 +217,8 @@ mod tests {
229217
});
230218
let ts = Tipset::from(h0);
231219
let smoke_height = ChainConfig::default().epoch(Height::Smoke);
232-
assert!(compute_base_fee(&blockstore, &ts, smoke_height).is_err());
220+
let firehorse_height = ChainConfig::default().epoch(Height::FireHorse);
221+
assert!(compute_base_fee(&blockstore, &ts, smoke_height, firehorse_height).is_err());
233222
}
234223

235224
#[test]

src/chain_sync/tipset_syncer.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,20 @@ async fn validate_block<DB: Blockstore + Sync + Send + 'static>(
240240
// Base fee check
241241
validations.spawn_blocking({
242242
let smoke_height = state_manager.chain_config().epoch(Height::Smoke);
243+
let firehorse_height = state_manager.chain_config().epoch(Height::FireHorse);
243244
let base_tipset = base_tipset.shallow_clone();
244245
let block_store = state_manager.blockstore_owned();
245246
let block = block.shallow_clone();
246247
move || {
247-
let base_fee = crate::chain::compute_base_fee(&block_store, &base_tipset, smoke_height)
248-
.map_err(|e| {
249-
TipsetSyncerError::Validation(format!("Could not compute base fee: {e}"))
250-
})?;
248+
let base_fee = crate::chain::compute_base_fee(
249+
&block_store,
250+
&base_tipset,
251+
smoke_height,
252+
firehorse_height,
253+
)
254+
.map_err(|e| {
255+
TipsetSyncerError::Validation(format!("Could not compute base fee: {e}"))
256+
})?;
251257
let parent_base_fee = &block.header.parent_base_fee;
252258
if &base_fee != parent_base_fee {
253259
return Err(TipsetSyncerError::Validation(format!(

src/message_pool/msgpool/provider.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ impl<DB: Blockstore> Provider for ChainStore<DB> {
9797

9898
fn chain_compute_base_fee(&self, ts: &Tipset) -> Result<TokenAmount, Error> {
9999
let smoke_height = self.chain_config().epoch(Height::Smoke);
100-
crate::chain::compute_base_fee(self.blockstore(), ts, smoke_height)
100+
let firehorse_height = self.chain_config().epoch(Height::FireHorse);
101+
crate::chain::compute_base_fee(self.blockstore(), ts, smoke_height, firehorse_height)
101102
.map_err(|err| err.into())
102103
}
103104

src/rpc/methods/miner.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,18 @@ impl RpcMethod<1> for MinerCreateBlock {
133133
.get_miner_work_addr(*lookback_state, &block_template.miner)?;
134134

135135
let parent_weight = weight(store, &parent_tipset)?;
136-
//let parent_weight = parent_tipset.weight().to_owned();
136+
let heights = &ctx.chain_config().height_infos;
137137
let parent_base_fee = compute_base_fee(
138138
store,
139139
&parent_tipset,
140-
ctx.chain_config()
141-
.height_infos
140+
heights
142141
.get(&Height::Smoke)
143142
.context("Missing Smoke height")?
144143
.epoch,
144+
heights
145+
.get(&Height::FireHorse)
146+
.context("Missing FireHorse height")?
147+
.epoch,
145148
)?;
146149
let ExecutedTipset {
147150
state_root,

0 commit comments

Comments
 (0)