From 02d03221851e3af46f814b7464f7d117d2b1bc77 Mon Sep 17 00:00:00 2001 From: Elad Gavra Date: Tue, 6 Nov 2018 16:18:17 +0200 Subject: [PATCH 1/3] Added hare protocol messages representation in protobuf --- hare/pb/hare.proto | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 hare/pb/hare.proto diff --git a/hare/pb/hare.proto b/hare/pb/hare.proto new file mode 100644 index 0000000000..46a2ae412a --- /dev/null +++ b/hare/pb/hare.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; + +package pb; +option go_package = "pb"; + +// top message of the protocol +message HareMessage { + bytes pubKey = 1; + + bytes inner_sig = 2; // sign type, layer and payload + uint32 type = 3; // message type (status/commit/proposal/notify) + bytes layer = 4; + BasicMessage message = 5; + + bytes outer_sig = 6; // optional. sign also certificate + Certificate cert = 7; // optional +} + +// the certificate +message Certificate { + repeated bytes blockId = 1; // the committed set S + repeated HareMessage commits = 2; // a collection of commit messages + bytes aggSig = 3; // aggregated sign for commits +} + +// safe value proof message +message SVP { + repeated HareMessage statuses = 1; // a collection of status messages + bytes aggSig = 2; // aggregated sig for statuses + Certificate cert = 3; +} + +// basic message +message BasicMessage { + uint32 k = 1; + repeated uint32 blockId = 2; // the set S. optional for commit message in a certificate + bytes role_proof = 3; // role is implicit by message type, this is the proof + SVP svp_proof = 4; // optional. only for proposal messages +} From 57a4050b94df81b148444c06d50eb45e3b549c3a Mon Sep 17 00:00:00 2001 From: Elad Gavra Date: Mon, 12 Nov 2018 14:01:38 +0200 Subject: [PATCH 2/3] Fixed CR comments. --- hare/pb/hare.proto | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/hare/pb/hare.proto b/hare/pb/hare.proto index 46a2ae412a..a358203074 100644 --- a/hare/pb/hare.proto +++ b/hare/pb/hare.proto @@ -6,21 +6,17 @@ option go_package = "pb"; // top message of the protocol message HareMessage { bytes pubKey = 1; - - bytes inner_sig = 2; // sign type, layer and payload - uint32 type = 3; // message type (status/commit/proposal/notify) - bytes layer = 4; - BasicMessage message = 5; - - bytes outer_sig = 6; // optional. sign also certificate + bytes innerSig = 2; // sign inner message + InnerMessage message = 5; + bytes outerSig = 6; // optional. sign also certificate Certificate cert = 7; // optional } // the certificate message Certificate { - repeated bytes blockId = 1; // the committed set S + repeated bytes blocks = 1; // the committed set S repeated HareMessage commits = 2; // a collection of commit messages - bytes aggSig = 3; // aggregated sign for commits + bytes aggSig = 3; // aggregated sig for commits } // safe value proof message @@ -31,9 +27,18 @@ message SVP { } // basic message -message BasicMessage { - uint32 k = 1; - repeated uint32 blockId = 2; // the set S. optional for commit message in a certificate - bytes role_proof = 3; // role is implicit by message type, this is the proof - SVP svp_proof = 4; // optional. only for proposal messages +message InnerMessage { + enum Type { // message type + STATUS = 0; + PROPOSAL = 1; + COMMIT = 2; + NOTIFY = 3; + } + Type type = 1; + bytes layer = 2; + uint32 k = 3; // the iteration + uint32 ki = 4; + repeated bytes blocks = 5; // the set S. optional for commit message in a certificate + bytes roleProof = 6; // role is implicit by message type, this is the proof + SVP svpProof = 7; // optional. only for proposal messages } From 00c02fa24b2630225166a2db5afa63dfd3325577 Mon Sep 17 00:00:00 2001 From: Elad Gavra Date: Mon, 12 Nov 2018 17:08:51 +0200 Subject: [PATCH 3/3] Fixed numbers --- hare/pb/hare.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hare/pb/hare.proto b/hare/pb/hare.proto index a358203074..357939b903 100644 --- a/hare/pb/hare.proto +++ b/hare/pb/hare.proto @@ -7,9 +7,9 @@ option go_package = "pb"; message HareMessage { bytes pubKey = 1; bytes innerSig = 2; // sign inner message - InnerMessage message = 5; - bytes outerSig = 6; // optional. sign also certificate - Certificate cert = 7; // optional + InnerMessage message = 3; + bytes outerSig = 4; // optional. sign also certificate + Certificate cert = 5; // optional } // the certificate