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§
- Ariadne
Inherent Data Provider - Inherent data provider providing inputs for authority selection.
- Ariadne
Parameters - Ariadne selection algorithm parameters owned by the Partner Chain Governance Authority.
- Authority
Selection Inputs - 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.
- Register
Validator Signed Message - 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§
- Committee
Member - Type representing committee members, either permissioned or registered
- Permissioned
Candidate Data Error - Permissioned candidate data error type
- Registration
Data Error - Registration data error type
- Stake
Error - Stake validation error type
Traits§
- Authority
Selection Data Source - Queries about the Authority Candidates
- Candidate
Validation Api - Runtime API trait for candidate validation
- Maybe
From Candidate Keys - 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.