Crate authority_selection_inherents

Crate authority_selection_inherents 

Source
Expand description

§Partner Chain Committee Selection

Inherent data provider and selection logic for Partner Chain committee selection.

§Overview

This crate provides an IDP and all types necessary for a Partner Chain to select block producer committees using data sourced from Cardano smart contracts.

§Usage

§Prerequisites

This crate is intended to work with pallet_session_validator_management. See the pallet’s documentation for instructions how to add it to you runtime. Your pallet should be configured with CommitteeMember as its CommitteeMember, using the CrossChainPublic and SessionKeys defined described in the pallet’s documentation.

Additionally AriadneInherentDataProvider needs access to a data source implementing AuthoritySelectionDataSource. A Db-Sync-based implementation is provided by the partner_chains_db_sync_data_sources crate.

§Adding to the node

§Implementing runtime API

Implement the [SessionValidatorManagementApi] for your runtime. Each API method has a corresponding method in the pallet that should be used for that purpose. Refer to the demo runtime for an example.

§Add the inherent data provider

Wire the AriadneInherentDataProvider into your inherent data provider stack. The same constructor AriadneInherentDataProvider::new should be used for both proposing and validating blocks. Refer to the demo node implementation for an example of how to wire it correctly into a node.

Structs§

AriadneInherentDataProvider
Inherent data provider providing inputs for authority selection.
AriadneParameters
Ariadne selection algorithm parameters owned by the Partner Chain Governance Authority.
AuthoritySelectionInputs
Inherent data type provided by crate::AriadneInherentDataProvider. The part of data for selection of authorities that comes from the main chain. It is unfiltered, so the selection algorithm should filter out invalid candidates.
RegisterValidatorSignedMessage
Signed Message of the Authority Candidate to register It’s ToDatum implementation has to produce datum that has to match main chain structure, because it will be hashed and signed for signature verification.

Enums§

CommitteeMember
Type representing committee members, either permissioned or registered
PermissionedCandidateDataError
Permissioned candidate data error type
RegistrationDataError
Registration data error type
StakeError
Stake validation error type

Traits§

AuthoritySelectionDataSource
Queries about the Authority Candidates
CandidateValidationApi
Runtime API trait for candidate validation
MaybeFromCandidateKeys
Trait to try extract implementing type from [CandidateKeys].

Functions§

filter_trustless_candidates_registrations
Get the valid trustless candidates from the registrations from inherent data
select_authorities
Selects authorities using the Ariadne selection algorithm and data sourced from Partner Chains smart contracts on Cardano. Seed is constructed from the MC epoch nonce and the sidechain epoch.
validate_permissioned_candidate_data
Validates Account keys and Partner Chain public keys of [PermissionedCandidateData].
validate_registration_data
Validates registration data provided by the authority candidate.
validate_stake
Validates stake delegation. Stake must be known and positive.