Cardano Plutus Team Don Finish Cost Models for New Dijkstra Functions

The team add 65 test cases for token-value operations and correct compiler behavior. The update still cover Plutus V4 compilation and tools to check the system’s formal models.

By SongMarketCap

Updated:

Cardano News - Cardano Plutus Team Don Finish Cost Models for New Dijkstra Functions

The Plutus team don finalize cost models for keepPolicies and dropPolicies, two built-in functions wey dem dey develop for Cardano Dijkstra era. For November 4 update, Software Engineering Lead Ziyang Liu still report new tests, specification updates, and compiler fixes.

The work cover how smart contracts dey handle token values and how dem dey account for execution resources. Na development changes to support Dijkstra preparation; the report no announce say dem don activate am for Cardano mainnet.

New Functions Fit Filter Tokens by Policy

The two functions belong to CIP-0168, one proposal wey extend operations on BuiltinValue, the data type wey dem dey use represent asset quantities inside Plutus smart contracts. Built-in functions dey provide operations wey the execution system dey support directly.

Cardano dey group native tokens under policy identifiers wey relate to their minting rules. keepPolicies go keep the parts of one value wey join with selected identifiers, while dropPolicies go remove dem. One contract wey dey process several groups of tokens fit use these functions to separate the assets wey concern one particular check.

The merged changes limit the policy list wey either function fit accept reach 256 identifiers. Their completed cost models define how execution go count for CPU and memory units, wey be part of a smart contract execution budget.

Tests and Compiler Fixes Address Program Behavior

The team add 65 conformance cases for the new Value builtins. These tests compare the implementation output with the expected result for defined inputs. The new functions and multiIndexArray don also enter the Plutus Core specification, to provide written reference for how dem suppose behave.

One separate correction address constant folding, one optimization wey dey calculate suitable expressions during compilation instead of leaving dem for execution. The compiler passes wey the issue touch before fit simplify some expressions in way wey wrongfully throw away computations wey suppose fail. The fix dey preserve those computations when the conditions wey dem need to simplify no dey met.

The update still correct compilation of Plutus V4 context types, wey dey describe information wey scripts get when dem dey validate transactions. In addition, the memory models for lookupCoin and valueContains don align with existing cost-model parameters.

[NEWSBREAK]

Formal Checks Don Expand as Implementation Dey Continue

The team introduce one tool wey dey generate typechecking tests for Agda from the existing conformance suite. Agda na programming language and proof assistant wey people dey use express formal models and check their consistency. The tool allow test cases wey implementation don already use to support checks inside that formal environment.

The new builtins don also enter the metatheory, the mathematical description wey people dey use reason about Plutus programs. Dem currently appear as postulates, meaning the model assume their specified behavior while further implementation work dey continue. Another merged change extend one tool wey dey check whether one compiler optimization dey preserve program behavior.

Work wey remain include implementing arrays and byte strings inside the formal model, correcting certification of one separate compiler optimization, and improving the CEK machine wey dey execute Plutus Core programs. These items still dey listed as work in progress for the November 4 report.