Skip to content

Commit be12e0f

Browse files
authored
fix(lotus): disable unreleased network upgrade (UpgradeXxHeight) in devnet (#100)
* chore(ci): use apache archive for cassandra download dlcdn is only for the latest versions, we were using 5.0.6 which was removed when 5.0.7 was released. In this change we use archive.apache.org which has all the versions and we increment to 5.0.7 while we're at it. * fixup! chore(ci): use apache archive for cassandra download * fix(lotus): disable unreleased network upgrade (UpgradeXxHeight) in devnet Lotus 2k builds schedule UpgradeXxHeight at epoch 200, triggering an expensive state migration that causes transient ErrExpensiveFork on eth_call/estimateGas. Set LOTUS_XX_HEIGHT=-1 on the daemon container to prevent this.
1 parent c20d1fd commit be12e0f

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/commands/start/lotus/setup.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! This module contains functions that prepare the environment
44
//! for starting the Lotus daemon container.
55
6+
use super::super::lotus_utils::append_lotus_network_env;
67
use super::super::step::SetupContext;
78
use crate::constants::LOTUS_DOCKER_IMAGE;
89
use crate::docker::containers::lotus_container_name;
@@ -136,6 +137,9 @@ pub fn build_docker_command(
136137
// Set working directory
137138
docker_args.extend_from_slice(&["-w".to_string(), "/data".to_string()]);
138139

140+
// Disable the next unreleased network upgrade (UpgradeXxHeight)
141+
append_lotus_network_env(&mut docker_args);
142+
139143
// Add image name
140144
docker_args.push(LOTUS_DOCKER_IMAGE.to_string());
141145

src/commands/start/lotus_utils/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,16 @@ pub fn get_lotus_rpc_url(context: &SetupContext) -> Result<String, Box<dyn Error
7272
.parse()?;
7373
Ok(format!("http://localhost:{}/rpc/v1", lotus_api_port))
7474
}
75+
76+
/// Append `-e LOTUS_XX_HEIGHT=-1` to docker args.
77+
///
78+
/// Lotus 2k devnet builds always have one upcoming network upgrade at a positive
79+
/// epoch height (UpgradeXxHeight, where "Xx" is the placeholder name for the next
80+
/// unreleased upgrade). When the chain reaches that epoch, it triggers an expensive
81+
/// state migration that causes transient ErrExpensiveFork errors on eth_call and
82+
/// estimateGas RPCs. Since the devnet should mirror current mainnet/calibnet
83+
/// behavior (not an unreleased future upgrade), we disable it.
84+
pub fn append_lotus_network_env(docker_args: &mut Vec<String>) {
85+
docker_args.push("-e".to_string());
86+
docker_args.push("LOTUS_XX_HEIGHT=-1".to_string());
87+
}

0 commit comments

Comments
 (0)