miner-ui-4 (0.3.18): the merge depth reads blockrate.mergeDepth, not params; 3,600 stands until the node carries it

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 45fd85dcdb)
This commit is contained in:
igneum-labs 2026-10-07 03:39:48 +00:00
parent 7242f9f80d
commit 09be2d7175
3 changed files with 12 additions and 2 deletions

View file

@ -993,7 +993,8 @@ impl Engine {
}
}
Cmd::NodeInfo(info) => {
if let Some(d) = info.overrides.as_ref().and_then(|p| p.get("merge_depth")).and_then(|v| v.as_u64()) { self.merge_depth = d; }
// the merge depth is compiled per network (not in params): blockrate.mergeDepth when the node says, else 3,600
if let Some(d) = info.merge_depth { self.merge_depth = d; }
if info.pow_engine.as_deref() == Some("stub") {
let first = self.st().node.state != "stub";
let mut st = self.st();

View file

@ -22,6 +22,9 @@ pub struct Check {
pub overrides: Option<Value>,
/// "igneum-pow" or "stub" (ledger N5: a node built without the mining engine refuses every real block)
pub pow_engine: Option<String>,
/// the network's compiled merge depth in blue score (`blockrate.mergeDepth`, the node lane's 0.3.18 addition);
/// None on a node without the object, and the app assumes 3,600 (1 bps)
pub merge_depth: Option<u64>,
}
/// The decision for the port-collision path.
@ -129,6 +132,7 @@ pub fn probe(evm_port: u16) -> Check {
c.version = info.get("version").and_then(|v| v.as_str()).map(|s| s.to_string());
c.overrides = info.get("params").cloned().filter(|v| v.is_object());
c.pow_engine = info.get("powEngine").and_then(|v| v.as_str()).map(|s| s.to_string());
c.merge_depth = info.get("blockrate").and_then(|b| b.get("mergeDepth")).and_then(|v| v.as_u64());
}
c
}
@ -178,6 +182,8 @@ mod tests {
let d = decide(26611, Some(&ours()), None, &Check { overrides: Some(theirs), ..Default::default() });
assert!(!d.use_it);
assert_eq!(d.line, "Node not started: port 26611 is taken by a node on other rules (fees_v1_activation_daa 200000, ours 210000)");
// the merge depth comes from blockrate.mergeDepth (compiled per network), never from params
assert_eq!(Check { merge_depth: Some(36_000), ..Default::default() }.merge_depth, Some(36_000));
// a stub engine is refused whatever else matches
assert!(!decide(26611, Some(&ours()), None, &Check { overrides: Some(ours()), pow_engine: Some("stub".into()), ..Default::default() }).use_it);
// an override we have that the other node lacks is a mismatch too

View file

@ -8,7 +8,10 @@
/// How long our blocks may stay out of the network's view before the node reads "behind" (two minutes).
pub const NOT_MERGING_S: f64 = 120.0;
/// The merge depth when the node's params do not say (1 bps: 3,600 blocks, docs/fork-map.md f1).
/// The merge depth when the node does not say (node lane, 7 October 2026: 1 bps x MERGE_DEPTH_DURATION = 3,600 in blue
/// score on the devnet and every 1-bps network; 36,000 at 10 bps; read from igneum_getNodeInfo's `blockrate.mergeDepth`
/// once the node carries it). Peer sinks: nothing exposes them yet; `igneum_getPeers` with lastDeliveredBlueScore is on
/// the 0.3.19 list, and the observer is the only network view until then.
pub const DEFAULT_MERGE_DEPTH: u64 = 3_600;
/// The words every surface uses for this state.
pub const NOT_MERGING: &str = "behind: your blocks are not merging into the network";