Skip to content

Backport Receiving ledger compatibility to 5.x - #3

Open
colll78 wants to merge 9 commits into
ouroboros-consensus-5.x-backportsfrom
codex/cip-160-receiving-5x
Open

colll78 wants to merge 9 commits into
ouroboros-consensus-5.x-backportsfrom
codex/cip-160-receiving-5x

Conversation

@colll78

@colll78 colll78 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

Support protected addresses and per-output Receiving through the existing consensus adapters. Purposes use each output’s original body-local index; identical outputs retain separate redeemers and budgets, including parent/child capacity accounting.

wire transaction → applyTx → recipient authorization + ledger-table state
parent + child indexed redeemers → combined execution-unit capacity

Receiving tracing uses raw indexes. Missing-redeemer diagnostics preserve every purpose sharing a script hash: singleton JSON keeps its shape, while multiple purposes form a source-order array. Tracing also covers UnsupportedOutputAddresses; regressions include singleton, forward/reversed ordering and updated goldens. Tools fixtures use the required 369-entry V4 model and correct genesis hash, with independent temporary databases for synthesis, analysis and truncation.

Follow the upstream six-field NewEpochState: Praos and both ticked/unticked Peras views read the current set-snapshot pool distribution through nesStakePoolDistrG. Initial test-network snapshot seeding delegates to the ledger’s injectIntoTestState, replacing consensus duplication. The normal project pins ledger 4b06e253 and includes eras/shelley/test-suite, selecting the migrated 1.10.0.1 rather than the stale published test library.

Genuine owning encoders refresh the 16 disk goldens for NES 7→6 and Mark 3→4. Published release successor bb55e647 changes only those fixtures on parent 8268ddc7; the same refreshed bytes are validated on main.

This backport targets ouroboros-consensus-5.x-backports, retaining version 5.1.0.0 under the dependency-bound policy. API/node consumers retain their 5.1 bounds; main proposal #2 carries the corresponding changes. The compatibility source and its fixture-only successor bb55e647 are published.

Evidence

GitHub Actions runs in this fork. Earlier upstream CI links are historical evidence.

Local compilation/runtime uses GHC 9.6.7 and the coordinated native graph (crypto -external-libsodium-vrf, blockio +serialblockio). Default-flag public-source solver/Nix evidence is separate.

The preceding release checkpoint passed the complete 240-test tracing suite and two Dijkstra encoding goldens, plus the original admission/capacity and parallel-tools regressions. Its ordinary compiler/native checks passed, while the exact-seed CSJ issue below remained unresolved. These full-suite results retain their pre-snapshot-refactor scope.

  • The current release cardano library and complete owning Cardano/tools test targets compile strictly. All 11 admission/capacity tests pass: actual wire decoding, missing-recipient rejection, successful applyTx, ledger-table equality, and distinct output budgets through parent/child capacity accounting.
  • The genuine fixture-only migration passes all 18 ordinary disk comparisons (two Shelley and 16 Cardano), 16 independently checked codec changes and four unchanged Byron byte controls. Production/test assertions and all other files are unchanged.
  • All 20 tools tests pass with two workers. All three Dijkstra Header/GenTx/GenTxId CDDL checks pass using genuine Cuddle 1.8.1.0 and cddlc 0.4.2 with current data directories. Actual binary/source/plan/tool hashes and logs are retained.
  • Changed Haskell files pass Fourmolu 0.20 and git diff --check. Distinct main 5.0 compilation and selected 18/11/20/3 runtimes also pass, using its default flags with scoped private native VRF directories and recorded runtime library paths.
  • Both normal native projects pass default/all and tests-enabled resolution: 622 components, including all 46 owning components. Both isolated default Nix devShell derivation evaluations pass with 621/46 components. Public ledger source/archive identity and selection of the migrated Shelley test suite were verified. This establishes resolution/evaluation, without a completed default Nix build or runtime claim.
  • The ledger Foreign-interface group passes 19 tests, including actual genesis set/go seeding with the live epoch-zero committee and pool cache. This supports the delegated seeding change; it does not establish broad forecasting or Leios protocol behavior.
  • Fresh release-backport consumers pass the retries-disabled real Dijkstra Receiving/same-database relay lifecycle: missing-recipient rejection, inclusion of four protected outputs with two distinct V4 redeemers, complete LSQ/fresh API replay identity through restart, and spending through the restored relay. This is current-format restoration, without snapshot-specific or old-format restoration claims.

Depends on ledger #1, Plutus #1, keys #2 and config #2. The recorded proposal SRPs keep this fork reproducible. Upstream integration would separately require accepted commits or released packages under upstream SRP policy.

Merge Danger

Door: two-way

Blast Radius: Consensus

Old persisted NES/Mark states require replay after the upstream state-format transition. Current-format same-database restart does not establish old-format or snapshot restoration. The fixture correction is public at bb55e647. At the historical upstream 15:52 UTC checkpoint, three checks pass, four GHC jobs are running and required Linux Hydra is queued, with no failed check at that head. Upstream dependency acceptance, scheduled activation/rollback and Leios endorser-block lifecycle coverage remain external gates.

Parent release 8268ddc7 has a separate GHC 9.10 storage failure without an emitted assertion/counterexample/signal or available test-log artifact; its cause is unclassified. The same exact release storage suites pass 112 tests on GHC 9.6 and 9.14. Those peer passes do not classify the failure as a flake. It is documented here, with no storage repair included.

The release backport retains a deterministically reproduced CSJ counterexample: the normalized exact-seed trace matches CI and identifies accepted-prefix loss after the documented new-dynamo reset. Whether the cumulative test bound exceeds the protocol guarantee remains unresolved; a later random pass does not discharge it. No peer-selection policy or assertion is changed here.

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.

1 participant