ChainSafe / ChainSafe/gossamer

Make sure that gossamer can retrieve non-empty key ownership proof

Open
#3,003 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

## Issue summary
- Arose from https://github.com/ChainSafe/gossamer/pull/2947

As part of the PR https://github.com/ChainSafe/gossamer/pull/2947, we added two runtime functions, BabeGenerateKeyOwnershipProof and BabeSubmitReportEquivocationUnsignedExtrinsic.

Currently BabeGenerateKeyOwnershipProof always returns empty byte array.

Explanation of what BabeGenerateKeyOwnershipProof runtime call does from substrate code base
```
/// Generates a proof of key ownership for the given authority in the
/// current epoch. An example usage of this module is coupled with the
/// session historical module to prove that a given authority key is
/// tied to a given staking identity during a specific session.
```

From my understanding and testing the runtime functions added int that PR (#2947) are correct.
So, the reason why key ownership proof is coming out to be empty is because we are not performing some task that runtime expects from us.
BabeGenerateKeyOwnershipProof accepts a slot number and authority id.
Going through the implementation of BabeGenerateKeyOwnershipProof, it looks like that function is looking for through block state and looking for authority id in trie.

The task is to find why we are always getting empty key ownership proof and satisfy the conditions required to see non empty key ownership proofs

## Other information and links

- Internal logic from substrate for generate key ownership proof
https://github.com/paritytech/substrate/blob/13664c388d59b4c83dcb90a27700a9b68abe0305/frame/session/src/historical/mod.rs#L280
https://github.com/paritytech/substrate/blob/13664c388d59b4c83dcb90a27700a9b68abe0305/frame/session/src/historical/mod.rs#L324

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.