Exercise 12
Objectives: finality-aleph, authority communication
Needs: Exercise 03
Content: We will add new consequence of banishing.
Our goal is to make the method finality-aleph::crypto::AuthorityVerifier::verify fail for banished authorities. In other words, any message signed by a banished node should be considered as incorrectly signed.
AuthorityVerifier (and the pallet aleph) operates on the type AuthorityId, which is actually just the Aleph session key type. So far, in the banishment pallet we were working with plain accounts. In order to complete this task, you will have to eventually find a correspondence between validator's account and their session key. This relation is explicitly provided in pallets/aleph/src/lib.rs/OneSessionHandler::on_new_session(). Thus you can save and expose this information from pallet aleph and use it later.
Hint
Find already existing structures/traits that provide information from runtime to finality-aleph (node part).
Hint 2
Extend primitives/AlephSessionApi with a method providing banished authorities.
Then, in verify challenge authorities.get(index.0) against the list of banished accounts.
The easiest way of verifying your solution is to add logging around verify method.
This hacking signature verification is for training purposes only. Such semantics should be done with far more delicacy and care.
Last updated
Was this helpful?