maidsafe / sn_dbc

Safe Network DBCs
BSD 3-Clause "New" or "Revised" License
15 stars 16 forks source link

add ReissueShare and DbcBuilder to simplify aggregating reissue results from mint nodes #83

Closed dan-da closed 3 years ago

dan-da commented 3 years ago

Changes:


Discussion for a possible followup PR:

One observation I made while implementing this is that we return PublicKeySet for every output DBC in every reissue(). Yet to combine signatures one must use a single PublicKeySet. This means the client should/must verify that all returned PublicKeySet are the same which is a bit convoluted with this structure. It would be a bit simpler to just return a single PublicKeySet from Mint::reissue() in the ReissueShare and omit it from MintNodeSignatures, which then becomes BTreeMap<DbcContentHash, NodeSignature> instead of BTreeMap<DbcContentHash, (PublicKeySet, NodeSignature)>.

Is there ever a situation where we would actually want distinct PublicKeySet per output Dbc per MintNode? If so, DbcBuilder::build() would fail miserably when it encounters that...