Alpha_context.ConsensusThis module re-exports definitions from Raw_context.Consensus.
include Raw_context.CONSENSUS
with type t := t
and type slot := Slot.t
and type 'a slot_map := 'a Slot.Map.t
and type slot_set := Slot.Set.t
and type round := Round.t
and type consensus_pk := Consensus_key.pkval allowed_attestations :
t ->
(Consensus_key.pk * int * int) Slot.Map.t optionReturns a map where from the initial slot of each attester in the TB committee for a given level, to the attester's public key and its consensus power and DAL power.
val allowed_preattestations :
t ->
(Consensus_key.pk * int * int) Slot.Map.t optionSee allowed_attestations.
val forbidden_delegates :
t ->
Mavryk_protocol_environment_alpha.Signature.Public_key_hash.Set.tReturns the set of delegates that are not allowed to bake or attest blocks; i.e., delegates which have zero frozen deposit due to a previous slashing.
Missing pre-computed map by first slot. This error should not happen.
val current_attestation_power : t -> intattestation power ctx returns the attestation power of the current block.
val initialize_consensus_operation :
t ->
allowed_attestations:(Consensus_key.pk * int * int) Slot.Map.t option ->
allowed_preattestations:(Consensus_key.pk * int * int) Slot.Map.t option ->
tInitializes the map of allowed attestations and preattestations, this function must be called only once and before applying any consensus operation.
val record_attestation :
t ->
initial_slot:Slot.t ->
power:int ->
t Mavryk_protocol_environment_alpha.Error_monad.tzresultrecord_attestation ctx ~initial_slot ~power records an attestation for the current block.
The attestation should be valid in the sense that Int_map.find_opt initial_slot allowed_attestation ctx = Some
(pkh, power).
val record_preattestation :
t ->
initial_slot:Slot.t ->
power:int ->
Round.t ->
t Mavryk_protocol_environment_alpha.Error_monad.tzresultrecord_preattestation ctx ~initial_slot ~power round
payload_hash power records a preattestation for a proposal at round with payload payload_hash.
The preattestation should be valid in the sense that Int_map.find_opt initial_slot allowed_preattestation ctx = Some
(pkh, power).
val forbid_delegate :
t ->
Mavryk_protocol_environment_alpha.Signature.Public_key_hash.t ->
tforbid_delegate ctx delegate adds delegate to the set of forbidden delegates, which prevents this delegate from baking or attesting.
val set_forbidden_delegates :
t ->
Mavryk_protocol_environment_alpha.Signature.Public_key_hash.Set.t ->
tset_forbidden_delegate ctx delegates sets delegates as the current forbidden delegates.
val attestations_seen : t -> Slot.Set.tget_preattestations_quorum_round ctx returns None if no preattestation are included in the current block. Otherwise, return Some r where r is the round of the preattestations included in the block.
set_preattestations_quorum_round ctx round sets the round for preattestations included in this block. This function should be called only once.
This function is only used in Full_construction mode.
locked_round_evidence ctx returns the round of the recorded preattestations as well as their power.
val set_attestation_branch :
t ->
(Mavryk_protocol_environment_alpha.Block_hash.t * Block_payload_hash.t) ->
tval attestation_branch :
t ->
(Mavryk_protocol_environment_alpha.Block_hash.t * Block_payload_hash.t)
optionval store_attestation_branch :
context ->
(Mavryk_protocol_environment_alpha.Block_hash.t * Block_payload_hash.t) ->
context Mavryk_protocol_environment_alpha.Lwt.tstore_attestation_branch context branch sets the "attestation branch" (see Storage.Tenderbake.Attestation_branch to branch in both the disk storage and RAM.