diff --git a/CHANGELOG.md b/CHANGELOG.md index b12437a44fa..d26d80b1e85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,12 +29,14 @@ ### Added -- [#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. +- [#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. ### Changed ### Removed +- [#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. + ### Fixed ## Forest v0.33.0 "Patroclus" diff --git a/scripts/devnet/.env b/scripts/devnet/.env index 34dba6b63ad..d6c129815b5 100644 --- a/scripts/devnet/.env +++ b/scripts/devnet/.env @@ -1,4 +1,4 @@ -LOTUS_IMAGE=ghcr.io/chainsafe/lotus-devnet:2026-04-20-4f7bde5 +LOTUS_IMAGE=ghcr.io/chainsafe/lotus-devnet:2026-04-21-adb50d9 FOREST_DATA_DIR=/forest_data LOTUS_DATA_DIR=/lotus_data FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters diff --git a/scripts/devnet/lotus.dockerfile b/scripts/devnet/lotus.dockerfile index f5a9017b69f..9d382cfab9d 100644 --- a/scripts/devnet/lotus.dockerfile +++ b/scripts/devnet/lotus.dockerfile @@ -13,7 +13,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --profile mini ENV PATH="/root/.cargo/bin:${PATH}" -RUN git clone https://github.com/filecoin-project/lotus.git . && git reset --hard d036ad9521d6621b5393d3d1b707a9994e94feed +RUN git clone https://github.com/filecoin-project/lotus.git . && git reset --hard 7db670848518732139425d36f8baaad7518e569a # https://github.com/Filecoin-project/filecoin-ffi?tab=readme-ov-file#building-from-source RUN CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" \ diff --git a/src/chain/store/base_fee.rs b/src/chain/store/base_fee.rs index eef3459167c..6e618f324db 100644 --- a/src/chain/store/base_fee.rs +++ b/src/chain/store/base_fee.rs @@ -1,25 +1,15 @@ // Copyright 2019-2026 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -use std::sync::LazyLock; - use crate::blocks::Tipset; use crate::message::MessageReadWrite; use crate::shim::clock::ChainEpoch; use crate::shim::econ::{BLOCK_GAS_LIMIT, TokenAmount}; -use crate::utils::misc::env::env_or_default; use ahash::{HashSet, HashSetExt}; use fvm_ipld_blockstore::Blockstore; use super::weighted_quick_select::weighted_quick_select; -/// FIP-0115 base fee activation epoch, controlled via `FOREST_FEES_FIP0115HEIGHT`. -/// Defaults to `-1` (disabled). Setting to a non-negative value activates premium-based -/// base fee computation at that epoch. -/// WARNING: This is a consensus-breaking change and should only be used for testing. -static FIP0115_HEIGHT: LazyLock = - LazyLock::new(|| env_or_default("FOREST_FEES_FIP0115HEIGHT", -1)); - pub const BLOCK_GAS_TARGET_INDEX: u64 = BLOCK_GAS_LIMIT * 80 / 100 - 1; /// Used in calculating the base fee change. @@ -64,17 +54,15 @@ pub fn compute_base_fee( db: &DB, ts: &Tipset, smoke_height: ChainEpoch, + firehorse_height: ChainEpoch, ) -> Result where DB: Blockstore, { - // FIP-0115: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0115.md - let fip0115_height = *FIP0115_HEIGHT; - if fip0115_height >= 0 && ts.epoch() >= fip0115_height { - return compute_next_base_fee_from_premiums(db, ts); + if ts.epoch() < firehorse_height { + return compute_next_base_fee_from_utlilization(db, ts, smoke_height); } - - compute_next_base_fee_from_utlilization(db, ts, smoke_height) + compute_next_base_fee_from_premiums(db, ts) } fn compute_next_base_fee_from_premiums( @@ -229,7 +217,8 @@ mod tests { }); let ts = Tipset::from(h0); let smoke_height = ChainConfig::default().epoch(Height::Smoke); - assert!(compute_base_fee(&blockstore, &ts, smoke_height).is_err()); + let firehorse_height = ChainConfig::default().epoch(Height::FireHorse); + assert!(compute_base_fee(&blockstore, &ts, smoke_height, firehorse_height).is_err()); } #[test] diff --git a/src/chain_sync/tipset_syncer.rs b/src/chain_sync/tipset_syncer.rs index 3ef0f96b2ed..60c24f83ee4 100644 --- a/src/chain_sync/tipset_syncer.rs +++ b/src/chain_sync/tipset_syncer.rs @@ -240,14 +240,20 @@ async fn validate_block( // Base fee check validations.spawn_blocking({ let smoke_height = state_manager.chain_config().epoch(Height::Smoke); + let firehorse_height = state_manager.chain_config().epoch(Height::FireHorse); let base_tipset = base_tipset.shallow_clone(); let block_store = state_manager.blockstore_owned(); let block = block.shallow_clone(); move || { - let base_fee = crate::chain::compute_base_fee(&block_store, &base_tipset, smoke_height) - .map_err(|e| { - TipsetSyncerError::Validation(format!("Could not compute base fee: {e}")) - })?; + let base_fee = crate::chain::compute_base_fee( + &block_store, + &base_tipset, + smoke_height, + firehorse_height, + ) + .map_err(|e| { + TipsetSyncerError::Validation(format!("Could not compute base fee: {e}")) + })?; let parent_base_fee = &block.header.parent_base_fee; if &base_fee != parent_base_fee { return Err(TipsetSyncerError::Validation(format!( diff --git a/src/message_pool/msgpool/provider.rs b/src/message_pool/msgpool/provider.rs index 23d9dc6eda6..88c2f34b67f 100644 --- a/src/message_pool/msgpool/provider.rs +++ b/src/message_pool/msgpool/provider.rs @@ -97,7 +97,8 @@ impl Provider for ChainStore { fn chain_compute_base_fee(&self, ts: &Tipset) -> Result { let smoke_height = self.chain_config().epoch(Height::Smoke); - crate::chain::compute_base_fee(self.blockstore(), ts, smoke_height) + let firehorse_height = self.chain_config().epoch(Height::FireHorse); + crate::chain::compute_base_fee(self.blockstore(), ts, smoke_height, firehorse_height) .map_err(|err| err.into()) } diff --git a/src/rpc/methods/miner.rs b/src/rpc/methods/miner.rs index 4152d5ad413..b9540c550ac 100644 --- a/src/rpc/methods/miner.rs +++ b/src/rpc/methods/miner.rs @@ -133,15 +133,18 @@ impl RpcMethod<1> for MinerCreateBlock { .get_miner_work_addr(*lookback_state, &block_template.miner)?; let parent_weight = weight(store, &parent_tipset)?; - //let parent_weight = parent_tipset.weight().to_owned(); + let heights = &ctx.chain_config().height_infos; let parent_base_fee = compute_base_fee( store, &parent_tipset, - ctx.chain_config() - .height_infos + heights .get(&Height::Smoke) .context("Missing Smoke height")? .epoch, + heights + .get(&Height::FireHorse) + .context("Missing FireHorse height")? + .epoch, )?; let ExecutedTipset { state_root,