-
Notifications
You must be signed in to change notification settings - Fork 366
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
[INDY-1385] Fix last_prepared_sertificate computing #786
[INDY-1385] Fix last_prepared_sertificate computing #786
Conversation
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
sdk_wallet_steward): | ||
A, B, C, D = txnPoolNodeSet | ||
for n in [A, B, C]: | ||
# Do not send prepares and prepares for Delta node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prepares and pre-prepares
# Do not send prepares and prepares for Delta node | ||
D.nodeIbStasher.delay(pDelay(1000, 0, sender_filter=n.name)) | ||
D.nodeIbStasher.delay(ppDelay(1000, 0, sender_filter=n.name)) | ||
sdk_send_random_and_check(looper, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need to send 5 requests and override tconf.Max3PCBatchSize?
for n in [A, B, C]: | ||
# Do not send prepares to Delta node | ||
D.nodeIbStasher.delay(pDelay(1000, 0, sender_filter=n.name)) | ||
sdk_send_random_and_check(looper, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need to send 5 requests and override tconf.Max3PCBatchSize?
assert D.master_replica.prepares | ||
# There is no quorum for all prepares | ||
for key in D.master_replica.prepares.keys(): | ||
assert D.master_replica.prepares.hasQuorum(ThreePhaseKey(*key), quorum) == False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert not ?
yield tconf | ||
tconf.Max3PCBatchSize = old_m | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it the same tests as above?
for key in self.prepares.keys(): | ||
if self.prepares.hasQuorum(ThreePhaseKey(*key), quorum): | ||
keys.append(key) | ||
return max_3PC_key(keys) if keys else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test that we get the maximum value as last prepared
@@ -0,0 +1,31 @@ | |||
import pytest | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be sufficient to have just unit tests here:
See test/replica/test_api.py
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
@@ -4,6 +4,8 @@ | |||
from plenum.test.helper import sdk_send_random_and_check | |||
|
|||
|
|||
txnCount = 5 | |||
|
|||
@pytest.fixture(scope="module") | |||
def tconf(tconf): | |||
old_m = tconf.Max3PCBatchSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this test unit as well?
@@ -5,6 +5,8 @@ | |||
from plenum.test.helper import sdk_send_random_and_check | |||
|
|||
|
|||
txnCount = 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this test unit as well?
plenum/test/replica/test_api.py
Outdated
txnRootHash='Hhyw96wihpeG9whMNuyPhUcTV76HiHcYJrepDsjuarYJ', | ||
viewNo=0)) | ||
replica.prepares[(0, 2)] = ThreePhaseVotes(voters=('Delta:0',), | ||
msg=Prepare(digest='12a05a12df55d4595807ec6edaf3bc36766feb4ab5479a5b45434a4288c9871b', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a helper method to create a Prepare
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
test this please |
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
For now, last prepared serticate is max 3PC key of quorumed prepares.