conformance
Safe HaskellNone
LanguageGHC2021

Conformance.PurposeUnits

Description

Per-purpose evaluation and declaration arithmetic. Failed evaluations carry errors, never fabricated measurements.

Synopsis

Documentation

type PurposeUnits = Map Text (Integer, Integer) Source #

type PurposeMeasurements = Map Text (Either Text (Integer, Integer)) Source #

doublePurposeUnits :: PurposeUnits -> PurposeUnits Source #

Preserve each purpose's own measured pair when applying the 2x headroom.

fallbackBelowMaximum :: PurposeUnits -> Maybe (Integer, Integer) Source #

A fixture budget one unit below each component of the measured maximum.

maximumPurposeUnits :: PurposeUnits -> Maybe (Integer, Integer) Source #

The componentwise maximum across the script-purpose evaluation map.

allocatePurposeUnits :: (Integer, Integer) -> (Integer, Integer) -> PurposeMeasurements -> Either Text PurposeUnits Source #

Double successful evaluations. Failed evaluations retain the existing live harness fallback (1% memory / 5% CPU of the transaction maximum), explicitly as a probe rather than a fabricated measurement. The complete declaration must fit both transaction and block limits.

protocolUnitsCeiling :: (Integer, Integer) -> (Integer, Integer) -> (Integer, Integer) Source #

A submitted transaction must fit both per-transaction and per-block limits.

budgetRefusalPurposes :: Map Text Text -> Text -> [Text] Source #

Attribute only node-reported budget failures to their script purposes. Each failure section must itself contain both the budget error and hash; a different script's failure in the same report cannot supply either.