Skip to content

SRE Node 11.2 preparation - #6732

Merged
johnalotoski merged 25 commits into
koslambrou/prepare-11.2from
jl/sre-11.2.0
Oct 26, 2026
Merged

johnalotoski merged 25 commits into
koslambrou/prepare-11.2from
jl/sre-11.2.0

Conversation

@johnalotoski

@johnalotoski johnalotoski commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

SRE changes for the 11.2 release: the shipped network configurations move to the
cardano-config envelope, and the nixos service, scripts and images learn to
generate and consume it.

Configuration. mainnet-config.yaml and the shipped network configs are
regenerated for cardano-config 2.2.2.0, with mainnet enveloped. A configFormat
option on the nixos service selects the dialect the generated config is written
in, the scripts take it from the environment, and the service warns about keys
that enveloping would strand rather than dropping them silently.

Tracing. trace-documentation and the trace config consistency check read a
file expecting the tracing settings at its root, which an envelope puts under
Configuration.HermodTracing. They now hand that object to trace-dispatcher
directly. The running node is unaffected; it passes an already-resolved
TraceConfig.

Service and images. lsmExportPath, immutableDatabasePath and
volatileDatabasePath options; a single BLS key rather than a list; peer target
names emitted to match the selected dialect. The docker readme documents the
enveloped shape for CARDANO_CONFIG_JSON_MERGE.

Tests. New coverage for an enveloped host config and for submit-api startup,
graceful shutdown cases, and a cardanoOciReadonly to cardanoOci rename.

Dependencies

Temporary Pins

  • Flake input iohkNix will be updated once final testing is done just prior to merge to master and tagging.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated.
  • Self-reviewed the diff

@johnalotoski
johnalotoski force-pushed the jl/sre-11.2.0 branch 2 times, most recently from 550835d to 78b18be Compare October 14, 2026 08:23
@palas

palas commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Back-up of branch: https://github.com/IntersectMBO/cardano-node/tree/backup/jl/sre-11.2.0

@palas
palas force-pushed the jl/sre-11.2.0 branch 4 times, most recently from 41ebf25 to fe64f23 Compare October 15, 2026 15:34
@koslambrou
koslambrou force-pushed the koslambrou/prepare-11.2 branch 6 times, most recently from e1435a3 to 120e7b9 Compare October 20, 2026 14:45

@snarlysodboxer snarlysodboxer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@johnalotoski
johnalotoski marked this pull request as ready for review October 21, 2026 02:42
@johnalotoski
johnalotoski requested review from a team as code owners October 21, 2026 02:42
Copilot AI balanced review requested due to automatic review settings October 21, 2026 02:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@koslambrou
koslambrou force-pushed the koslambrou/prepare-11.2 branch from 918a9df to 3026f0b Compare October 21, 2026 13:31
@carbolymer
carbolymer force-pushed the koslambrou/prepare-11.2 branch from ef1cfc4 to 1e701d5 Compare October 22, 2026 10:31
@johnalotoski
johnalotoski force-pushed the jl/sre-11.2.0 branch 3 times, most recently from 3636f73 to 9637c31 Compare October 22, 2026 21:47

@mgmeier mgmeier left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM.

Approved, even though iohk-nix PR merge still pending, see:

iohkNix = {
      url = "github:input-output-hk/iohk-nix/jl/node-11.2";

@palas palas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@koslambrou
koslambrou force-pushed the koslambrou/prepare-11.2 branch from e1cd357 to 96e9dba Compare October 26, 2026 19:14
palas and others added 24 commits October 26, 2026 15:09
Brings in the enveloped environment configs, along with the cardanoLib
attributes the release archive and docker changes need: mkEnvelope and the
per-environment configFormat. cardano-config 1.1.0.0 appears in the lock
transitively as iohk-nix's source-only schema input.
Regenerated with update-config-files.sh against the bumped iohkNix.

mainnet-config.json is now in the cardano-config envelope, following what
iohk-nix publishes. mainnet-config.yaml is hand-maintained and stays flat;
it drops the same keys the json series drops, Protocol and
MaxKnownMajorProtocolVersion, and its MinNodeVersion moves to 11.2.0 to
match. The two remain equivalent through migrate, which reproduces the json
from the yaml byte for byte, though they are no longer directly comparable.

testnet-template-config.json drops ApplicationName, ApplicationVersion,
PBftSignatureThreshold, Protocol and MaxKnownMajorProtocolVersion. The
template is copied from the iohk-nix source tree rather than from the
published deployment, so it stays flat.

testnet-template-dijkstra.json picks up the Leios genesis protocol
parameters added in the w36 respin.
iohk-nix now publishes <env>-config.json in the cardano-config envelope.
Two places in this repo produced or consumed the legacy dialect regardless.

binary-release.nix built config.json straight from env.nodeConfig,
bypassing configFormat, so release tarballs stayed on the legacy dialect
while the published configs moved. It now emits whichever dialect the
environment selects, enveloping the already-relativised config so the
tarball's sibling genesis paths survive. cardanoLib always sets
configFormat and throws on a value it does not know, so this throws too
rather than falling through to legacy and publishing the wrong dialect
silently.

The docker node entrypoint rewrote relative "*File" values to absolute
paths with a top-level with_entries. In the envelope those keys live under
Configuration.<Section>, so it silently rewrote nothing and the merged
config's genesis paths would have resolved against the runtime dir, the
exact failure the code comment says it exists to prevent. Walking the
document handles the flat and enveloped shapes alike.

Docker otherwise needs no change: it takes its configs from mkConfigHtml,
so it picks up the envelope, and the sed that strips the <env>- prefix is a
plain text substitution that still matches.

CARDANO_CONFIG_JSON_MERGE is a user-facing break that no code change can
absorb: the merge is a plain deep merge with no key relocation, so a merge
document written for the flat shape now adds an unrecognised top-level key
and leaves the intended value untouched, silently. The README gains the new
shape, an example updated to Configuration.HermodTracing.TraceOptions, and
a way to find any key's path from inside the image. The tracer section says
its config is not enveloped, since the two appear side by side.
trace-dispatcher reads a file expecting the tracing settings at its root, but a
cardano-config envelope nests them under `Configuration.HermodTracing`, so
`trace-documentation` failed with `key "Options" not found`.

Pass that object as `FromJSONObject` instead. It holds the flat legacy key
names, so no particular trace-dispatcher version is needed.
The json moved to the cardano-config envelope, leaving the hand-maintained
yaml as the only flat mainnet config and breaking the yaml === json
equivalence that Test.Cardano.Config.Mainnet asserts. Restructure the yaml
to the same shape.

LastKnownBlockVersion-Major/-Minor/-Alt are dropped: migrate treats them as
removed and the json does not carry them. An enveloped config never reaches
POM, which was the only thing that required them, so this file is no longer
readable by a pre-11.2 node.

Comments are preserved per section, and the commented-out examples are
re-nested under Network and Mempool, the section names cardano-config
derives from its schemas, with the DeadlineTargetNumberOf* and
CapacityBytesOverride key names. Uncommenting one now sets the value it
names instead of adding a key the node does not recognise.

Verified: the yaml and json decode to identical values, and
trace-documentation generates identical output from the yaml, the json and an
older flat config.
The current prototype parses --shelley-bls-key as optional (strOption ...),
so the node takes at most one occurrence.  Multiple keys go in the one file
instead, as a JSON array of text envelopes, which is how a rotation pair or a
bundle of pool keys is supplied.

The earlier --shelley-bls-keys design of accepting the flag repeatedly
is not supported going forward.
Regenerated from iohk-nix, which this bumps.  The envelope moves to format
version 2 with the shortened section keys, mainnet defaults to GenesisMode,
and the snapshot policy gains MinDelay and MaxDelay derived from the security
parameter.

The peer snapshot and the topology's useLedgerAfterSlot are regenerated
together, so the point past which a syncing node trusts ledger peers tracks
the snapshot rather than trailing it.
The published configs and release artifacts moved to the cardano-config
envelope, but the service still writes a flat config. Add configFormat,
"legacy" or "enveloped", so consumers can move a host at a time.

Enveloping happens last, on the assembled instance config, so nodeConfig,
extraNodeConfig and extraNodeInstanceConfig stay flat and keep today's key
names. mkEnvelope applies the renames and sections each key. A key it does
not recognise is kept outside any section, where the node will not resolve
it, so opting a host in is worth checking against its warnings.

Ignored when nodeConfigFile is set, so workbench is unaffected. The default
stays legacy.
Added warnings, raised at eval time when configFormat is "enveloped", for
keys cardano-config will not resolve.

Lifted the config assembly out of mkScript to module level so the warnings
check the same document that gets written, rather than a second assembly
of it.

Needs the cardanoLib exports added in iohk-nix: removedKeys, renamedKeys
and unrecognisedKeys.
POM reads these only as TargetNumberOf*, cardano-config only as
DeadlineTargetNumberOf*. The module emitted the former unconditionally,
which mkEnvelope renamed, so an enveloped host warned that four keys were
stale when nothing the operator set could change them.
globalTimeout bounds the whole test, so 45s had to cover the vm boot plus
create-env, synthesis, both analyser passes, truncation and the asserted
synthesis. It was raised from 30 to 45 in c310c0d and is still tight
enough that runner variance can reach it.

300s keeps the override useful for surfacing a hang while leaving room
under the one hour framework default.
Added SIGTERM and SIGINT cases for both ways into the image, scripts mode
and custom mode, asserting docker did not have to SIGKILL after the grace
period.

These were the first four items of the Manual Testing section in
nix/docker/README.md, which nobody ran and which predated merge mode, the
/tmp runtime dir, read-only root and non-root UIDs. Its fifth item, cli
access, is already covered three times here. Dropped the section.

Use util-linux rather than the utillinux alias to resolve eval warn.
Added a submit-api subtest covering scripts mode startup and a metrics
scrape.

Renamed cardanoOciReadonly to cardanoOci. The test has covered more than
read-only roots since its second commit and the name described only the
first.

Grouped the stages into subtests so a failure names its concern rather than
a line number. Kept as one test: the shared cost is the vm, the docker
daemon and four image loads, which a split would pay per test.

All eleven subtests pass in ~120s.
Boot a preview node on `configFormat = "enveloped"` with `withUtxoHdLsmt`
and an envelope-shaped `extraNodeConfig`, and assert the node took the
cardano-config path, that it reported nothing to migrate or ignore, that the
LSM backend resolved with its path, that the envelope-shaped key reached the
resolved configuration, and that `config resolve` on the generated file says
nothing on stderr.

The service assembles the config it envelopes, so this is the only check
that sees one as a host writes it: iohk-nix lints and envelopes environment
configs, which carry neither the flat `V2LSM` pair the service adds nor
anything a caller supplies.

Reading two settings back out of the resolved `NodeConfiguration` is the
part the iohk-nix checks cannot do at all. Those compare against
cardano-config's own output, so a key its adapter never maps is lost
identically on both sides and agrees.
The service writes `Backend = "V2LSM"` with a sibling `LSMDatabasePath`,
which is the legacy spelling of the tagged `Backend.LSM` form. POM reads
`Backend` as a string, so the nested form fails to parse on a legacy config,
and mkEnvelope folds the flat one anyway, which it must do regardless for a
caller supplying the same keys through extraNodeConfig.

Writing the nested form here is therefore gated on no consumer still setting
`configFormat = "legacy"`, and is a single flip at that point rather than a
branch on the dialect. The envelope.nix header lists this as the last of the
four conditions for retiring the translation; this is where the mechanics
live.
The LSM backend can export a standalone copy of each snapshot, which is what
Mithril signing consumes, but the service had no way to ask for one: it set
`LSMDatabasePath` and nothing else.

Emitted only when set, and only under `withUtxoHdLsmt`.
The node resolves relay names from the peer snapshot. With no nameserver the
dns resolver is built from an empty list and throws BadConfiguration, which on
the aarch64 builder escaped diffusion's retry path and took the node down
instead of being retried as it is on x86_64.
@johnalotoski
johnalotoski merged commit 2f4d08e into koslambrou/prepare-11.2 Oct 26, 2026
22 of 41 checks passed
@johnalotoski
johnalotoski deleted the jl/sre-11.2.0 branch October 26, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants