Version 9.0.0
cooked-validators v9.0.0 comes with 3 major upgrades:
- A better balancing mechanism, with more options, bug fixes, and optimizations.
- A full rewrite using Polysemy. This stable effect system makes cooked-validators more expressive, more consistent and with better separation of concerns.
- An expansion of the LTL DSL to modify traces, with the addition of negation and derived idioms such as implication.
Full CHANGELOG below.
[9.0.0] - 2026-05-28
Added
- New
LtlNotprimtive, to negateLtlexpressions. This allows to ensure a
specific tweak will result inmzeroand marks a new milestone in the
expressiveness of the Tweak/Attack DSL. - New
Ltlcombinators resulting from the addition ofLtlNot, such as
nowhere,whenAble, ... ExtendedStagedMockChain: It is not possible to extend a mockchain run with
arbitrary effects, while the associated tweaks will also have access to the
added effects.- A new capability in a mockchain run, which allows to take note (basically log)
anything. Functionsnote(|p|s|w|l)support this functionality. - A new capability in a mockchain run, which allows to make assertions which
will be displayed in the final result, and taken into account during
tests. Functionsassert(|')support his functionality. - A new
testBoolMsgfunction which outputs an error message when given
False. - Functions
testCookedFromInitDistTemplateand
testCookedQCFromInitDistTemplateto build tests from the initial
distribution template (the old default initial distribution). - The ability to enable/disable everything from the printing of the final result
of running a mockchain. The pretty printer per se has also been improved. - New
HListtype for heterogeneous lists, used to return type-retaining
results for Utxo searches. - New
TxSkeloptiontxSkelOptDeferFailuresto defer validation failures
occurring during the balancing process. This has the upside of visualizing the
last modified transaction sent for validation in the log, with the downside of
a (huge) loss in performance. To be used for debugging purpose only. - New
TxSkeloptiontxSkelOptMaxNbOfBalancingUtxosto limit the total
maximum number of UTxOs that can be picked as extra inputs during
balancing. This will only matter if the number of UTxOs owned by the balancing
wallet is huge, to limit exponential growth, which rarely happens.
Removed
- Tweaks can no longer issue write action such as waiting a certain amount of
time. As a consequence,waitUntilValidTweakhas been removed.
Changed
- The datum hijacking attack has been updated: all the sub-tweaks directly set
the new outputs, and they all return only the modified outputs. - The module Ltl.Combinators has been integrated to Ltl. The combinators have
been enriched and renamed to better match the rest of the Ltl API. - cooked-validators has been fully migrated from mtl to polysemy. Type class
MonadBlockChainand its variants have been replaced byDirectMockChain,
StagedMockChain,ExtendedStagedMockChainandFullMockChain. - Some datum hijacking params have been changed.
ownedByDatumHijackingParams
now takes a specific user as parameter, while its old behavior is now given by
typedByDatumHijackingParams. Also,txSkelOutPredDatumHijackingParamshas
been renamedoutPredDatumHijackingParams. - The whole file tree has been updated, in particular under
Cooked.MockChain. Each effect is given its own file, such as
Cooked.MockChain.Read,Cooked.MockChain.Error... - Generation functions which use to live under
Cooked.MockChain.GenerateTx.Witnessnow live in their own
Cooked.MockChain.GenerateTx.Credentialfile. - All the auto adjustment made by cooked are now implemented using tweaks, such
as autofilling of min ada, auto assignement of reference script... - Initial distributions have been downgraded from a first class citizen to a
mere helping structure equivalent to usingforceOutputs. By default, the
mockchain runs now have an empty state, and non-empty initial distribution can
be fed to runs in one of the following 3 ways: 1. useforceOutputsat the
beginning of a run. 2. UserunMockChainFromConfor
runMockChainFromInitiDistwhile running a trace. 3. usewithInitDistwhen
running tests. The old default initial distribution still exists as
initialDistributionTemplateand is simply directly a list of outputs. - The UTxO searches have been fully reworked. They now happen in 3
steps: 1. bootstrap the search with a set of UTxOs (beginSearchand
beginSearchP) 2. filter (ensure,ensurePure,ensureAFoldIsand
ensureAFoldIsn't) and/or extract elements from the selected outputs
(extract,extractPure,extractAFold,extractTotal,extractPureTotal
andextractGetter) in an type-retaining heterogeneous list. 2. retrieve the
result of the search (getOutputs,getOutputsAndExtracts,getExtracts,
getTxOutRefsandgetTxOutRefandOutputs). Some additional helpers are
provided for basic searches (utxosAtSearch,allUtxosSearch,
txSkelOutByRefSearchandtxSkelOutByRefSearch') and for basic filters
(ensureOnlyValueOutputs,ensureVanillaOutputsand
ensureProperReferenceScript). txSkelLabelhas been renamedtxSkelLabels
Fixed
- The condition for which a balancing solution is considered optimal: The main
balancing functionreachValuewhich picks the inputs to add and creates an
additionnal output when needed has been updated. It used to pick the optimal
result based on how small the additional UTxO was, and it now properly
minimizes the total overhead in terms of size (and thus cost) that balancing
adds to the transaction. This process is more involved but also more accurate. - An optimization bug in the optimal fee computation.