Skip to content

Restore the weekly Evaluate job against latest Plutus, and keep it in sync - #40

Merged
Unisay merged 2 commits into
mainfrom
fix/evaluate-chap-index-state
Jul 7, 2026
Merged

Unisay merged 2 commits into
mainfrom
fix/evaluate-chap-index-state

Conversation

@Unisay

@Unisay Unisay commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

The weekly "Evaluate mainnet scripts" job has been failing in the Evaluate step, before any script runs. add_srp.sh pulls the latest Plutus master, and current master requires cardano-base >= 0.1.5 and aeson >= 2.3, which our pinned index-state and flake inputs did not admit, so cabal could not resolve a build plan.

I reproduced the whole job locally (add_srp.sh for the same master commit, then plan resolution and a full build inside nix develop) and worked through four layers.

Fix (first commit)

  1. Bump the CHaP and Hackage index-states in run-script-evaluations/cabal.project to match Plutus master's own cabal.project (CHaP 2026-06-18 exposes cardano-base 0.1.5.0).
  2. Update the hackage and CHaP flake inputs so haskell.nix's pinned snapshots cover those dates. Without this the solver fails with Cabal-7159 (requested index-state newer than the snapshot).
  3. Add the resolution knobs Plutus master uses for the aeson >= 2.3 cascade (allow-newer: deriving-aeson:aeson, microstache:aeson, constraints: setup.optparse-applicative >=0.19.0.0), plus allow-newer: postgresql-simple:aeson for our own dependency. postgresql-simple still caps aeson < 2.3 at its latest release but builds against 2.3.
  4. Adapt FromField SatInt to a real Plutus API change: Data.SatInt now wraps Int64, so it reads the field as Int64 (fromField @Int64), matching unsafeToSatInt :: Int64 -> SatInt.

Prevent recurrence (second commit)

The index-states were hardcoded, so this breaks whenever master moves a bound past our pins. To keep the compatibility test aligned:

  • add_srp.sh now syncs the cabal.project index-state from the pinned Plutus commit's own cabal.project, read from the prefetched checkout (exact commit, no extra network call).
  • The workflow runs nix flake update hackage CHaP after add_srp.sh so the flake snapshots cover the synced dates.

allow-newer/constraints stay hardcoded: they change rarely, and postgresql-simple:aeson is our own relaxation rather than one Plutus master carries.

Verification

Both executables (run-script-evaluations and value-statistics) build against Plutus master (266f6a0) under GHC 9.6.6. fourmolu and hlint are clean, shellcheck passes on add_srp.sh. The runtime evaluation itself needs the mainnet database, so it is not exercised here.

Unisay added 2 commits July 7, 2026 13:52
The weekly compatibility job could no longer resolve a build plan for
run-script-evaluations: current Plutus master requires cardano-base >=0.1.5
and aeson >=2.3, which the stale index-states and flake inputs did not admit.

- Bump the CHaP and Hackage index-states to match Plutus master's cabal.project
  (CHaP 2026-06-18 exposes cardano-base 0.1.5.0).
- Update the hackage.nix and CHaP flake inputs so haskell.nix's snapshots cover
  those dates.
- Add the allow-newer/constraints Plutus master uses for the aeson >=2.3 cascade
  (deriving-aeson, microstache, setup.optparse-applicative) plus
  postgresql-simple:aeson for our own dependency.
- Adapt FromField SatInt to the new Int64-backed SatInt
  (unsafeToSatInt :: Int64 -> SatInt).

Verified locally: both executables build against Plutus master (266f6a0) under
GHC 9.6.6; fourmolu and hlint are clean.
Keep the weekly Evaluate job from breaking whenever Plutus master moves a
dependency bound past our pinned index-state.

- add_srp.sh now syncs the cabal.project index-state from the pinned Plutus
  commit's own cabal.project (read from the prefetched checkout, so it uses the
  exact commit with no extra network call). We then resolve against the same
  package set Plutus itself is tested with.
- The workflow runs `nix flake update hackage CHaP` after add_srp.sh so
  haskell.nix's pinned snapshots cover the synced index-state dates.

allow-newer/constraints stay hardcoded: they change rarely, and
postgresql-simple:aeson is our own relaxation, not one Plutus master carries.
@Unisay
Unisay requested a review from Copilot July 7, 2026 12:18
@Unisay Unisay self-assigned this Jul 7, 2026

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.

Pull request overview

Restores the scheduled “Evaluate mainnet scripts” workflow by aligning this repo’s Cabal/Nix pins with the requirements of the latest Plutus master, and automates keeping those pins synchronized with the exact Plutus commit being evaluated.

Changes:

  • Updated Cabal index-states and added solver knobs (constraints / allow-newer) to accommodate Plutus’ newer dependency bounds (notably aeson >= 2.3 and cardano-base >= 0.1.5).
  • Enhanced add_srp.sh to sync cabal.project index-states from the prefetched (pinned) Plutus checkout, avoiding drift when Plutus moves bounds.
  • Updated the weekly workflow to refresh the hackage/CHaP flake inputs after syncing index-states, and adapted a DB decoding orphan (SatInt) to an upstream Plutus API change (Int64-backed).

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
run-script-evaluations/run-evaluations/Database/PostgreSQL/Simple/Orphans.hs Adjusts FromField SatInt to read Int64, matching updated Plutus SatInt representation.
run-script-evaluations/flake.lock Updates pinned hackage.nix and cardano-haskell-packages inputs to cover newer index-states.
run-script-evaluations/cabal.project Bumps index-states and adds constraints/allow-newer needed for Plutus master’s dependency set.
run-script-evaluations/add_srp.sh Syncs cabal.project index-states from the pinned Plutus commit’s cabal.project (no extra network fetch).
.github/workflows/evaluate.yml Runs nix flake update for hackage and CHaP after add_srp.sh so haskell.nix snapshots cover the synced index-states.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Unisay
Unisay marked this pull request as ready for review July 7, 2026 12:25
@Unisay
Unisay merged commit 0d11916 into main Jul 7, 2026
3 of 4 checks passed
@Unisay
Unisay deleted the fix/evaluate-chap-index-state branch July 7, 2026 12:25
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.

2 participants