UPLC-CAPE: Network profiles measure and report submissions per network

Aperta
#281 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@Unisay ci sta già lavorando.

Dal 25/11/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

UPLC-CAPE

CAPE measures every submission with the cost model built into the linked plutus-core (1.63) and passes no protocol version. A network profile makes the network explicit: a named set of data (protocol version, cost-model parameters and the other protocol parameters CAPE's numbers depend on) under which every measurement and every report page is computed. This issue makes the profile an entity of the domain model and of the report, and implements the design recorded in ADR 20260526, Refinement 5, "If a network gets ahead of mainnet".

Profile

A profile is data in the repository, one file per profile. A sketch of the type:

data NetworkProfile = NetworkProfile
  { profileName            :: Text                 -- for example "mainnet-pv11", "preview"
  , profileNetwork         :: Network              -- Mainnet | Preview
  , profileStatus          :: ProfileStatus        -- Past | Current | Future
  , profileProtocolVersion :: MajorProtocolVersion
  , profileCostModelV3     :: [Int64]              -- in on-chain order
  , profileParameters      :: ProtocolParameters   -- prices, ref-script fee, tx limits
  , profileSource          :: ProfileSource        -- OnChain EpochNo | Projected
  , profileActiveFrom      :: Maybe (EpochNo, Day) -- hard fork on this network; Nothing if not yet
  }

ProtocolParameters is a new record for the values that are top-level constants in lib/Cape/Protocol/Parameters.hs today. A typical set is mainnet at its previous, current and next protocol version, plus Preview while it runs ahead of mainnet. A past or current profile copies its values from the chain at a named epoch. A future profile has no on-chain values yet, so it takes the parameters that plutus-core ships for its protocol version and is marked as projected.

Measurement

Every evaluation takes a profile, which replaces runCekDeBruijn defaultCekParametersForTesting in lib/Cape/PrettyResult.hs:

  • Each script is decoded with deserialiseScript at the profile's protocol version. A builtin that the version does not allow is rejected here.
  • Validators run through PlutusLedgerApi.V3.evaluateScriptCounting, with an evaluation context that mkEvaluationContext builds from the profile's cost model.
  • Scenarios that return a value, such as fibonacci, run on the CEK machine with machine parameters from the same profile. Before that, they need the UPLC version check that the ledger does separately (plcVersionsAvailableIn).

When a profile does not admit a submission, CAPE records the submission as not executable on that profile. This result is kept apart from a test that is expected to fail.

Report

Each profile gets its own report under its own URL (for example profiles/mainnet-pv11/): rankings, scenario pages and the evolution view, all computed from that profile's measurements. The current mainnet profile is the default. A submission appears in every profile that admits it, and each profile lists the submissions it does not admit. A submission keeps one artifact; only its cost changes from one profile to another.

A timeline page puts the profiles of each network in order: the protocol version, the epoch and date it took effect, and a link to its report. A visitor can follow how mainnet changed and see which profile was in force on a given date. A future profile sits at the end of its network's line, marked as projected.

Upgrades

A newer plutus-core keeps the behaviour of earlier protocol versions, so an upgrade should leave every profile's results and budgets unchanged. CI compares them per profile before and after the upgrade. This replaces the current rule that an evaluator upgrade re-measures every submission.

Open questions

  • How metrics.json stores results per profile, and how the schema change treats existing submissions.
  • How profile values are refreshed from the chain, and when a future profile becomes the current one.
  • Whether aggregates compare profiles with each other or stay within one profile.

Out of scope: a different compiler per profile. The compiler decides what the program is, and the profile decides what it costs.

Lingua principale
Untyped Plutus Core
Stelle
12
Fork
10
Merge medio
2g 5h
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di IntersectMBO/UPLC-CAPE

Tutte le issue di IntersectMBO/UPLC-CAPE

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.