From 4a438bc64d780f86f1e0aff440c73d51ef8edc45 Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Thu, 28 Dec 2023 10:02:36 +0800 Subject: [PATCH] Add line break in council signed message --- crates/phactory/src/prpc_service.rs | 2 +- docs/pruntime-handover-by-council.md | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/phactory/src/prpc_service.rs b/crates/phactory/src/prpc_service.rs index 043a8d0ba..7148a9c13 100644 --- a/crates/phactory/src/prpc_service.rs +++ b/crates/phactory/src/prpc_service.rs @@ -2045,7 +2045,7 @@ impl PhactoryApi for Rpc let genesis_hash = hex::encode(runtime_state.genesis_block_hash); let mr_to = hex::encode(&request.measurement); let mr_from = hex::encode(my_measurement()?); - let signed_message = format!("Allow pRuntime to handover from 0x{mr_from} to 0x{mr_to} on chain of genesis 0x{genesis_hash}").into_bytes(); + let signed_message = format!("Allow pRuntime to handover\n from: 0x{mr_from}\n to: 0x{mr_to}\n genesis: 0x{genesis_hash}").into_bytes(); debug!("Signed message: {:?}", hex::encode(&signed_message)); let mut signers = std::collections::BTreeSet::new(); for sig in &request.signatures { diff --git a/docs/pruntime-handover-by-council.md b/docs/pruntime-handover-by-council.md index d026be416..4d56f83c4 100644 --- a/docs/pruntime-handover-by-council.md +++ b/docs/pruntime-handover-by-council.md @@ -10,7 +10,10 @@ Then the steps would be: 1. Ask at least half of the council members to sign a message as below: ``` -Allow pRuntime to handover from 0x10c24c0e6bf8a86634417fcd8f934e62439c62907a6f1bc726906a50b054ddf10000000083d719e77deaca1470f6baf62a4d774303c899db69020f9c70ee1dfc08c7ce9e to 0xf42f7e095735702d1d3c6ac5fa3b4581d3c3673d3c5ce261a43fe782ccb3e1dc0000000083d719e77deaca1470f6baf62a4d774303c899db69020f9c70ee1dfc08c7ce9e on chain of genesis 0x0a15d23307d533d581291ff6dedca9ca10927c7dff6f4df9e8c3bf00bc5a6ded +Allow pRuntime to handover + from: 0x10c24c0e6bf8a86634417fcd8f934e62439c62907a6f1bc726906a50b054ddf10000000083d719e77deaca1470f6baf62a4d774303c899db69020f9c70ee1dfc08c7ce9e + to: 0xf42f7e095735702d1d3c6ac5fa3b4581d3c3673d3c5ce261a43fe782ccb3e1dc0000000083d719e77deaca1470f6baf62a4d774303c899db69020f9c70ee1dfc08c7ce9e + genesis: 0x0a15d23307d533d581291ff6dedca9ca10927c7dff6f4df9e8c3bf00bc5a6ded ``` See https://files.kvin.wang:8443/signit/ for an example