Skip to content

ST-623 -- Init Commit multi-sig process #1325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion plenum/bls/bls_bft_replica_plenum.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def validate_pre_prepare(self, pre_prepare: PrePrepare, sender):
multi_sig = MultiSignature.from_list(*sig)
if not self._validate_multi_sig(multi_sig):
return BlsBftReplica.PPR_BLS_MULTISIG_WRONG
return

if f.BLS_MULTI_SIG.nm not in pre_prepare or \
pre_prepare.blsMultiSig is None:
Expand Down
2 changes: 2 additions & 0 deletions plenum/test/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,8 @@ def create_pre_prepare_params(state_root,
params.append(bls_multi_sig.as_list())
if bls_multi_sigs:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If bls_multi_sigs=[] (default), then this code will not be called.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this needs to be

create_pre_prepare_params(.....,   bls_multi_sigs=None)
......
if bls_multi_sigs is not None:
    params.append(bls_multi_sig.as_list())
elif bls_multi_sig:
    params.append([bls_multi_sig.as_list()])

params.append([sig.as_list() for sig in bls_multi_sigs])
elif bls_multi_sig:
params.append([bls_multi_sig.as_list()])
return params


Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from plenum.common.messages.node_messages import Commit
from collections import OrderedDict
from plenum.common.messages.fields import NonNegativeNumberField, \
LimitedLengthStringField, AnyMapField
LimitedLengthStringField, AnyMapField, MapField

EXPECTED_ORDERED_FIELDS = OrderedDict([
("instId", NonNegativeNumberField),
("viewNo", NonNegativeNumberField),
("ppSeqNo", NonNegativeNumberField),
("blsSig", LimitedLengthStringField),
("blsSigs", MapField),
('plugin_fields', AnyMapField)
])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
("poolStateRootHash", MerkleRootField),
("auditTxnRootHash", MerkleRootField),
("blsMultiSig", BlsMultiSignatureField),
("blsMultiSigs", IterableField),
("originalViewNo", NonNegativeNumberField),
('plugin_fields', AnyMapField)
])
Expand Down