Repository navigation
Merge upstream CardanoSolutions/kupo master at 1c73467 - #25
Conversation
Update cabal.project constraints and index-state for cardano-node 11.0.1 (ouroboros-consensus 3.0.1, cardano-ledger-conway >= 1.22.1). Pin validation < 1.2 to avoid breaking API change. Update ogmios source-repository-package to rebased node-11.0 branch. Bump dependency bounds in package.yaml. Co-Authored-By: Claude <noreply@anthropic.com>
Add BlockDijkstra and DijkstraEra pattern matches across block processing, scripts, transactions, and Hydra/Ogmios modules. Dijkstra transactions are coerced to Conway at the block-processing boundary since the types are representationally identical. Replace unsafeCoerce in Metadata era translation with explicit pattern match and translateTimelock. Update Prelude era list and codec config. Co-Authored-By: Claude <noreply@anthropic.com>
…wayEra Replace the unsafeCoerce-based approach to Dijkstra era handling with proper TransactionDijkstra constructors and explicit era conversion functions. Change the Metadata, Output, Script, and BinaryData type aliases from ConwayEra to DijkstraEra and add the necessary upgrade paths through all era conversion functions using Ledger.Dijkstra.upgradeTimelock. Add cardano-ledger-dijkstra as an explicit dependency. Co-Authored-By: Claude <noreply@anthropic.com>
Replace unsafeBinaryDataFromBytes with Ledger.dataToBinaryData and Ledger.upgradeData for era conversions. With BinaryData now aliased to DijkstraEra, fromDijkstraBinaryData and toDijkstraBinaryData simplify to identity. Uses coerce for the phantom era parameter in Conway datum conversions. Co-Authored-By: Claude <noreply@anthropic.com>
Replace Timelock ConwayEra with DijkstraNativeScript DijkstraEra and simplify scriptFromBytes to decode directly at DijkstraEra instead of decoding at ConwayEra and upgrading. Removes the extra upgradeTimelock and fromConwayScript steps from fromNativeScript. Co-Authored-By: Claude <noreply@anthropic.com>
Add comment noting that ouroboros-network provides a general ToJSON (Point block) instance that conflicts with this one. Co-Authored-By: Claude <noreply@anthropic.com>
Use Ledger.dataToBinaryData with Ledger.upgradeData for Alonzo and Babbage era data conversions, removing the HasCallStack constraint from fromAlonzoData and the intermediate type annotation from fromBabbageData. Co-Authored-By: Claude <noreply@anthropic.com>
These Conway-era datum conversions are dead code now that the Datum, BinaryData, and Output types are all aliased to DijkstraEra. Co-Authored-By: Claude <noreply@anthropic.com>
The previous genServerPort (1024 + size + arbitrary) could generate privileged ports below 1024 and duplicate ports across iterations, causing bind failures. Replace with OS-assigned ephemeral ports via bind-to-zero on localhost. Also use newEnvironmentWith throwIO so test failures surface the real exception instead of opaque ExitFailure 1. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
This is only used to pull in the fast-bech32 module, which is not impacted by the hard fork at all.
Buildjet has shut down, and github does provide arm runners nowadays.
- Make `Dynamically add pattern` like the original, i.e. at tip - Make `Can restart with same arguments` totally reliable (was flaky)
Make sure of rollback after adding patterns, by waiting until last checkpoints goes back to an earlier point.
56daed2 to
afc0cc4
Compare
| -- Add stakeA pattern forcing rollback to last Byron block | ||
| putNewPattern 1447 stakeA lastByron `shouldReturn` True | ||
| -- Wait for rollback (checkpoints should go back in time) | ||
| eventually (hasNotReachedPoint 1447 lastByron136K) |
There was a problem hiding this comment.
Polling can miss the rollback because syncing resumes immediately. Could this wait for both expected matches and the target checkpoint instead? That would also wait for replay to finish before asserting the results.
There was a problem hiding this comment.
Done in fdf5b00. The test now waits until both matches are in the window, then until the checkpoint reaches lastByron136K, and only then asserts the patterns and matches.
hasNotReachedPoint and hasNotReached had no other users, so I removed them.
| ,"--workdir", dir | ||
| ] $ eventually (hasReachedPoint 1448 pointC) | ||
| -- Change permissions on database's directory | ||
| makeUnwritable dir |
There was a problem hiding this comment.
The previous test made the database files unwritable too; this only changes the directory. Could we restore that and run this case without sudo so the permissions are actually enforced?
There was a problem hiding this comment.
Restored in f9192e3: the test makes every file in the database directory unwritable again, as well as the directory itself.
This case now runs in its own CI step without sudo, before the sudo step, which skips it: 02ae596. The step first runs sudo chmod a+w on the node socket so that the runner user can connect to the node.
Brings in upstream's v2.12.0 work: the asset quantity encoding fix, custom database indexes through KUPO_INDEX_* environment variables, PlutusV4 script decoding for Hydra and Ogmios, the accept test suite, benchmarks and API docs. Where both sides changed the same code, the fork's version stays: Dijkstra era support with sub-transactions, the cardano-node 11.2 dependency set, gated migrations and the split CI workflows. The Alonzo part of upstream 8f32e3b is not taken, because upgradeData re-encodes the datum and loses its original bytes.
afc0cc4 to
cff3e2d
Compare
The upstream merge moved four node tests that the integration job ran from the unit suite into the new accept suite, so the job now builds and runs accept as well. It runs against the synced preprod node, with kupo and a cardano-cli fetched from the Hydra cache; the two known-flaky tests stay skipped under their new names.
The checkpoint checks called head, which GHC 9.12 flags with -Wx-partial. They now use listToMaybe and treat an empty list as a failed check, which the callers already guaranteed cannot happen.
Without PRAGMA analysis_limit, PRAGMA optimize can read whole indexes, which takes hours on large databases and stalls chain sync at start-up (CardanoSolutions#209). Set the limit to 1000 on every connection that runs optimize: the long-lived connection, the short-lived ones the garbage collector opens, and the connection that finalises a copy. SQLite 3.46 applies such a limit by itself, but kupo bundles 3.45.
cff3e2d to
f9192e3
Compare
This merges upstream CardanoSolutions/kupo master at
1c73467into the fork with a real merge, so the next upstream sync starts from1c73467instead of the fork point3944e06. With the follow-up commits it completes the upstream port tracked in IntersectMBO/kupo issue 24.From upstream
application/jsonresponses give asset quantities as integers again; only requests that ask for strings in theAcceptheader get strings.KUPO_INDEX_*environment variables, combined with the fork's gated migrations.accepttest suite, which takes six node tests out ofunit, plus benchmarks, API docs and the v2.12.0 changelog section.Kept from the fork
Where both sides changed the same code, the fork's version stays: Dijkstra era support with sub-transactions, the cardano-node 11.2 dependency set, gated migrations and the split CI workflows. Upstream's own Dijkstra code, written for cardano-node 11.0, is dropped where the fork already covers it, and upstream's
build.yamlstays deleted. The Alonzo part of upstream8f32e3bis not taken, becauseupgradeDatare-encodes the datum and loses its on-chain bytes. The README compatibility row for v2.12 names cardano-node 11.1 and 11.2.Follow-up commits
ci: run the accept suite against the preprod nodeaddskupo-tests-acceptto the flake and runs it in the integration job, withkupoand a cachedcardano-clionPATH. Four of the moved tests ran in this job before, so without this they would run nowhere. The two flaky tests stay skipped under their new names.Avoid partial list functions in the accept suiteclears two-Wx-partialwarnings.Bound the statistics scan of PRAGMA optimizesetsPRAGMA analysis_limit = 1000on every connection that runsPRAGMA optimize(start-up, garbage collection and copy finalisation) and in theMakefile. Without it,optimizecan scan whole indexes for hours on large databases and stall chain sync. SQLite 3.46 applies such a limit by itself, but kupo bundles 3.45.The Dockerfile lint and the witness datum fix moved to their own PRs:
Testing
nix build .#kupo .#kupo-tests .#kupo-tests-acceptbuilds with no GHC warnings insrc/,app/,test/andtest-accept/.KUPO_INDEX_*variable adds exactly its index.acceptsuite and the integration job have not run yet; they need the preprod node in CI.Reviewing
GitHub lists upstream's 66 commits as part of this PR. To see only how the conflicts were resolved, run
git show --remerge-diff a816aa4. Please merge with "Create a merge commit": a squash or rebase merge drops the merge, and the next sync would start from3944e06again.Closes #24
Related issues: