ITADN

[BUG] - unexpected metrics with 11.0.1 and --start-as-non-producing-node

#6576ClosedSmaugPool 创建于 2026-05-21
needs triage
S
SmaugPoolcommented
**Internal/External** *External* **Area** *Other* (block forging metrics) **Summary** When starting the node with block producer credentials and ` --start-as-non-producing-node` option, the node returns wrong metrics because prometheus metric `cardano_node_metrics_Forge_forge_about_to_lead_int` increases each slot and `cardano_node_metrics_forging_enabled` returns `1`. This prevents having an easy way to detect the non-producing mode to implement failover. **Steps to reproduce** Steps to reproduce the behavior: 1. Start `cardano-node` `11.0.1` with `--shelley-kes-key`, `--shelley-vrf-key`, `--shelley-operational-certificate` and `--start-as-non-producing-node`. 2. Check related prometheus metrics with `curl -s http://159.69.139.94:12798/metrics | grep forg` - `cardano_node_metrics_Forge_forge_about_to_lead_int` is increasing each slot. - `cardano_node_metrics_forging_enabled` returns `1` **Expected behavior** 1. `cardano_node_metrics_Forge_forge_about_to_lead_int` metric should not exist or not be incremented until `SIGHUP` is received 2. `cardano_node_metrics_forging_enabled` should be set to `0` until `SIGHUP` is received **System info (please complete the following information):** - OS Name: Ubuntu - OS Version: 24.04.4 LTS - Node version: ``` cardano-node 11.0.1 - linux-aarch64 - ghc-9.6 git rev 97036a66bcf8c89f687ae57a048eecc0389977ef ``` - CLI version (output of `cardano-cli --version`) ``` cardano-cli 11.0.0.0 - linux-aarch64 - ghc-9.6 git rev 97036a66bcf8c89f687ae57a048eecc0389977ef ``` **Additional context** This feature is very useful to implement cardano-node redundancy with a fast (few seconds max) failover for the node. Also because SPOs use it to achieve failover, a behavior change could lead to have several BPs forging simultaneously after an update to 11.0.1, leading to unexpected forks on the chain (both nodes can produce slightly different blocks fighting each other). This could happen because this feature worked correctly at least with `10.1.4`. This seems to be a regression of https://github.com/IntersectMBO/cardano-node/issues/6113. As an aside, because a block producer uses `"useLedgerAfterSlot": -1`, the node in non-producing mode logs repeatedly ` [Net.Peers.Ledger.TraceUseLedgerPeers](Info,172) {"data":{"kind":"UseLedgerPeers","useLedgerPeers":-1}}`, which seems to be a new log.
关闭于 2026-05-22 1 条评论