Conversation
Jimbo4350
force-pushed
the
jordan/dijkstra-testnet-start-test
branch
from
September 29, 2026 15:16
e917c47 to
ad0be01
Compare
… era
Add `hprop_hardfork_to_dijkstra` ("Hard fork to Dijkstra"), which starts
the default three-node cluster in Conway at protocol version 10 and hard
forks it through governance, the way mainnet will:
1. a HardForkInitiation action to PV 11.0 (Conway intra-era hard fork),
voted for by the three default DReps and the default SPO, ratified
and enacted;
2. a chained HardForkInitiation action to PV 12.0, voted, ratified and
enacted.
It then asserts that `query tip` and the ledger state served over
node-to-client both report the Dijkstra era, and reuses the existing
block-production and clean-shutdown check.
Set `ExperimentalHardForksEnabled: true` in the generated node
configuration for every era. Without it the node declares PV11 as its
maximum protocol version, so once the ledger enacts PV12 it rejects its
own blocks with `ObsoleteNode` and the chain stalls. The golden default
node configuration is updated accordingly.
Note: with the currently pinned ouroboros-consensus 4.2.1.0 the
governance part of this test succeeds (PV 10 -> 11 -> 12 is enacted and
the node keeps forging at PV12) but the era assertion fails: the cluster
stays in Conway at PV12. `protocolInfoCardano` builds the Conway ledger
config with `TriggerHardForkNotDuringThisExecution`, so neither the
version trigger nor `TestDijkstraHardForkAtEpoch` can move it into
Dijkstra. The fix is IntersectMBO/ouroboros-consensus#2167, not yet in a
release.
Jimbo4350
force-pushed
the
jordan/dijkstra-testnet-start-test
branch
from
September 29, 2026 18:28
ad0be01 to
d5c25ac
Compare
Add `hprop_nested_transaction_swap` ("Nested transaction swap"). It mints
100 TokenA to Alice in Conway and funds Bob, hard forks the cluster into
Dijkstra through governance (shared with the "Hard fork to Dijkstra"
test), then settles a multi-asset swap with a nested transaction built
with `cardano-cli dijkstra transaction sub-transaction`:
* Alice's sub-transaction spends her 100 TokenA and pays herself 53 ADA
(50 ADA price + the 3 ADA that travelled with the tokens);
* Bob's sub-transaction spends 60 ADA and pays himself the 100 TokenA
plus 7 ADA change, i.e. exactly 50 ADA;
* the batcher's top-level transaction embeds both signed
sub-transactions and pays the fee.
Each sub-transaction is guarded by and signed with its owner's key only.
The proof is read back from `query utxo`: Bob holds the 100 TokenA, Alice
gained exactly 50 ADA, Bob lost exactly 50 ADA, the batcher paid the fee.
The test needs a cardano-cli with the sub-transaction commands
(IntersectMBO/cardano-cli#1453), pointed at via CARDANO_CLI. It does not
assert the era after the hard fork on purpose, so that on a consensus that
never leaves Conway the failure shows up at submission ("The node is
running in the Conway era, but the transaction is for the Dijkstra era").
Supporting changes:
* `Testnet.Components.Query.stopEpochStateView` stops the client-side
ledger fold behind an EpochStateView. cardano-api 11.7's ledger event
conversion has no Dijkstra case and dies on the first Dijkstra block,
so both Dijkstra tests stop the view before PV12 can be enacted, keep
the epoch state logger off, and observe the node through the CLI.
* `hardForkToDijkstra` waits for PV12 via `query protocol-parameters`
and the era assertion now explains that a Conway answer means the
pinned consensus ignores the Dijkstra trigger.
… Dijkstra" Temporarily point ouroboros-consensus at IntersectMBO/ouroboros-consensus@0ebed78d, which is the 4.2.1.0 release plus the cherry-picked commit from IntersectMBO/ouroboros-consensus#2167 (branch jordan/4.2.1.0-allow-hardfork-into-dijkstra). No 4.x release contains that change yet; without it the Conway ledger config is built with TriggerHardForkNotDuringThisExecution and the node can never enter the Dijkstra era, so the "Hard fork to Dijkstra" test fails at the era assertion. With this SRP the "Hard fork to Dijkstra" test passes: the governance hard fork to PV12 moves the node into Dijkstra and `query tip` reports the Dijkstra era. The "Nested transaction swap" test now reaches the Dijkstra ledger and is rejected with SubBadInputsUTxO, because UTxO-HD key fetching (getTransactionKeySets via allInputsTxBodyF) does not load sub-transaction inputs; that is a separate consensus/ledger fix. Replace with a released ouroboros-consensus once one is available.
This branch has not been deployed
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.
Description
Two
cardano-testnetintegration tests for Dijkstra, plus the config change they need.Hard fork to Dijkstra starts the default three-node cluster in Conway at protocol version 10 and hard forks it through governance, the way mainnet will: a
HardForkInitiationaction to PV 11.0 (voted for by the three default DReps and the default SPO, ratified, enacted), then a chainedHardForkInitiationaction to PV 12.0. It then asserts that the node reports theDijkstraera and keeps producing blocks.Nested transaction swap additionally mints 100
TokenAto Alice in Conway and funds Bob, then, once at PV12, settles a multi-asset swap with a Dijkstra nested transaction built withcardano-cli dijkstra transaction sub-transaction(IntersectMBO/cardano-cli#1453, viaCARDANO_CLI): Alice's sub-transaction gives 100TokenAfor 53 ADA, Bob's gives 60 ADA for the 100TokenAplus 7 ADA change, the batcher's top-level transaction embeds both and pays the fee. Each party signs only its own sub-transaction. Proof is read back fromquery utxo: Bob holds the tokens, Alice gained exactly 50 ADA, Bob lost exactly 50 ADA, the batcher paid the fee.Testnet/Defaults.hsnow setsExperimentalHardForksEnabled: truefor every era. Without it the node declares PV11 as its maximum and, once PV12 is enacted, rejects its own blocks withObsoleteNodeand the chain stalls. Golden config updated.Testnet.Components.Query.stopEpochStateViewlets a test stop the client-side ledger fold before the chain enters an era that fold cannot process.Status
cabal.projecttemporarily pointsouroboros-consensusat IntersectMBO/ouroboros-consensus@0ebed78d (branchjordan/4.2.1.0-allow-hardfork-into-dijkstra): the 4.2.1.0 release plus the cherry-picked commit from IntersectMBO/ouroboros-consensus#2167 ("Allow hardfork into Dijkstra"). No 4.x release contains it; without it the Conway ledger config is built withTriggerHardForkNotDuringThisExecutionand the node never enters Dijkstra. To be replaced by a released version.query tipreportsDijkstra, blocks keep coming. On plain 4.2.1.0 it fails at the era assertion withThe node is not in the Dijkstra era after protocol version 12 was enacted: Just (String "Conway").SubBadInputsUTxOfor every sub-transaction input, plusValueNotConservedUTxOat the top level. Cause: UTxO-HD key fetching (getTransactionKeySets/getBlockKeySetsviaallInputsTxBodyF) does not load sub-transaction inputs, so the ledger sees them as missing. Present in consensus 4.2.1.0 and main, and in ledger's DijkstraallInputsTxBodyF(0.3.0.0 and master). With a consensus-side fix that includes sub-transaction inputs, the swap passes end to end (verified locally, not part of this PR).Also found: cardano-api's
ConvertLedgerEventinstance for the hard fork block has noDijkstraLedgerEventcase (11.7.0.0 and master), sofoldBlocks/foldEpochStateclients crash on the first Dijkstra block. The tests therefore stop the epoch state view before PV12 and keep the epoch state logger off.Run with:
Checklist
CHANGELOG.mdfor affected package (changelog fragment incardano-testnet/.changes/).cabalfiles are updated🤖 Generated with Claude Code