| License | Apache-2.0 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
Singular.Registry.TxBuilder.ConnectedFold
Description
One transaction binding the full insert journey: the registry state
UTxO spent through Modify with trie proofs, every registry request
consumed with Contribute, plus caller-attached spends (naming claims),
mints (approvals, representatives) and outputs (naming records). No
owner signature anywhere — the #79 permissionless repair made Modify
owner-free, and this builder never asks for one.
This is the single canonical permissionless-fold implementation for
issue #77's runners (register, recovery, retirement). Its lineage is
offchainjourneyrepair/Main.hs's foldRequestsTx /
buildPermissionlessProgram (issue #79, frozen): the registry program,
proof computation, upper-slot rule and refund rule are transcribed from
there, extended with the attached naming actions. The repair runner
keeps its own copy; nothing here changes it.
Synopsis
- newtype RawRedeemer = RawRedeemer Data
- data ConnectedSpend = ConnectedSpend {
- csUtxo :: (TxIn, TxOut ConwayEra)
- csRedeemer :: RawRedeemer
- csScript :: Script ConwayEra
- data ConnectedMint = ConnectedMint {
- cmPolicy :: PolicyID
- cmAssets :: Map AssetName Integer
- cmRedeemer :: RawRedeemer
- cmScript :: Script ConwayEra
- data ConnectedFoldArgs = ConnectedFoldArgs {
- cfaCfg :: CageConfig
- cfaSession :: Session NoWitness IO
- cfaTrie :: TrieManager IO
- cfaToken :: TokenId
- cfaFeeAddr :: Addr
- cfaStateUtxo :: (TxIn, TxOut ConwayEra)
- cfaReqUtxos :: [(TxIn, TxOut ConwayEra)]
- cfaFeeUtxo :: (TxIn, TxOut ConwayEra)
- cfaSpends :: [ConnectedSpend]
- cfaMints :: [ConnectedMint]
- cfaOutputs :: [TxOut ConwayEra]
- cfaSigners :: [KeyHash 'Guard]
- cfaRefUtxos :: [(TxIn, TxOut ConwayEra)]
- cfaAttachScripts :: [Script ConwayEra]
- cfaSkipEval :: Bool
- cfaAdjustRoot :: Root -> Root
- connectedFoldTx :: ConnectedFoldArgs -> IO (ConwayTx, Root)
- syncFoldedRequests :: TrieManager IO -> TokenId -> [(TxIn, TxOut ConwayEra)] -> IO ()
- generousUnits :: ExUnits
- skipEvalUnits :: ExUnits -> ExUnits -> Int -> ExUnits
Documentation
newtype RawRedeemer Source #
A raw Plutus-data redeemer for attached (non-registry) purposes.
Constructors
| RawRedeemer Data |
Instances
| Show RawRedeemer Source # | |
Defined in Singular.Registry.TxBuilder.ConnectedFold Methods showsPrec :: Int -> RawRedeemer -> ShowS Source # show :: RawRedeemer -> String Source # showList :: [RawRedeemer] -> ShowS Source # | |
| Eq RawRedeemer Source # | |
Defined in Singular.Registry.TxBuilder.ConnectedFold Methods (==) :: RawRedeemer -> RawRedeemer -> Bool Source # (/=) :: RawRedeemer -> RawRedeemer -> Bool Source # | |
| ToData RawRedeemer Source # | |
Defined in Singular.Registry.TxBuilder.ConnectedFold Methods toBuiltinData :: RawRedeemer -> BuiltinData | |
data ConnectedSpend Source #
An attached script spend (a naming claim).
Constructors
| ConnectedSpend | |
Fields
| |
data ConnectedMint Source #
An attached mint or burn under a caller script.
Constructors
| ConnectedMint | |
Fields
| |
data ConnectedFoldArgs Source #
Everything one connected fold binds.
Constructors
| ConnectedFoldArgs | |
Fields
| |
connectedFoldTx :: ConnectedFoldArgs -> IO (ConwayTx, Root) Source #
Build the connected fold transaction (unsigned), returning the computed new root the state continuation carries.
syncFoldedRequests :: TrieManager IO -> TokenId -> [(TxIn, TxOut ConwayEra)] -> IO () Source #
Replay accepted fold inputs into the manager's persistent trie so later proof computations start from the chain's root. Call only with inputs the ledger accepted, in fold order.
generousUnits :: ExUnits Source #
Generous per-purpose budget stated when local evaluation is skipped (adversarial path only); the ledger re-executes for real. Sized 2026-09-13 from MEASURED minima (NOTE-023): the crosswired exhibit tx overspent 3M mem (needed 5.39M+ and counting — the error reports the next step only, not completion) and 200M cpu (needed 200.05M+); the honest consumer measures 295M cpu on tiny Aiken fixtures; the full-fold app script likewise exceeds 3M/200M (double budget failure on the same tx). 14M mem / 1B steps per purpose sits at 10% of this devnet's tx limits (140M mem / 10B steps) with ~3x headroom over every measured minimum; stated fees (~0.9 ADA/purpose) stay covered by folder funding (balance fails loudly otherwise). Revisit if ledgers tighten limits or scripts grow.
skipEvalUnits :: ExUnits -> ExUnits -> Int -> ExUnits Source #
The units stated for each of n purposes when local evaluation is
skipped: generousUnits, lowered where needed so that their sum fits both
the transaction limit and the block limit. A transaction whose stated
units exceed the block limit passes the mempool's per-transaction check
yet can never be included in a block, so it waits for ever.