Obtaining the node's owner key from the client is not obvious.
In the runtime, when using BABE, the author's owner key is found from the author's index in the validator set. This id is obtained from the block's digest with the key BABE (see the functions find_author in the pallets authorship, session and babe). Knowing that should help finding where this id is found when building the block.
My understanding, developing a bit on what you just wrote:
when a smith publishes an evaluation result within an inherent, it uses an AccountId to identify himself:
let author = pallet_authorship::Pallet::<T>::author().ok_or(Error::<T>::NoAuthor)?;
This function author() reads the storage value of Author which is a temporary value that changes within a block but is always erased on on_finalized. If this storage value has not been written, it calls the FindAuthor::find_author() method of configured FindAuthor.
With our current config of FindAuthor, this is pallet_session::FindAccountFromAuthorIndex<Self, Babe>;. This leads to call the find_author() method of Babe.
find authority_index index
get the item at this position in Validators storage
This indeed returns the value that we put here. See #197 (closed) for why I was uncomfortable with that.
at each block, the smith calls InherentDataProvider which can return Some(result) or None, the inherent is only called if Some result:
With this architecture, it is the InherentDataProvider which is responsible to tell whether or not a result has been published (it is fine, we do not want to do this in the runtime). It currently tries to achieve this by checking if any of the keys present in published_results is present in local list:
let babe_owner_keys = std::sync::Arc::new(sp_keystore::Keystore::sr25519_public_keys( keystore_ptr.as_ref(), sp_runtime::KeyTypeId(*b"babe"), ));// .map(|&key| sp_runtime::AccountId32::new(key.0))
There is no chance that the babe owner key transformed into an AccountId is present in the Validator set, because babe owner keys are simple delegated keys while validator keys correspond to the account of the smith's identity.
Thus, we have to find a way for the inherent data provider to be informed on the key of the smith.