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

Đang mở
#281 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@Unisay đang làm issue này rồi.

Từ ngày 25/11/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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.

Ngôn ngữ chính
Untyped Plutus Core
Star
12
Fork
10
Merge trung bình
2 ngày 5 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của IntersectMBO/UPLC-CAPE

Tất cả issue của IntersectMBO/UPLC-CAPE

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.