Safe Haskell | None |
---|---|
Language | Haskell2010 |
Byron.Spec.Ledger.Update
Contents
Synopsis
- data PParams = PParams {
- _maxBkSz :: !Natural
- _maxHdrSz :: !Natural
- _maxTxSz :: !Natural
- _maxPropSz :: !Natural
- _bkSgnCntT :: !BkSgnCntT
- _bkSlotsPerEpoch :: !SlotCount
- _upTtl :: !SlotCount
- _scriptVersion :: !Natural
- _upAdptThd :: !UpAdptThd
- _factorA :: !FactorA
- _factorB :: !FactorB
- newtype BkSgnCntT = BkSgnCntT Double
- newtype UpAdptThd = UpAdptThd Double
- newtype FactorB = FactorB Int
- newtype FactorA = FactorA Int
- data ProtVer = ProtVer {}
- newtype UpId = UpId Int
- bkSgnCntT :: Lens' PParams BkSgnCntT
- bkSlotsPerEpoch :: Lens' PParams SlotCount
- factorA :: Lens' PParams FactorA
- factorB :: Lens' PParams FactorB
- maxBkSz :: Lens' PParams Natural
- maxHdrSz :: Lens' PParams Natural
- maxPropSz :: Lens' PParams Natural
- maxTxSz :: Lens' PParams Natural
- scriptVersion :: Lens' PParams Natural
- upAdptThd :: Lens' PParams UpAdptThd
- upTtl :: Lens' PParams SlotCount
- data SwVer = SwVer {}
- newtype ApVer = ApVer Natural
- newtype ApName = ApName String
- pvAlt :: Lens' ProtVer Natural
- pvMaj :: Lens' ProtVer Natural
- pvMin :: Lens' ProtVer Natural
- data UProp = UProp {}
- data Metadata = Metadata
- type STag = String
- type UpSD = (ProtVer, PParams, SwVer, Set STag, Metadata)
- svName :: Lens' SwVer ApName
- svVer :: Lens' SwVer ApVer
- data Vote = Vote {}
- data UpregPredicateFailure
- data UPREG
- data UpvPredicateFailure
- data UPV
- data UppvvPredicateFailure
- data UPPVV
- data UpsvvPredicateFailure
- data UPSVV
- data UpdateConstraintViolation
- upId :: Lens' UProp UpId
- upIssuer :: Lens' UProp VKey
- upMdt :: Lens' UProp Metadata
- upPV :: Lens' UProp ProtVer
- upParams :: Lens' UProp PParams
- upSTags :: Lens' UProp (Set STag)
- upSig :: Lens' UProp (Sig UpSD)
- upSwVer :: Lens' UProp SwVer
- upSigData :: Lens' UProp UpSD
- 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
- (==>) :: Bool -> Bool -> Bool
- pvCanFollow :: ProtVer -> ProtVer -> Bool
- checkUpdateConstraints :: PParams -> UProp -> [UpdateConstraintViolation]
- (<=?) :: Ord a => a -> a -> Maybe (a, Threshold a)
- orError :: Maybe (a, b) -> (a -> b -> e) -> Maybe e
- canUpdate :: PParams -> UProp -> Rule UPPVV ctx ()
- svCanFollow :: Map ApName (ApVer, Slot, Metadata) -> (ApName, ApVer) -> Bool
- data UpiecPredicateFailure = PVBUMPFailure (PredicateFailure PVBUMP)
- data UPIEC
- data PvbumpPredicateFailure = NoPVBUMPFailure
- data PVBUMP
- data UpiendPredicateFailure = UPENDFailure (PredicateFailure UPEND)
- data UPIEND
- data UpivotesPredicateFailure = ApplyVotesFailure (PredicateFailure APPLYVOTES)
- data UPIVOTES
- data ApplyVotesPredicateFailure = UpivoteFailure (PredicateFailure UPIVOTE)
- data APPLYVOTES
- data UpivotePredicateFailure = UPVOTEFailure (PredicateFailure UPVOTE)
- data UPIVOTE
- data UpiregPredicateFailure = UPREGFailure (PredicateFailure UPREG)
- data UPIREG
- 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)
- type UPIEnv = (Slot, Bimap VKeyGenesis VKey, BlockCount, Word8)
- data UpendPredicateFailure
- data UPEND
- data FadsPredicateFailure
- data FADS
- data UpvotePredicateFailure
- data UPVOTE
- data AddvotePredicateFailure
- data ADDVOTE
- vCaster :: Lens' Vote VKey
- vPropId :: Lens' Vote UpId
- vSig :: Lens' Vote (Sig UpId)
- mkVote :: VKey -> UpId -> Vote
- findKey :: (v -> Bool) -> Map k v -> Maybe (k, v)
- delegationMap :: UPIEnv -> Bimap VKeyGenesis VKey
- 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
- dmapGen :: Word8 -> Gen (Bimap VKeyGenesis VKey)
- ppsUpdateFrom :: PParams -> Gen PParams
- increasingProbabilityAt :: Gen a -> (a, a) -> Gen a
- randomUpId :: Gen UpId
- reSign :: UProp -> UProp
- pickHighlyEndorsedProtocolVersion :: [(ProtVer, Set VKeyGenesis)] -> Gen (Maybe ProtVer)
- updateProposalAndVotesGen :: UPIEnv -> UPIState -> Gen (Maybe UProp, [Vote])
- protocolVersionEndorsementGen :: UPIEnv -> UPIState -> Gen ProtVer
- goblinData_UPIREG_UPREGFailure_DoesNotVerify :: GoblinData Bool
- goblinGen_UPIREG_UPREGFailure_DoesNotVerify :: SignalGenerator UPIREG
- goblinData_UPIREG_UPREGFailure_NotGenesisDelegate :: GoblinData Bool
- goblinGen_UPIREG_UPREGFailure_NotGenesisDelegate :: SignalGenerator UPIREG
- goblinData_UPIREG_UPREGFailure_UPVFailure_AVChangedInPVUpdate :: GoblinData Bool
- goblinGen_UPIREG_UPREGFailure_UPVFailure_AVChangedInPVUpdate :: SignalGenerator UPIREG
- goblinData_UPIREG_UPREGFailure_UPVFailure_PVChangedInSVUpdate :: GoblinData Bool
- goblinGen_UPIREG_UPREGFailure_UPVFailure_PVChangedInSVUpdate :: SignalGenerator UPIREG
- goblinData_UPIREG_UPREGFailure_UPVFailure_ParamsChangedInSVUpdate :: GoblinData Bool
- goblinGen_UPIREG_UPREGFailure_UPVFailure_ParamsChangedInSVUpdate :: SignalGenerator UPIREG
- goblinData_UPIREG_UPREGFailure_UPVFailure_UPPVVFailure_CannotFollowPv :: GoblinData Bool
- goblinGen_UPIREG_UPREGFailure_UPVFailure_UPPVVFailure_CannotFollowPv :: SignalGenerator UPIREG
- goblinData_UPIREG_UPREGFailure_UPVFailure_UPPVVFailure_CannotUpdatePv :: GoblinData Bool
- goblinGen_UPIREG_UPREGFailure_UPVFailure_UPPVVFailure_CannotUpdatePv :: SignalGenerator UPIREG
- goblinData_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_AlreadyProposedSv :: GoblinData Bool
- goblinGen_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_AlreadyProposedSv :: SignalGenerator UPIREG
- goblinData_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_CannotFollowSv :: GoblinData Bool
- goblinGen_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_CannotFollowSv :: SignalGenerator UPIREG
- goblinData_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_InvalidApplicationName :: GoblinData Bool
- goblinGen_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_InvalidApplicationName :: SignalGenerator UPIREG
- goblinData_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_InvalidSystemTags :: GoblinData Bool
- goblinGen_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_InvalidSystemTags :: SignalGenerator UPIREG
- goblinGensUPIREG :: [SignalGenerator UPIREG]
- goblinData_UPIVOTES_ApplyVotesFailure_UpivoteFailure_UPVOTEFailure_ADDVOTEFailure_AVSigDoesNotVerify :: GoblinData Bool
- goblinGen_UPIVOTES_ApplyVotesFailure_UpivoteFailure_UPVOTEFailure_ADDVOTEFailure_AVSigDoesNotVerify :: SignalGenerator UPIVOTES
- goblinData_UPIVOTES_ApplyVotesFailure_UpivoteFailure_UPVOTEFailure_ADDVOTEFailure_NoUpdateProposal :: GoblinData Bool
- goblinGen_UPIVOTES_ApplyVotesFailure_UpivoteFailure_UPVOTEFailure_ADDVOTEFailure_NoUpdateProposal :: SignalGenerator UPIVOTES
- goblinGensUPIVOTES :: [SignalGenerator UPIVOTES]
- tamperWithUpdateProposal :: UPIEnv -> UPIState -> UProp -> Gen UProp
- tamperWithVotes :: UPIEnv -> UPIState -> [Vote] -> Gen [Vote]
- tamperWithVote :: Vote -> Gen Vote
- type family PredicateFailure a = (b :: Type) | b -> a
Documentation
Protocol parameters.
Constructors
PParams | |
Fields
|
Instances
Instances
Instances
Instances
Eq FactorB Source # | |
Data FactorB Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FactorB -> c FactorB # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FactorB # toConstr :: FactorB -> Constr # dataTypeOf :: FactorB -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FactorB) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FactorB) # gmapT :: (forall b. Data b => b -> b) -> FactorB -> FactorB # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FactorB -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FactorB -> r # gmapQ :: (forall d. Data d => d -> u) -> FactorB -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FactorB -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FactorB -> m FactorB # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FactorB -> m FactorB # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FactorB -> m FactorB # | |
Ord FactorB Source # | |
Defined in Byron.Spec.Ledger.Update | |
Show FactorB Source # | |
Generic FactorB Source # | |
Hashable FactorB Source # | |
AddShrinks FactorB Source # | |
Defined in Byron.Spec.Ledger.Update | |
SeedGoblin FactorB Source # | |
NoThunks FactorB Source # | |
HasTypeReps FactorB Source # | |
GeneOps g => Goblin g FactorB Source # | |
type Rep FactorB Source # | |
Defined in Byron.Spec.Ledger.Update |
Instances
Eq FactorA Source # | |
Data FactorA Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FactorA -> c FactorA # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FactorA # toConstr :: FactorA -> Constr # dataTypeOf :: FactorA -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FactorA) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FactorA) # gmapT :: (forall b. Data b => b -> b) -> FactorA -> FactorA # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FactorA -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FactorA -> r # gmapQ :: (forall d. Data d => d -> u) -> FactorA -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FactorA -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FactorA -> m FactorA # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FactorA -> m FactorA # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FactorA -> m FactorA # | |
Ord FactorA Source # | |
Defined in Byron.Spec.Ledger.Update | |
Show FactorA Source # | |
Generic FactorA Source # | |
Hashable FactorA Source # | |
AddShrinks FactorA Source # | |
Defined in Byron.Spec.Ledger.Update | |
SeedGoblin FactorA Source # | |
NoThunks FactorA Source # | |
HasTypeReps FactorA Source # | |
GeneOps g => Goblin g FactorA Source # | |
type Rep FactorA Source # | |
Defined in Byron.Spec.Ledger.Update |
Protocol version
Instances
Instances
Eq UpId Source # | |
Data UpId Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UpId -> c UpId # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UpId # dataTypeOf :: UpId -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UpId) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UpId) # gmapT :: (forall b. Data b => b -> b) -> UpId -> UpId # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UpId -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UpId -> r # gmapQ :: (forall d. Data d => d -> u) -> UpId -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UpId -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UpId -> m UpId # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UpId -> m UpId # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UpId -> m UpId # | |
Ord UpId Source # | |
Show UpId Source # | |
Generic UpId Source # | |
Hashable UpId Source # | |
AddShrinks UpId Source # | |
Defined in Byron.Spec.Ledger.Update | |
SeedGoblin UpId Source # | |
NoThunks UpId Source # | |
HasTypeReps UpId Source # | |
GeneOps genome => Goblin genome UpId Source # | |
type Rep UpId Source # | |
Defined in Byron.Spec.Ledger.Update |
Instances
Eq SwVer Source # | |
Data SwVer Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SwVer -> c SwVer # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SwVer # dataTypeOf :: SwVer -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SwVer) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SwVer) # gmapT :: (forall b. Data b => b -> b) -> SwVer -> SwVer # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SwVer -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SwVer -> r # gmapQ :: (forall d. Data d => d -> u) -> SwVer -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SwVer -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SwVer -> m SwVer # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SwVer -> m SwVer # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SwVer -> m SwVer # | |
Show SwVer Source # | |
Generic SwVer Source # | |
Hashable SwVer Source # | |
AddShrinks SwVer Source # | |
Defined in Byron.Spec.Ledger.Update | |
SeedGoblin SwVer Source # | |
NoThunks SwVer Source # | |
HasTypeReps SwVer Source # | |
GeneOps genome => Goblin genome 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-0.1.0.0-AWpYh6fpW7YLETcmEzrAvm" 'False) (C1 ('MetaCons "SwVer" 'PrefixI 'True) (S1 ('MetaSel ('Just "_svName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ApName) :*: S1 ('MetaSel ('Just "_svVer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ApVer))) |
Application version
Instances
Eq ApVer Source # | |
Data ApVer Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ApVer -> c ApVer # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ApVer # dataTypeOf :: ApVer -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ApVer) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ApVer) # gmapT :: (forall b. Data b => b -> b) -> ApVer -> ApVer # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ApVer -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ApVer -> r # gmapQ :: (forall d. Data d => d -> u) -> ApVer -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ApVer -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ApVer -> m ApVer # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ApVer -> m ApVer # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ApVer -> m ApVer # | |
Num ApVer Source # | |
Ord ApVer Source # | |
Show ApVer Source # | |
Generic ApVer Source # | |
Hashable ApVer Source # | |
AddShrinks ApVer Source # | |
Defined in Byron.Spec.Ledger.Update | |
SeedGoblin ApVer Source # | |
NoThunks ApVer Source # | |
HasTypeReps ApVer Source # | |
GeneOps genome => Goblin genome ApVer Source # | |
type Rep ApVer Source # | |
Defined in Byron.Spec.Ledger.Update |
Instances
Eq ApName Source # | |
Data ApName Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ApName -> c ApName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ApName # toConstr :: ApName -> Constr # dataTypeOf :: ApName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ApName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ApName) # gmapT :: (forall b. Data b => b -> b) -> ApName -> ApName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ApName -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ApName -> r # gmapQ :: (forall d. Data d => d -> u) -> ApName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ApName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ApName -> m ApName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ApName -> m ApName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ApName -> m ApName # | |
Ord ApName Source # | |
Show ApName Source # | |
Generic ApName Source # | |
Hashable ApName Source # | |
AddShrinks ApName Source # | |
Defined in Byron.Spec.Ledger.Update | |
SeedGoblin ApName Source # | |
NoThunks ApName Source # | |
HasTypeReps ApName Source # | |
GeneOps genome => Goblin genome ApName Source # | |
type Rep ApName Source # | |
Defined in Byron.Spec.Ledger.Update |
Update proposal
Constructors
UProp | |
Instances
For now we do not have any requirements on metadata.
Constructors
Metadata |
Instances
Eq Metadata Source # | |
Data Metadata Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Metadata -> c Metadata # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Metadata # toConstr :: Metadata -> Constr # dataTypeOf :: Metadata -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Metadata) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Metadata) # gmapT :: (forall b. Data b => b -> b) -> Metadata -> Metadata # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Metadata -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Metadata -> r # gmapQ :: (forall d. Data d => d -> u) -> Metadata -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Metadata -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Metadata -> m Metadata # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Metadata -> m Metadata # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Metadata -> m Metadata # | |
Ord Metadata Source # | |
Defined in Byron.Spec.Ledger.Update | |
Show Metadata Source # | |
Generic Metadata Source # | |
Hashable Metadata Source # | |
AddShrinks Metadata Source # | |
Defined in Byron.Spec.Ledger.Update | |
SeedGoblin Metadata Source # | |
NoThunks Metadata Source # | |
HasTypeReps Metadata Source # | |
GeneOps genome => Goblin genome Metadata Source # | |
HasTypeReps (ProtVer, PParams, SwVer, Set STag, Metadata) Source # | |
type Rep Metadata Source # | |
System tag, this represents a target operating system for the update (e.g.
linux
, win64
, or mac32
).
type UpSD = (ProtVer, PParams, SwVer, Set STag, Metadata) Source #
Part of the update proposal which must be signed
Instances
Eq Vote Source # | |
Data Vote Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Vote -> c Vote # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Vote # dataTypeOf :: Vote -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Vote) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Vote) # gmapT :: (forall b. Data b => b -> b) -> Vote -> Vote # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Vote -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Vote -> r # gmapQ :: (forall d. Data d => d -> u) -> Vote -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Vote -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Vote -> m Vote # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Vote -> m Vote # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Vote -> m Vote # | |
Show Vote Source # | |
Generic Vote Source # | |
Hashable Vote Source # | |
AddShrinks Vote Source # | |
Defined in Byron.Spec.Ledger.Update | |
NoThunks Vote Source # | |
HasTypeReps Vote Source # | |
GeneOps genome => Goblin genome 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-0.1.0.0-AWpYh6fpW7YLETcmEzrAvm" '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))))) |
data UpregPredicateFailure Source #
These PredicateFailure
s are all throwable.
Constructors
UPVFailure (PredicateFailure UPV) | |
NotGenesisDelegate | |
DoesNotVerify |
Instances
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
Update proposal validity
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
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
Update Proposal Software Version Validation
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
getUpSigData :: UProp -> UpSD Source #
inMap :: (Ord key, Eq v) => key -> v -> Map key v -> Bool Source #
Test if a pair is present in a map.
invertMap :: (Ord k, Ord v) => Map k v -> Map v (Set k) Source #
Invert a map
Examples:
>>>
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:
>>>
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
data UpiecPredicateFailure Source #
Constructors
PVBUMPFailure (PredicateFailure PVBUMP) |
Instances
Instances
data PvbumpPredicateFailure Source #
Constructors
NoPVBUMPFailure |
Instances
Instances
data UpiendPredicateFailure Source #
Constructors
UPENDFailure (PredicateFailure UPEND) |
Instances
Instances
data UpivotesPredicateFailure Source #
Constructors
ApplyVotesFailure (PredicateFailure APPLYVOTES) |
Instances
Instances
data ApplyVotesPredicateFailure Source #
Constructors
UpivoteFailure (PredicateFailure UPIVOTE) |
Instances
data APPLYVOTES Source #
Instances
data UpivotePredicateFailure Source #
Constructors
UPVOTEFailure (PredicateFailure UPVOTE) |
Instances
Instances
data UpiregPredicateFailure Source #
Constructors
UPREGFailure (PredicateFailure UPREG) |
Instances
Instances
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.
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.
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
Instances
data FadsPredicateFailure Source #
Instances
Instances
Data FADS Source # | |
Defined in Byron.Spec.Ledger.Update Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FADS -> c FADS # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FADS # dataTypeOf :: FADS -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FADS) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FADS) # gmapT :: (forall b. Data b => b -> b) -> FADS -> FADS # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FADS -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FADS -> r # gmapQ :: (forall d. Data d => d -> u) -> FADS -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FADS -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FADS -> m FADS # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FADS -> m FADS # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FADS -> m FADS # | |
Generic FADS Source # | |
STS FADS Source # | |
Defined in Byron.Spec.Ledger.Update Associated Types type Environment FADS Source # type BaseM FADS :: Type -> Type Source # type PredicateFailure FADS = (b :: Type) Source # Methods initialRules :: [InitialRule FADS] Source # transitionRules :: [TransitionRule FADS] Source # assertions :: [Assertion FADS] Source # renderAssertionViolation :: AssertionViolation FADS -> String Source # | |
Embed FADS UPEND Source # | |
Defined in Byron.Spec.Ledger.Update Methods wrapFailed :: PredicateFailure FADS -> PredicateFailure UPEND Source # | |
type Rep FADS Source # | |
type PredicateFailure FADS Source # | |
Defined in Byron.Spec.Ledger.Update | |
type BaseM FADS Source # | |
Defined in Byron.Spec.Ledger.Update | |
type Environment FADS Source # | |
Defined in Byron.Spec.Ledger.Update | |
type Signal FADS Source # | |
type State FADS Source # | |
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 AddvotePredicateFailure Source #
These PredicateFailure
s are all throwable.
Constructors
AVSigDoesNotVerify | |
NoUpdateProposal UpId | |
VoteByNonGenesisDelegate VKey | |
RepeatVoteByGenesisDelegate VKey |
Instances
Instances
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.
delegationMap :: UPIEnv -> Bimap VKeyGenesis VKey Source #
protocolVersion :: UPIState -> ProtVer Source #
protocolParameters :: UPIState -> PParams Source #
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.
goblinGen_UPIREG_UPREGFailure_UPVFailure_UPPVVFailure_CannotFollowPv :: SignalGenerator UPIREG Source #
goblinGen_UPIREG_UPREGFailure_UPVFailure_UPPVVFailure_CannotUpdatePv :: SignalGenerator UPIREG Source #
goblinData_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_AlreadyProposedSv :: GoblinData Bool Source #
goblinGen_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_AlreadyProposedSv :: SignalGenerator UPIREG Source #
goblinGen_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_CannotFollowSv :: SignalGenerator UPIREG Source #
goblinData_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_InvalidApplicationName :: GoblinData Bool Source #
goblinGen_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_InvalidApplicationName :: SignalGenerator UPIREG Source #
goblinData_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_InvalidSystemTags :: GoblinData Bool Source #
goblinGen_UPIREG_UPREGFailure_UPVFailure_UPSVVFailure_InvalidSystemTags :: SignalGenerator UPIREG Source #
goblinData_UPIVOTES_ApplyVotesFailure_UpivoteFailure_UPVOTEFailure_ADDVOTEFailure_AVSigDoesNotVerify :: GoblinData Bool Source #
goblinGen_UPIVOTES_ApplyVotesFailure_UpivoteFailure_UPVOTEFailure_ADDVOTEFailure_AVSigDoesNotVerify :: SignalGenerator UPIVOTES Source #
goblinData_UPIVOTES_ApplyVotesFailure_UpivoteFailure_UPVOTEFailure_ADDVOTEFailure_NoUpdateProposal :: GoblinData Bool Source #
goblinGen_UPIVOTES_ApplyVotesFailure_UpivoteFailure_UPVOTEFailure_ADDVOTEFailure_NoUpdateProposal :: SignalGenerator UPIVOTES Source #
tamperWithUpdateProposal :: UPIEnv -> UPIState -> UProp -> Gen UProp Source #
Tamper with the update proposal in such a way that the following predicate failures are triggered with equal probability:
- UPREGFailure
- UPVFailure
- UPVFailure
- UPPVVFailure
- CannotFollowPv
- CannotUpdatePv
- AlreadyProposedPv
- UPSVVFailure
- AlreadyProposedSv
- CannotFollowSv
- InvalidApplicationName
- InvalidSystemTags
- AVChangedInPVUpdate
- ParamsChangedInSVUpdate
- PVChangedInSVUpdate
- NotGenesisDelegate
- DoesNotVerify
tamperWithVotes :: UPIEnv -> UPIState -> [Vote] -> Gen [Vote] Source #
Tamper with some of the votes provided as parameter in such a way that the following predicate failures are triggered with equal probability:
- AVSigDoesNotVerify
- NoUpdateProposal
type family PredicateFailure a = (b :: Type) | b -> 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.