Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

runtime-api/ParachainHost: generate_key_ownership_proof #6560

Closed
ordian opened this issue Jan 16, 2023 · 0 comments · Fixed by #6667
Closed

runtime-api/ParachainHost: generate_key_ownership_proof #6560

ordian opened this issue Jan 16, 2023 · 0 comments · Fixed by #6667
Assignees
Labels
T5-parachains_protocol This PR/Issue is related to Parachains features and protocol changes.

Comments

@ordian
Copy link
Member

ordian commented Jan 16, 2023

Part of paritytech/substrate#5947.

This will be similar to

fn generate_key_ownership_proof(
_set_id: fg_primitives::SetId,
authority_id: fg_primitives::AuthorityId,
) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {
use parity_scale_codec::Encode;
Historical::prove((fg_primitives::KEY_TYPE, authority_id))
.map(|p| p.encode())
.map(fg_primitives::OpaqueKeyOwnershipProof::new)
}

The AuthorityId in this case could be ValidatorId.

The caller of this API will need to pass the relay_parent of the candidate when CandidateIncluded event was emitted. This way we can guarantee that the session_index of that relay_parent is the one we need for the key ownership proof.

Consideration: note that session_index from the parachains perspective and from sesssion(/historical) can differ. Make sure we're not making an off-by-one error on session boundaries when calculating the key ownership proof.

Alternatively, implement a fix for paritytech/polkadot-sdk#279.

@ordian ordian added the T5-parachains_protocol This PR/Issue is related to Parachains features and protocol changes. label Jan 16, 2023
@ordian ordian self-assigned this Feb 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T5-parachains_protocol This PR/Issue is related to Parachains features and protocol changes.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant