protocol-substrate icon indicating copy to clipboard operation
protocol-substrate copied to clipboard

[TASK] Implement change handler hook for Signature Bridge maintainer

Open drewstone opened this issue 3 years ago • 0 comments

Issue summary The signature bridge is maintained by a maintainer, currently a uncompressed ECDSA public key. This key can potentially change from external pallets or logic such as through the DKG's operations. Currently the DKG exists as a separate repo and should continue to be. Nonetheless, we should have a way of connecting the SignatureBridge to an external maintainer change handler.

Other information and links What this might look like:

trait MaintainerUpdater {
	fn update(new_maintainer: Vec<u8>) -> DispatchResult;
}

// in `signature-bridge/src/lib.rs`
impl<T, I> MaintainerUpdater for Pallet<T, I> {
	fn update(new_maintainer: Vec<u8> -> DispatchResult {
		// do validation
		check_valid_maintainer(new_maintainer)?;
		// do update
		Maintainer::<T, I>::set(new_maintainer);
	}
}

On the DKG's side we would then implement the opposite side of this logic.

// in `dkg-metadata/src/lib.rs`
trait Config {
	...
	MaintainerChangeHandler: MaintainerUpdater
}
...
fn change_authorities(...) {
	...
	T::MaintainerChangeHandler::update(new_key)?;
	...
}

Relevant links:

drewstone avatar May 29 '22 02:05 drewstone