8

The set_keys extrinsic in pallet_session has a second argument proof, which seems to be intended as an ownership proof of the keys.

Looking at the body, there is a call to ownership_proof_is_valid.

The ownership_proof_is_valid method is defined on the OpaqueKeys trait, with a default implementation that just returns true.

The intended way to implement OpaqueKeys is, as far as I know, to use the impl_opaque_keys macro. That macro, however generates an implementation that does not override the default implementation of ownership_proof_is_valid.

It seems to me, then, that in practice ownership_proof_is_valid will always return true. If that's the case, what is the purpose of the proof argument?

1

1 Answer 1

0

It looks like dead code to me, and confusing API.

I opened an issue here https://github.com/paritytech/polkadot-sdk/issues/3218

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.