Mavryk_raw_protocol_001_PtAtLas.Delegate_consensus_key
Management of a delegate's consensus key, the one used to sign blocks and consensus operations. It is responsible for maintaining the tables Storage.Consensus_keys
, Storage.Contract.Consensus_key
, and Storage
.Contract.Pending_consensus_keys.
type Mavryk_protocol_environment_001_PtAtLas.Error_monad.error +=
| Invalid_consensus_key_update_noop of Cycle_repr.t
| Invalid_consensus_key_update_active
| Invalid_consensus_key_update_tz4 of Mavryk_protocol_environment_001_PtAtLas.Bls.Public_key.t
type pk = Raw_context.consensus_pk = {
delegate : Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t;
consensus_pk : Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key.t;
consensus_pkh : Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t;
}
The public key of a consensus key and the associated delegate.
type t = {
delegate : Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t;
consensus_pkh : Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t;
}
The public key hash of a consensus key and the associated delegate.
val zero : t
val pp : Mavryk_protocol_environment_001_PtAtLas.Format.formatter -> t -> unit
val check_not_tz4 :
Mavryk_protocol_environment_001_PtAtLas.Signature.public_key ->
unit Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
check_not_tz4 pk
checks that pk
is not a BLS address.
val init :
Raw_context.t ->
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t ->
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key.t ->
Raw_context.t Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.t
Initialize the consensus key when registering a delegate.
val active_pubkey :
Raw_context.t ->
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t ->
pk Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.t
Returns the active consensus key for the current cycle.
val active_key :
Raw_context.t ->
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t ->
t Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.t
Returns the active consensus key for the current cycle.
val active_pubkey_for_cycle :
Raw_context.t ->
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t ->
Cycle_repr.t ->
pk Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.t
Returns the active consensus key for the given cycle.
val pending_updates :
Raw_context.t ->
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t ->
(Cycle_repr.t
* Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t
* Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key.t)
list
Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.t
Returns the list of pending consensus-key updates in upcoming cycles.
val register_update :
Raw_context.t ->
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t ->
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key.t ->
Raw_context.t Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.t
Register a consensus-key update.
val activate :
Raw_context.t ->
new_cycle:Cycle_repr.t ->
Raw_context.t Mavryk_protocol_environment_001_PtAtLas.Lwt.t
Activate consensus keys at the beginning of cycle new_cycle
.