| License | Apache-2.0 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
Singular.Registry.Wire.Request
Description
What a registry request names and when its age allows acting on it: the seven-admitted-edges row-index edge vocabulary, the request datum with its codec, and the accept/retract/reject phase classification. Reads only Singular.Registry.Wire.Primitive; nothing here is importable by a caller — the public surface is the Singular.Registry.Types facade.
Synopsis
- type Edge = Integer
- edgeInsertAbsent :: Edge
- edgeInsertActive :: Edge
- edgeUpdateActive :: Edge
- edgeUpdateTerminal :: Edge
- edgeDeleteAbsent :: Edge
- edgeDeleteActive :: Edge
- edgeWitnessTerminal :: Edge
- edgeName :: Edge -> String
- data OnChainRequest = OnChainRequest {
- requestToken :: !OnChainTokenId
- requestOwner :: !BuiltinByteString
- requestKey :: !ByteString
- requestEdge :: !Edge
- requestDeposit :: !Integer
- requestSubmittedAt :: !Integer
- requestDestination :: !RequestDestination
- type RequestDestination = (ByteString, Maybe Data)
- data RequestPhase
- requestPhase :: SlotNo -> SlotNo -> SlotNo -> RequestPhase
On-chain domain types
The seven-admitted-edges row index a request names (#183, Lean Request.edge,
Aiken lib/edgeInsertAbsent … edgeWitnessTerminal).
An edge names its own leaf bytes, so no value bytes travel with a request and an illegal value-byte shape is not expressible:
0 insertAbsent insert 0x00 1 insertActive insert 0x01 2 updateActive update 0x00 -> 0x01 3 updateTerminal update 0x01 -> 0x02 4 deleteAbsent delete 0x00 5 deleteActive delete 0x01 6 witnessTerminal read 0x02
It is a plain Integer, exactly as it is a plain Int on chain, so a
tag outside 0..6 can still be encoded and sent — which is what the
cage's edge-inadmissible refusal is there to answer, and what a row
that exercises that refusal needs to be able to build.
data OnChainRequest Source #
On-chain request to modify a token's trie.
Matches Aiken types/Request.
Constructors
| OnChainRequest | |
Fields
| |
Instances
| Show OnChainRequest Source # | |
Defined in Singular.Registry.Wire.Request Methods showsPrec :: Int -> OnChainRequest -> ShowS Source # show :: OnChainRequest -> String Source # showList :: [OnChainRequest] -> ShowS Source # | |
| Eq OnChainRequest Source # | |
Defined in Singular.Registry.Wire.Request Methods (==) :: OnChainRequest -> OnChainRequest -> Bool Source # (/=) :: OnChainRequest -> OnChainRequest -> Bool Source # | |
| FromData OnChainRequest Source # | |
Defined in Singular.Registry.Wire.Request Methods fromBuiltinData :: BuiltinData -> Maybe OnChainRequest | |
| ToData OnChainRequest Source # | |
Defined in Singular.Registry.Wire.Request Methods toBuiltinData :: OnChainRequest -> BuiltinData | |
| UnsafeFromData OnChainRequest Source # | |
Defined in Singular.Registry.Wire.Request Methods unsafeFromBuiltinData :: BuiltinData -> OnChainRequest | |
type RequestDestination = (ByteString, Maybe Data) Source #
Where a request's minted token goes, and the datum the receiving output must carry, or none (#419): what the request carries on the chain.
Request phase
data RequestPhase Source #
The exit a resuming client chooses for one of its pending requests at a chain tip.
It follows the windows of onchainvalidatorsshared.ak: an update is
folded only while the tip is before submitted_at + process_time (phase
1), and the owner may retract only before submitted_at + process_time +
retract_time (phase 2). After both the client rejects (phase 3). This is
the client's choice, not the validator's rule for a reject: a reject
carries no admission and is accepted in every window (#320).
Constructors
| PhaseAccept | |
| PhaseRetract | |
| PhaseReject |
Instances
| Show RequestPhase Source # | |
Defined in Singular.Registry.Wire.Request Methods showsPrec :: Int -> RequestPhase -> ShowS Source # show :: RequestPhase -> String Source # showList :: [RequestPhase] -> ShowS Source # | |
| Eq RequestPhase Source # | |
Defined in Singular.Registry.Wire.Request Methods (==) :: RequestPhase -> RequestPhase -> Bool Source # (/=) :: RequestPhase -> RequestPhase -> Bool Source # | |
Arguments
| :: SlotNo | Last slot an accept fold can carry (process deadline). |
| -> SlotNo | Last slot a retract can carry (retract deadline). |
| -> SlotNo | The live tip. |
| -> RequestPhase |
Classify a request from its two boundary slots and the live tip.
The boundaries are the slots the builders can express: the accept fold's validity upper bound is the process deadline slot, the retract's is the retract deadline slot. The comparison is strict, so a phase is chosen only while the tip is inside what that phase's builder can still build — a window already behind the tip never classifies into the phase that would build it.