Raw_context.Consensus
val allowed_attestations : t -> (consensus_pk * int) Slot_repr.Map.t option
Returns a map where each attester's pkh is associated to the list of its attesting slots (in decreasing order) for a given level.
val allowed_preattestations : t -> (consensus_pk * int) Slot_repr.Map.t option
Returns a map where each attester's pkh is associated to the list of its attesting slots (in decreasing order) for a given level.
val forbidden_delegates :
t ->
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.Set.t
Returns 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 -> int
attestation power ctx
returns the attestation power of the current block.
val initialize_consensus_operation :
t ->
allowed_attestations:(consensus_pk * int) Slot_repr.Map.t option ->
allowed_preattestations:(consensus_pk * int) Slot_repr.Map.t option ->
t
Initializes 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_repr.t ->
power:int ->
t Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
record_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_repr.t ->
power:int ->
Round_repr.t ->
t Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
record_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_001_PtAtLas.Signature.Public_key_hash.t ->
t
forbid_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_001_PtAtLas.Signature.Public_key_hash.Set.t ->
t
set_forbidden_delegate ctx delegates
sets delegates
as the current forbidden delegates.
val attestations_seen : t -> Slot_repr.Set.t
val get_preattestations_quorum_round : t -> Round_repr.t option
get_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.
val set_preattestations_quorum_round : t -> Round_repr.t -> t
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.
val locked_round_evidence : t -> (Round_repr.t * int) option
locked_round_evidence ctx
returns the round of the recorded preattestations as well as their power.
val set_attestation_branch :
t ->
(Mavryk_protocol_environment_001_PtAtLas.Block_hash.t * Block_payload_hash.t) ->
t
val attestation_branch :
t ->
(Mavryk_protocol_environment_001_PtAtLas.Block_hash.t * Block_payload_hash.t)
option