Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Byron.Spec.Ledger.Update
Contents
Synopsis
- data Metadata = Metadata
- data Vote = Vote {}
- data PParams = PParams {}
- newtype FactorA = FactorA Int
- newtype FactorB = FactorB Int
- newtype BkSgnCntT = BkSgnCntT Double
- newtype UpAdptThd = UpAdptThd Double
- newtype UpId = UpId Int
- data ProtVer = ProtVer {}
- newtype ApName = ApName String
- newtype ApVer = ApVer Natural
- data SwVer = SwVer {}
- type UpSD = (ProtVer, PParams, SwVer, Set STag, Metadata)
- type STag = String
- data UProp = UProp {}
- data UpdateConstraintViolation
- data UPPVV
- data UPSVV
- data UpsvvPredicateFailure
- data UppvvPredicateFailure
- data UPV
- data UpvPredicateFailure
- data UPREG
- data UpregPredicateFailure
- data ADDVOTE
- data AddvotePredicateFailure
- data UPVOTE
- data UpvotePredicateFailure
- data FADS
- data FadsPredicateFailure
- data UPEND
- data UpendPredicateFailure
- type UPIEnv = (Slot, Bimap VKeyGenesis VKey, BlockCount, Word8)
- type UPIState = ((ProtVer, PParams), [(Slot, (ProtVer, PParams))], Map ApName (ApVer, Slot, Metadata), Map UpId (ProtVer, PParams), Map UpId (ApName, ApVer, Metadata), Map UpId Slot, Set (UpId, VKeyGenesis), Set (ProtVer, VKeyGenesis), Map UpId Slot)
- data UPIREG
- data UpiregPredicateFailure = UPREGFailure (PredicateFailure UPREG)
- data UPIVOTE
- data UpivotePredicateFailure = UPVOTEFailure (PredicateFailure UPVOTE)
- data APPLYVOTES
- data ApplyVotesPredicateFailure = UpivoteFailure (PredicateFailure UPIVOTE)
- data UPIVOTES
- data UpivotesPredicateFailure = ApplyVotesFailure (PredicateFailure APPLYVOTES)
- data UPIEND
- data UpiendPredicateFailure = UPENDFailure (PredicateFailure UPEND)
- data PVBUMP
- data PvbumpPredicateFailure = NoPVBUMPFailure
- data UPIEC
- data UpiecPredicateFailure = PVBUMPFailure (PredicateFailure PVBUMP)
- (==>) ∷ Bool → Bool → Bool
- (<=?) ∷ Ord a ⇒ a → a → Maybe (a, Threshold a)
- delegationMap ∷ UPIEnv → Bimap VKeyGenesis VKey
- upSigData ∷ Lens' UProp UpSD
- upPV ∷ Lens' UProp ProtVer
- upParams ∷ Lens' UProp PParams
- upSwVer ∷ Lens' UProp SwVer
- upSTags ∷ Lens' UProp (Set STag)
- upMdt ∷ Lens' UProp Metadata
- getUpSigData ∷ UProp → UpSD
- mkUProp ∷ UpId → VKey → ProtVer → PParams → SwVer → Set STag → Metadata → UProp
- inMap ∷ (Ord key, Eq v) ⇒ key → v → Map key v → Bool
- invertMap ∷ (Ord k, Ord v) ⇒ Map k v → Map v (Set k)
- invertBijection ∷ Ord v ⇒ Map k v → Map v k
- pvCanFollow ∷ ProtVer → ProtVer → Bool
- checkUpdateConstraints ∷ PParams → UProp → [UpdateConstraintViolation]
- maxBkSz ∷ Lens' PParams Natural
- orError ∷ Maybe (a, b) → (a → b → e) → Maybe e
- maxTxSz ∷ Lens' PParams Natural
- scriptVersion ∷ Lens' PParams Natural
- canUpdate ∷ PParams → UProp → Rule UPPVV ctx ()
- svCanFollow ∷ Map ApName (ApVer, Slot, Metadata) → (ApName, ApVer) → Bool
- upId ∷ Lens' UProp UpId
- upIssuer ∷ Lens' UProp VKey
- upSig ∷ Lens' UProp (Sig UpSD)
- mkVote ∷ VKey → UpId → Vote
- vPropId ∷ Lens' Vote UpId
- vCaster ∷ Lens' Vote VKey
- vSig ∷ Lens' Vote (Sig UpId)
- findKey ∷ (v → Bool) → Map k v → Maybe (k, v)
- fstUPIState ∷ UPIState → (ProtVer, PParams)
- sndUPIState ∷ UPIState → [(Slot, (ProtVer, PParams))]
- trdUPIState ∷ UPIState → Map ApName (ApVer, Slot, Metadata)
- emptyUPIState ∷ UPIState
- initialPParams ∷ PParams
- protocolVersion ∷ UPIState → ProtVer
- protocolParameters ∷ UPIState → PParams
- applicationVersions ∷ UPIState → Map ApName (ApVer, Slot, Metadata)
- confirmedProposals ∷ UPIState → Map UpId Slot
- futureAdoptions ∷ UPIState → [(Slot, (ProtVer, PParams))]
- endorsements ∷ UPIState → Set (ProtVer, VKeyGenesis)
- registeredProtocolUpdateProposals ∷ UPIState → Map UpId (ProtVer, PParams)
- upiEnvGen ∷ Gen UPIEnv
- ppsUpdateFrom ∷ PParams → Gen PParams
- dmapGen ∷ Word8 → Gen (Bimap VKeyGenesis VKey)
- increasingProbabilityAt ∷ Gen a → (a, a) → Gen a
- randomUpId ∷ Gen UpId
- reSign ∷ UProp → UProp
- upAdptThd ∷ Lens' PParams UpAdptThd
- upTtl ∷ Lens' PParams SlotCount
- pickHighlyEndorsedProtocolVersion ∷ [(ProtVer, Set VKeyGenesis)] → Gen (Maybe ProtVer)
- updateProposalAndVotesGen ∷ UPIEnv → UPIState → Gen (Maybe UProp, [Vote])
- protocolVersionEndorsementGen ∷ UPIEnv → UPIState → Gen ProtVer
- bkSgnCntT ∷ Lens' PParams BkSgnCntT
- bkSlotsPerEpoch ∷ Lens' PParams SlotCount
- factorA ∷ Lens' PParams FactorA
- factorB ∷ Lens' PParams FactorB
- maxHdrSz ∷ Lens' PParams Natural
- maxPropSz ∷ Lens' PParams Natural
- pvAlt ∷ Lens' ProtVer Natural
- pvMaj ∷ Lens' ProtVer Natural
- pvMin ∷ Lens' ProtVer Natural
- svName ∷ Lens' SwVer ApName
- svVer ∷ Lens' SwVer ApVer
- type family PredicateFailure a
Documentation
For now we do not have any requirements on metadata.
Constructors
Metadata |
Instances
Instances
Data Vote Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → Vote → c Vote # gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c Vote # dataTypeOf ∷ Vote → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c Vote) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c Vote) # gmapT ∷ (∀ b. Data b ⇒ b → b) → Vote → Vote # gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → Vote → r # gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → Vote → r # gmapQ ∷ (∀ d. Data d ⇒ d → u) → Vote → [u] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → Vote → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → Vote → m Vote # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Vote → m Vote # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Vote → m Vote # | |
Generic Vote Source # | |
Show Vote Source # | |
HasTypeReps Vote Source # | |
Eq Vote Source # | |
Hashable Vote Source # | |
NoThunks Vote Source # | |
HasHash (Maybe UProp, [Vote]) Source # | |
type Rep Vote Source # | |
Defined in Byron.Spec.Ledger.Update type Rep Vote = D1 ('MetaData "Vote" "Byron.Spec.Ledger.Update" "byron-spec-ledger-1.1.0.1-inplace" 'False) (C1 ('MetaCons "Vote" 'PrefixI 'True) (S1 ('MetaSel ('Just "_vCaster") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VKey) :*: (S1 ('MetaSel ('Just "_vPropId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UpId) :*: S1 ('MetaSel ('Just "_vSig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Sig UpId))))) |
Protocol parameters.
Constructors
PParams | |
Fields
|
Instances
Instances
Data FactorA Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → FactorA → c FactorA # gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c FactorA # dataTypeOf ∷ FactorA → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c FactorA) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c FactorA) # gmapT ∷ (∀ b. Data b ⇒ b → b) → FactorA → FactorA # gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → FactorA → r # gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → FactorA → r # gmapQ ∷ (∀ d. Data d ⇒ d → u) → FactorA → [u] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → FactorA → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → FactorA → m FactorA # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → FactorA → m FactorA # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → FactorA → m FactorA # | |
Generic FactorA Source # | |
Show FactorA Source # | |
HasTypeReps FactorA Source # | |
Eq FactorA Source # | |
Ord FactorA Source # | |
Hashable FactorA Source # | |
NoThunks FactorA Source # | |
type Rep FactorA Source # | |
Defined in Byron.Spec.Ledger.Update |
Instances
Data FactorB Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → FactorB → c FactorB # gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c FactorB # dataTypeOf ∷ FactorB → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c FactorB) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c FactorB) # gmapT ∷ (∀ b. Data b ⇒ b → b) → FactorB → FactorB # gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → FactorB → r # gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → FactorB → r # gmapQ ∷ (∀ d. Data d ⇒ d → u) → FactorB → [u] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → FactorB → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → FactorB → m FactorB # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → FactorB → m FactorB # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → FactorB → m FactorB # | |
Generic FactorB Source # | |
Show FactorB Source # | |
HasTypeReps FactorB Source # | |
Eq FactorB Source # | |
Ord FactorB Source # | |
Hashable FactorB Source # | |
NoThunks FactorB Source # | |
type Rep FactorB Source # | |
Defined in Byron.Spec.Ledger.Update |
Instances
Instances
Instances
Data UpId Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → UpId → c UpId # gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c UpId # dataTypeOf ∷ UpId → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c UpId) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c UpId) # gmapT ∷ (∀ b. Data b ⇒ b → b) → UpId → UpId # gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → UpId → r # gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → UpId → r # gmapQ ∷ (∀ d. Data d ⇒ d → u) → UpId → [u] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → UpId → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → UpId → m UpId # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → UpId → m UpId # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → UpId → m UpId # | |
Generic UpId Source # | |
Show UpId Source # | |
HasTypeReps UpId Source # | |
Eq UpId Source # | |
Ord UpId Source # | |
Hashable UpId Source # | |
NoThunks UpId Source # | |
type Rep UpId Source # | |
Defined in Byron.Spec.Ledger.Update |
Protocol version
Instances
Instances
Data ApName Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → ApName → c ApName # gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c ApName # dataTypeOf ∷ ApName → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c ApName) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c ApName) # gmapT ∷ (∀ b. Data b ⇒ b → b) → ApName → ApName # gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → ApName → r # gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → ApName → r # gmapQ ∷ (∀ d. Data d ⇒ d → u) → ApName → [u] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → ApName → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → ApName → m ApName # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → ApName → m ApName # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → ApName → m ApName # | |
Generic ApName Source # | |
Show ApName Source # | |
HasTypeReps ApName Source # | |
Eq ApName Source # | |
Ord ApName Source # | |
Hashable ApName Source # | |
NoThunks ApName Source # | |
type Rep ApName Source # | |
Defined in Byron.Spec.Ledger.Update |
Application version
Instances
Data ApVer Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → ApVer → c ApVer # gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c ApVer # dataTypeOf ∷ ApVer → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c ApVer) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c ApVer) # gmapT ∷ (∀ b. Data b ⇒ b → b) → ApVer → ApVer # gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → ApVer → r # gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → ApVer → r # gmapQ ∷ (∀ d. Data d ⇒ d → u) → ApVer → [u] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → ApVer → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → ApVer → m ApVer # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → ApVer → m ApVer # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → ApVer → m ApVer # | |
Generic ApVer Source # | |
Num ApVer Source # | |
Show ApVer Source # | |
HasTypeReps ApVer Source # | |
Eq ApVer Source # | |
Ord ApVer Source # | |
Hashable ApVer Source # | |
NoThunks ApVer Source # | |
type Rep ApVer Source # | |
Defined in Byron.Spec.Ledger.Update |
Instances
Data SwVer Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → SwVer → c SwVer # gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c SwVer # dataTypeOf ∷ SwVer → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c SwVer) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c SwVer) # gmapT ∷ (∀ b. Data b ⇒ b → b) → SwVer → SwVer # gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → SwVer → r # gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → SwVer → r # gmapQ ∷ (∀ d. Data d ⇒ d → u) → SwVer → [u] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → SwVer → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → SwVer → m SwVer # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → SwVer → m SwVer # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → SwVer → m SwVer # | |
Generic SwVer Source # | |
Show SwVer Source # | |
HasTypeReps SwVer Source # | |
Eq SwVer Source # | |
Hashable SwVer Source # | |
NoThunks SwVer Source # | |
HasTypeReps (ProtVer, PParams, SwVer, Set STag, Metadata) Source # | |
type Rep SwVer Source # | |
Defined in Byron.Spec.Ledger.Update type Rep SwVer = D1 ('MetaData "SwVer" "Byron.Spec.Ledger.Update" "byron-spec-ledger-1.1.0.1-inplace" 'False) (C1 ('MetaCons "SwVer" 'PrefixI 'True) (S1 ('MetaSel ('Just "_svName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ApName) :*: S1 ('MetaSel ('Just "_svVer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ApVer))) |
type UpSD = (ProtVer, PParams, SwVer, Set STag, Metadata) Source #
Part of the update proposal which must be signed
System tag, this represents a target operating system for the update (e.g.
linux
, win64
, or mac32
).
Update proposal
Constructors
UProp | |
Instances
data UpdateConstraintViolation Source #
Violations on the constraints of the allowed values for new protocol parameters.
Constructors
BlockSizeTooLarge Natural (Threshold Natural) | |
TransactionSizeTooLarge Natural (Threshold Natural) | |
ScriptVersionTooLarge Natural (Threshold Natural) | |
ScriptVersionTooSmall Natural (Threshold Natural) |
Instances
Instances
Update Proposal Software Version Validation
Instances
data UpsvvPredicateFailure Source #
These PredicateFailure
s are all "throwable". The disjunction of the
rules' preconditions is not True
- the PredicateFailure
s represent
False
cases.
Instances
data UppvvPredicateFailure Source #
These PredicateFailure
s are all "throwable". The disjunction of the
rules' preconditions is not True
- the PredicateFailure
s represent
False
cases.
Instances
Update proposal validity
Instances
data UpvPredicateFailure Source #
These PredicateFailure
s are all throwable.
Constructors
UPPVVFailure (PredicateFailure UPPVV) | |
UPSVVFailure (PredicateFailure UPSVV) | |
AVChangedInPVUpdate ApName ApVer (Maybe (ApVer, Slot, Metadata)) | |
ParamsChangedInSVUpdate | |
PVChangedInSVUpdate |
Instances
Instances
data UpregPredicateFailure Source #
These PredicateFailure
s are all throwable.
Constructors
UPVFailure (PredicateFailure UPV) | |
NotGenesisDelegate | |
DoesNotVerify |
Instances
Instances
data AddvotePredicateFailure Source #
These PredicateFailure
s are all throwable.
Constructors
AVSigDoesNotVerify | |
NoUpdateProposal UpId | |
VoteByNonGenesisDelegate VKey | |
RepeatVoteByGenesisDelegate VKey |
Instances
Instances
data UpvotePredicateFailure Source #
The 3 non-embedded PredicateFailure
s here are all structural. The
disjuntion of the preconditions is True
- one rule either fires or the
other does.
Constructors
ADDVOTEFailure (PredicateFailure ADDVOTE) | |
S_HigherThanThdAndNotAlreadyConfirmed | |
S_CfmThdNotReached | |
S_AlreadyConfirmed |
Instances
Instances
data FadsPredicateFailure Source #
Instances
Instances
data UpendPredicateFailure Source #
S_TryNextRule
is a structural PredicateFailure
, used to fail from
one transition rule to the other. The other PredicateFailure
s are all
throwable.
Constructors
ProtVerUnknown ProtVer | |
S_TryNextRule | |
CanAdopt ProtVer | |
CannotAdopt ProtVer | |
NotADelegate VKey | |
UnconfirmedProposal UpId |
Instances
type UPIEnv = (Slot, Bimap VKeyGenesis VKey, BlockCount, Word8) Source #
The update interface environment is shared amongst various rules, so we define it as an alias here.
type UPIState = ((ProtVer, PParams), [(Slot, (ProtVer, PParams))], Map ApName (ApVer, Slot, Metadata), Map UpId (ProtVer, PParams), Map UpId (ApName, ApVer, Metadata), Map UpId Slot, Set (UpId, VKeyGenesis), Set (ProtVer, VKeyGenesis), Map UpId Slot) Source #
The update interface state is shared amongst various rules, so we define it as an alias here.
Instances
data UpiregPredicateFailure Source #
Constructors
UPREGFailure (PredicateFailure UPREG) |
Instances
Instances
data UpivotePredicateFailure Source #
Constructors
UPVOTEFailure (PredicateFailure UPVOTE) |
Instances
data APPLYVOTES Source #
Instances
data ApplyVotesPredicateFailure Source #
Constructors
UpivoteFailure (PredicateFailure UPIVOTE) |
Instances
Instances
data UpivotesPredicateFailure Source #
Constructors
ApplyVotesFailure (PredicateFailure APPLYVOTES) |
Instances
Instances
data UpiendPredicateFailure Source #
Constructors
UPENDFailure (PredicateFailure UPEND) |
Instances
Instances
data PvbumpPredicateFailure Source #
Constructors
NoPVBUMPFailure |
Instances
Instances
data UpiecPredicateFailure Source #
Constructors
PVBUMPFailure (PredicateFailure PVBUMP) |
Instances
getUpSigData ∷ UProp → UpSD Source #
invertMap ∷ (Ord k, Ord v) ⇒ Map k v → Map v (Set k) Source #
Invert a map
Examples:
>>>
import qualified Data.Map.Strict as Map
>>>
import Byron.Spec.Ledger.Update (invertMap)
>>>
invertMap (Map.fromList [('a', 1 :: Int), ('b', 2), ('c', 3), ('d', 1)])
fromList [(1,fromList "ad"),(2,fromList "b"),(3,fromList "c")]
invertBijection ∷ Ord v ⇒ Map k v → Map v k Source #
Invert a map which we assert to be a bijection. If this map is not a bijection, the behaviour is not guaranteed.
Examples:
>>>
import qualified Data.Map.Strict as Map
>>>
invertBijection (Map.fromList [('a', 1 :: Int), ('b', 2), ('c', 3)])
fromList [(1,'a'),(2,'b'),(3,'c')]
Check whether a protocol version can follow the current protocol version.
checkUpdateConstraints ∷ PParams → UProp → [UpdateConstraintViolation] Source #
Check whether an update proposal marks a valid update
findKey ∷ (v → Bool) → Map k v → Maybe (k, v) Source #
Find the key that corresponds to the value satisfying the given predicate. In case zero or more than one key is found this function returns Nothing.
endorsements ∷ UPIState → Set (ProtVer, VKeyGenesis) Source #
ppsUpdateFrom ∷ PParams → Gen PParams Source #
Generate a protocol parameter update from a given set of current
protocol-parameters, ensuring the consistency of the new protocol parameters
w.r.t. the current ones, according to the canUpdate
predicate in the
formal specification.
TODO: we can move this into a Generator's module, but first we need to
disentangle the dependencies. Moving this to Byron.Spec.Ledger.Update.Generators
will
cause a circular dependency. I think the rules need to be moved into their
own modules.
increasingProbabilityAt ∷ Gen a → (a, a) → Gen a Source #
Generate values the given distribution in 90% of the cases, and values at the bounds of the range in 10% of the cases.
This can be used to generate enough extreme values. The exponential and
linear distributions provided by hedgehog
will generate a small percentage
of these (0-1%).
randomUpId ∷ Gen UpId Source #
Generate a random update proposal id, by picking a large number so that the probability of having an update proposal with that id is nearly zero.
pickHighlyEndorsedProtocolVersion Source #
Given a list of protocol versions and keys endorsing those versions,
generate a protocol-version endorsement, or Nothing
if the list of
endorsements is empty. The version to be endorsed will be selected from those
versions that have the most endorsements.
updateProposalAndVotesGen ∷ UPIEnv → UPIState → Gen (Maybe UProp, [Vote]) Source #
Generate an optional update-proposal and a list of votes, given an update environment and state.
The update proposal and votes need to be generated at the same time, since this allow us to generate update votes for update proposals issued in the same block as the votes.
protocolVersionEndorsementGen ∷ UPIEnv → UPIState → Gen ProtVer Source #
Generate an endorsement given an update environment and state.
type family PredicateFailure a Source #
Descriptive type for the possible failures which might cause a transition to fail.
As a convention, PredicateFailure
s which are "structural" (meaning that
they are not "throwable" in practice, and are used to pass control from
one transition rule to another) are prefixed with S_
.
Structural PredicateFailure
s represent conditions between rules where
the disjunction of all rules' preconditions is equal to True
. That is,
either one rule will throw a structural PredicateFailure
and the other
will succeed, or vice-versa.