Repository navigation
Bump cardano-ledger-binary to >=1.9.1 to fix reversed relay IPv4 byte order - #1451
Merged
Merged
Conversation
carbolymer
marked this pull request as ready for review
September 25, 2026 09:15
carbolymer
requested review from
a team,
Jimbo4350,
disassembler,
kevinhammond and
palas
as code owners
September 25, 2026 09:15
carbolymer
force-pushed
the
mgalazyn/fix/ipv4-relay-byte-order
branch
2 times, most recently
from
September 25, 2026 09:15
1511798 to
bfd7463
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Add a regression fixture or assertion covering known IPv4 relay bytes.
Review effort: Lite
Findings: None
What changed in this PR
Updates Cardano package inputs to require cardano-ledger-binary >=1.9.1, fixing IPv4 relay byte-order handling.
Changes:
- Updates CHaP lock and index state.
- Adds the dependency constraint.
- Adds a bugfix changelog fragment.
| File | Description |
|---|---|
flake.lock |
Updates the CHaP revision and hash. |
cabal.project |
Updates the package index state and dependency constraint. |
.changes/fix-ipv4-relay-byte-order.yml |
Documents the IPv4 relay fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3 of 4 tasks
Scitz0
added a commit
to cardano-community/guild-operators
that referenced
this pull request
Oct 20, 2026
## Description cardano-cli 11.2.1.0 through 11.2.3.1 write a stake pool relay's IPv4 address into registration certificates with its four bytes reversed, so `89.233.105.53` is registered on chain as `53.105.233.89`. `query pool-state` and `debug transaction view` decode it the same wrong way: correctly registered relays look reversed, and the reversed certificates look correct. The fault is in cardano-ledger-binary 1.9.0.0. cardano-cli 11.3.0.0 fixed it by requiring cardano-ledger-binary 1.9.1.0 ([cardano-cli#1442](IntersectMBO/cardano-cli#1442), [cardano-cli#1451](IntersectMBO/cardano-cli#1451)). DNS and IPv6 relays are not affected. CNTools passes `--pool-relay-ipv4` (`scripts/cnode-helper-scripts/cntools.sh`), so pool registrations and updates with IPv4 relays built on the current deployment (cardano-cli 11.2.3.1) are affected. - Deploy cardano-cli 11.4.0.0 (`files/docker/node/release-versions/cardano-cli-latest.txt`). The change triggers the Docker image build. - Use 11.4.0.0 as the `guild-deploy.sh` download fallback. - Raise the `env` minimum to cardano-cli 11.4.0, so scripts stop running with an affected release until the binaries are redeployed. cardano-node stays at 11.1.3. No deployed configuration files are changed. ### Compatibility: cardano-cli 11.2.3.1 → 11.4.0.0 - **Node-to-client:** node 11.1.3 and cli 11.4.0.0 both use NodeToClientV_23; no newer version exists yet. - **Breaking changes upstream:** 11.3.0.0 removes `node issue-pop-BLS` and `node key-hash-BLS`. 11.4.0.0 removes `--script-valid`/`--script-invalid` for the Dijkstra era only; Conway keeps both. None of these are used by the scripts. - **Release assets:** `cardano-cli-11.4.0.0-{x86_64,aarch64}-linux.tar.gz` keep the `cardano-cli-<arch>-linux` member that `guild-deploy.sh` extracts. Both match the published `sha256sums.txt` and GitHub asset digests. ### Reviewer notes - The higher `env` minimum also rejects hosts that build node 11.1.3 from source with `cabal-build-all.sh`, because its dependency plan includes cardano-cli 11.2.3.0. Those hosts need the 11.4.0.0 binary (`guild-deploy.sh -s d`), or a cli built at tag `cardano-cli-11.4.0.0`. - Pools that already registered or updated IPv4 relays with cli 11.2.1.0–11.2.3.1 have a reversed address on chain and need to submit a pool update with the fixed cli. - This PR has not been run end to end on a Linux host; the deploy-path check was syntax plus the release download URLs, which return HTTP 200 for both architectures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
Scitz0
added a commit
to cardano-community/guild-operators
that referenced
this pull request
Nov 13, 2026
…relay IPv4 (#1926) ## Description #1917 moved alpha to cardano-cli 11.4.0.0 on the basis that 11.3.0.0 fixed the reversed relay IPv4 bytes ([cardano-cli#1442](IntersectMBO/cardano-cli#1442)). The fix did not work: 11.3.0.0, 11.3.1.0 and 11.4.0.0 still write the four bytes reversed. 11.5.0.0 is the first release that writes them correctly. ### Why the upstream fix did not work [cardano-cli#1451](IntersectMBO/cardano-cli#1451) (in 11.3.0.0) added `constraints: cardano-ledger-binary >=1.9.1`. 1.9.1.0 has the fix, but the solver chose cardano-ledger-binary 1.10.0.0. It was published to CHaP on 2026-10-01 from ledger `master`, which still had the little-endian codec (`putWord32le . fromIPv4w`). The 1.10 series got the fix in 1.10.1.0 ([cardano-ledger#6187](IntersectMBO/cardano-ledger#6187)), and 11.5.0.0 is the first cardano-cli release whose CHaP index-state (2026-10-21) includes it. The symbol names in each release binary show the linked version: | cardano-cli | cardano-ledger-binary | relay IPv4 | |---|---|---| | 10.16.0.0 | 1.8.0.0 | correct | | 11.0.0.0 | 1.8.1.0 | correct | | 11.2.1.0, 11.2.2.0, 11.2.3.0, 11.2.3.1 | 1.9.0.0 | reversed | | 11.3.0.0, 11.3.1.0, 11.4.0.0 | 1.10.0.0 | reversed | | 11.5.0.0, 11.6.0.0, 11.7.0.0 | 1.10.1.0 | correct | 11.1.0.0 and 11.2.0.0 are tags without release binaries. ### Changes - Deploy cardano-cli 11.5.0.0 (`files/docker/node/release-versions/cardano-cli-latest.txt`). The change triggers the Docker image build. - Use 11.5.0.0 as the `guild-deploy.sh` download fallback. - Raise the `env` minimum to cardano-cli 11.5.0, so scripts stop running with 11.4.0.0 until the binaries are redeployed. cardano-node stays at 11.1.3. No deployed configuration files change. ### Compatibility: cardano-cli 11.4.0.0 → 11.5.0.0 - **Changelog:** `debug check-node-configuration` is stricter and prints its success message to stderr (breaking), and Dijkstra transaction views show direct deposits. Alpha scripts use neither. - **cntools-rebuild** already pins 11.5.0.0 next to node 11.1.3 (#1923), so this matches what that branch deploys. - **Release assets:** `cardano-cli-11.5.0.0-{x86_64,aarch64}-linux.tar.gz` keep the `cardano-cli-<arch>-linux` member that `guild-deploy.sh` extracts, and both match the GitHub asset digests. ### Testing Every x86_64 release asset from 10.16.0.0 to 11.7.0.0 (digests checked) built the same registration certificate with an IPv4, an IPv6, a DNS and an SRV relay. The relay arguments were passed in the order CNTools uses. Each release then ran `transaction build-raw` and `transaction sign` on its own certificate, and the relay bytes were read from the CBOR at each step: - IPv4 `65.21.107.182` should be `41156bb6`. 11.2.1.0 to 11.4.0.0 write `b66b1541` into the certificate, and build-raw and sign keep it. - IPv6, DNS and SRV relays are the same bytes in every release. - Every release keeps the bytes when it signs a body built by 10.16.0.0, so an offline signer on an affected release does not change the relays. - Every release keeps the bytes when it builds a transaction from a certificate made by 10.16.0.0. - In `debug transaction view`, 11.2.1.0 to 11.4.0.0 show the correct certificate as `182.107.21.65` and their own reversed one as correct. 11.5.0.0 and later show both as they are on chain. Also: - The `guild-deploy.sh` cardano-cli download and extract steps with 11.5.0.0 give a binary that writes `89.233.105.53` as `59e96935`. The aarch64 binary links cardano-ledger-binary 1.10.1.0 too, but was not run. - The new minimum rejects 11.2.3.1, 11.3.1.0 and 11.4.0.0, and accepts 11.5.0.0 and later. - `bash -n` and `shellcheck -S error` on `env` and `guild-deploy.sh`: clean. - Not run here: 11.5.0.0 queries against a running node 11.1.3. In an earlier check against node 11.1.3 on preprod, 11.4.0.0 and 11.7.0.0 returned the same JSON for the queries CNTools runs. ### Reviewer notes - Pools that registered or updated IPv4 relays with cardano-cli 11.2.1.0 to 11.4.0.0 have the address reversed on chain, including pools updated with alpha since #1917. They need to submit a pool update with 11.5.0.0 or later. - Those releases also show correctly registered relays reversed, so checking a registration with them gives the wrong answer. - cardano-node 11.1.3 links cardano-ledger-binary 1.9.1.0, so the node itself reads relays correctly. - As with #1917, hosts that build node 11.1.3 from source with `cabal-build-all.sh` get cardano-cli 11.2.3.0 from the node's plan, and the new minimum rejects it. They need the 11.5.0.0 binary (`guild-deploy.sh -s d`). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Fixes #1442 (cross-post of input-output-hk/ouroboros-leios#974).
Since cardano-cli 11.2.1.0,
stake-pool registration-certificate --pool-relay-ipv4writes the relay address into the certificate with its four bytes reversed, so89.233.105.53lands on chain as53.105.233.89.The decoder mirrors the mistake, so
query pool-stateanddebug transaction viewshow correctly registered relays reversed while showing our own reversed certificates as correct.IPv6 and DNS relays are not affected.
The fault is in cardano-ledger-binary 1.9.0.0, which switched the IPv4 codec from iproute's host-address conversion to the raw address word while keeping the little-endian serialiser (IntersectMBO/cardano-ledger#5611).
cardano-ledger-binary 1.9.1.0, published to CHaP on 2026-09-22, restores network byte order.
That fix currently lives only on the
release/cardano-ledger-binary-1.9.1.0branch; ledgermasterstill carries the reversed codec.This PR bumps the CHaP index-state and the CHaP flake input so the solver can see 1.9.1.0, and adds a lower bound as a
cabal.projectconstraint.The bound is not in
build-dependsbecause cardano-cli imports nothing from cardano-ledger-binary and the build uses-Wunused-packages.No cardano-cli test covers the relay IPv4 bytes today; the only occurrences of
--pool-relay-ipv4undertest/are help goldens.A golden test for the certificate CBOR is a sensible follow-up.
How to trust this PR
The affected byte sequence in the certificate is the port followed by the IPv4 bytestring.
With the released 11.2.3.1 the certificate contains
190bc2443569e959(port 3010, then35 69 e9 59).With cardano-ledger-binary 1.9.1.0 it must contain
190bc24459e96935.The same check against a certificate produced by cardano-cli 11.0.0.0 must render
89.233.105.53indebug transaction view.Checklist
.changes/