singular-registry
LicenseApache-2.0
Safe HaskellNone
LanguageGHC2021

Singular.Registry.Deployment.Attach

Description

One owner for the deployment family's node decisions: the compiled release halves a manifest pins only by hash (CageParts, cageConfigFor), the registry token a seed determines, a live carrier of each recorded script found by its hash wherever it sits (Singular.Registry.StateToken; the recorded output reference is not read), the registry's state output, and the two operations built on them — verifyDeployment, which goes on to read the live state datum and refuse a mismatched active policy or process/retract window, and attach, which returns the resolved outputs without those additional checks. Neither operation loads or compares a mirror; the caller that attaches does that afterwards.

This module is an internal owner behind the Deployment facade: callers import the facade, which re-exports the unchanged public surface. It reads manifest values, parseOutRef, renderOutRef, hex and die from Singular.Registry.Deployment.Manifest and the focused identity and lookup adapters from the builder's internal family.

Synopsis

The release halves the manifest pins only by hash

data CageParts Source #

The compiled bytes a release ships. The manifest records their hashes; the bytes themselves come from the blueprints in hand, so a manifest can never be used to smuggle in a different validator.

Constructors

CageParts 

Fields

cageConfigFor :: Deployment -> CageParts -> Either String CageConfig Source #

The cage configuration a manifest describes: this release's compiled scripts, with the seed and the economics the deployment was booted with.

Refuses when the release in hand compiles the state validator to a different hash than the deployment was made with — the manifest then belongs to another release and attaching to it would spend against a registry whose validator this code does not implement.

Checking one against a node

verifyDeployment :: Session NoWitness IO -> Deployment -> CageParts -> IO [String] Source #

Ask a node whether it still agrees with a manifest, and return what it answered, one line per claim.

Every claim is about the chain or about the compiled release, never about the file restating itself: the seed determines the recorded token, this release compiles to the recorded state hash, every recorded reference output is live at its recorded address carrying the hash the manifest pins, and the registry's state output carries the recorded token under the recorded policy. The first claim that fails is raised by name.

Attaching a run to one

data Attached Source #

What a run gets instead of booting and publishing.

Constructors

Attached 

Fields

  • attCfg :: CageConfig

    The deployed registry's configuration

  • attToken :: TokenId

    The deployed registry's token

  • attRefUtxos :: [(TxIn, TxOut ConwayEra)]

    The published reference outputs, in manifest order

  • attStateUtxo :: (TxIn, TxOut ConwayEra)

    The registry's current state output

attach :: Session NoWitness IO -> Deployment -> CageParts -> IO Attached Source #

Attach a run to a recorded deployment: the release, token and reference/state resolution verifyDeployment performs, plus the resolved outputs a runner needs in hand. The live state's active policy and windows are not checked here; verification is the operation that reads them.