Skip to content
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-1058] Get rid of Registry-based pools #568

Merged
merged 41 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7a90146
Initial test integration
ArtObr Mar 7, 2018
d0f70b9
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Mar 12, 2018
9394543
Two more files done
ArtObr Mar 12, 2018
e11af80
new test
ArtObr Mar 12, 2018
873bbb1
4 more folders done
ArtObr Mar 12, 2018
cff29c6
two more files
ArtObr Mar 12, 2018
b070c36
some changes
ArtObr Mar 12, 2018
693c9bb
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Mar 13, 2018
a0f7558
More tests integrated. Problems: validator functions of client in tes…
ArtObr Mar 13, 2018
b924ff5
Initial commit
ArtObr Mar 13, 2018
72dc0ad
Script fix. bls validation fix
ArtObr Mar 13, 2018
6cca8c5
more changes
ArtObr Mar 14, 2018
3aafa9c
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Mar 14, 2018
b2f6e48
little fix
ArtObr Mar 14, 2018
1d96def
Fix for bls validation tests. Not done: update_incorrect test and sta…
ArtObr Mar 14, 2018
2761e98
Only state_proof test left
ArtObr Mar 15, 2018
8cc56c6
Tests integration done
ArtObr Mar 16, 2018
509a919
Deletion of Client1Connected. More test fix
ArtObr Mar 16, 2018
8fc9d92
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Mar 16, 2018
c4dc583
Import deletion. flake8 error fix.
ArtObr Mar 16, 2018
b56f65e
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Mar 16, 2018
012a91b
Merge branch 'indy-sdk-integration/INDY-992' into indy-sdk-integratio…
ArtObr Mar 16, 2018
8cfe95c
More changes to txnPoolNodeSet
ArtObr Mar 16, 2018
c5285da
Changes in tests
ArtObr Mar 19, 2018
5ec36c5
Remove pf TestNodeSet. Change of helper methods. Part 1.
ArtObr Mar 19, 2018
a9f7104
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Mar 19, 2018
c3059f0
Merge remote-tracking branch 'base/master' into indy-sdk-integration/…
ArtObr Mar 20, 2018
e6cbc10
Remove TestNodeSet from helper. part 2
ArtObr Mar 20, 2018
5708f72
More tests integrated
ArtObr Mar 20, 2018
5d76f77
Functions fixes.
ArtObr Mar 20, 2018
9c6a157
Fix for genesis txns
ArtObr Mar 20, 2018
8b7ee34
More tests integrated
ArtObr Mar 20, 2018
1b2cca1
primary_selection dependency fix
ArtObr Mar 20, 2018
cc15275
Fixture fix for view_change
ArtObr Mar 20, 2018
e23b284
View change test fix
ArtObr Mar 20, 2018
8b233bd
Skips for merkle proof tests
ArtObr Mar 21, 2018
db40c43
Skips for merkle proof tests
ArtObr Mar 21, 2018
2c2e9db
Merge branch 'indy-sdk-integration/INDY-1058' of github.com:ArtObr/in…
ArtObr Mar 21, 2018
f508ca4
Review changes
ArtObr Mar 21, 2018
d1946db
Review changes
ArtObr Mar 21, 2018
87461f9
Merge branch 'indy-sdk-integration/INDY-1058' of github.com:ArtObr/in…
ArtObr Mar 21, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from plenum.test.test_node import getNonPrimaryReplicas
from plenum.test.helper import sdk_send_random_requests


def test_sdk_no_ordering_during_syncup(tconf, looper, txnPoolNodeSet, sdk_pool_handle, sdk_wallet_client):
non_primary_replica = getNonPrimaryReplicas(txnPoolNodeSet, instId=0)[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from plenum.test.delayers import cDelay
from plenum.test.test_node import getNonPrimaryReplicas
from plenum.test.batching_3pc.helper import checkNodesHaveSameRoots
from plenum.test.helper import sdk_signed_random_requests, sdk_send_and_check,\
from plenum.test.helper import sdk_signed_random_requests, sdk_send_and_check, \
sdk_send_random_requests, sdk_get_replies


Expand Down Expand Up @@ -46,7 +46,6 @@ def test_unordered_state_reverted_before_catchup(
reqs = sdk_send_random_requests(looper, sdk_pool_handle, sdk_wallet_client, tconf.Max3PCBatchSize)
sdk_get_replies(looper, reqs, timeout=40)


committed_ledger_during_3pc = non_primary_node.getLedger(
ledger_id).tree.root_hash
uncommitted_ledger_during_3pc = non_primary_node.getLedger(
Expand Down
8 changes: 0 additions & 8 deletions plenum/test/batching_3pc/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import pytest

from plenum.test.conftest import getValueFromModule
from plenum.test.pool_transactions.conftest import looper, clientAndWallet1, \
client1, wallet1, client1Connected


@pytest.fixture(scope="module")
Expand All @@ -15,9 +13,3 @@ def reset():

request.addfinalizer(reset)
return tconf


@pytest.fixture(scope="module")
def client(tconf, looper, txnPoolNodeSet, client1,
client1Connected):
return client1Connected
2 changes: 1 addition & 1 deletion plenum/test/batching_3pc/test_basic_batching.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def testRequestStaticValidation(tconf, looper, txnPoolNodeSet,
node.doStaticValidation(req)


def test3PCOverBatchWithThresholdReqs(tconf, looper, txnPoolNodeSet, client,
def test3PCOverBatchWithThresholdReqs(tconf, looper, txnPoolNodeSet,
sdk_wallet_client, sdk_pool_handle):
"""
Check that 3 phase commit happens when threshold number of requests are
Expand Down
2 changes: 1 addition & 1 deletion plenum/test/batching_3pc/test_batching_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def testPrePrepareProcessedInOrder(perf_chk_patched, looper, txnPoolNodeSet,
"""
tconf = perf_chk_patched
pr, otherR = getPrimaryReplica(txnPoolNodeSet, instId=0), \
getNonPrimaryReplicas(txnPoolNodeSet, instId=0)
getNonPrimaryReplicas(txnPoolNodeSet, instId=0)
otherNodes = [r.node for r in otherR]
ppsToDelay = 2
delayeds = 0
Expand Down
6 changes: 3 additions & 3 deletions plenum/test/blacklist/test_blacklist_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ def setup(client1):


# noinspection PyIncorrectDocstring,PyUnusedLocal,PyShadowingNames
def testDoNotBlacklistClient(setup, looper, nodeSet, up, client1, sent1):
def testDoNotBlacklistClient(setup, looper, txnPoolNodeSet, client1, sent1):
"""
Client should be not be blacklisted by node on sending an unsigned request
"""

# No node should blacklist the client
def chk():
for node in nodeSet:
for node in txnPoolNodeSet:
assert not node.isClientBlacklisted(client1.name)

timeout = waits.expectedClientToPoolConnectionTimeout(len(nodeSet))
timeout = waits.expectedClientToPoolConnectionTimeout(len(txnPoolNodeSet))
looper.run(eventually(chk, retryWait=1, timeout=timeout))
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@

# noinspection PyIncorrectDocstring,PyUnusedLocal,PyShadowingNames
@pytest.mark.skip(reason="SOV-540. Implementation changed.")
def testBlacklistNodeOnMultipleNominations(looper, keySharedNodes, ready):
def testBlacklistNodeOnMultipleNominations(looper, txnPoolNodeSet, ready):
"""
A node that sends multiple nominations must be blacklisted by other nodes
"""
nodeSet = keySharedNodes
A, B, C, D = nodeSet.nodes.values()
A, B, C, D = txnPoolNodeSet

# B sends more than 2 nominations
for i in range(3):
Expand All @@ -26,5 +25,5 @@ def chk():
for node in A, C, D:
assert node.isNodeBlacklisted(B.name)

timeout = waits.expectedPoolNominationTimeout(len(nodeSet.nodes))
timeout = waits.expectedPoolNominationTimeout(len(txnPoolNodeSet))
looper.run(eventually(chk, retryWait=1, timeout=timeout))
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
# noinspection PyIncorrectDocstring
@pytest.mark.skip(reason="SOV-541. Implementation changed.")
def testBlacklistNodeOnMultiplePrimaryDeclarations(looper,
keySharedNodes,
ready):
txnPoolNodeSet):
"""
A node that sends multiple primary declarations must be blacklisted by
other nodes
"""
nodeSet = keySharedNodes
A, B, C, D = nodeSet.nodes.values()
A, B, C, D = txnPoolNodeSet

# B sends more than 2 primary declarations
for i in range(3):
Expand All @@ -30,5 +28,5 @@ def chk():
for node in A, C, D:
assert node.isNodeBlacklisted(B.name)

timeout = waits.expectedPoolNominationTimeout(len(nodeSet.nodes))
timeout = waits.expectedPoolNominationTimeout(len(txnPoolNodeSet))
looper.run(eventually(chk, retryWait=1, timeout=timeout))
1 change: 0 additions & 1 deletion plenum/test/bls/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from plenum.common.constants import DOMAIN_LEDGER_ID
from plenum.common.util import get_utc_epoch
from plenum.test.bls.helper import generate_state_root
from plenum.test.pool_transactions.conftest import looper

participants = ["Node1", "Node2", "Node3"]
signature = "somefakesignaturesomefakesignaturesomefakesignature"
Expand Down
39 changes: 39 additions & 0 deletions plenum/test/bls/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,45 @@ def sdk_check_bls_multi_sig_after_send(looper, txnPoolNodeSet,
assert multi_sigs.count(multi_sigs[0]) == len(multi_sigs)


def sdk_check_bls_multi_sig_after_send(looper, txnPoolNodeSet,
sdk_pool_handle, sdk_wallet_handle,
saved_multi_sigs_count):
# at least two because first request could have no
# signature since state can be clear
number_of_requests = 3

# 1. send requests
# Using loop to avoid 3pc batching
state_roots = []
for i in range(number_of_requests):
sdk_send_random_and_check(looper, txnPoolNodeSet, sdk_pool_handle,
sdk_wallet_handle, 1)
waitNodeDataEquality(looper, txnPoolNodeSet[0], *txnPoolNodeSet[:-1])
state_roots.append(
state_roots_serializer.serialize(
bytes(txnPoolNodeSet[0].getState(DOMAIN_LEDGER_ID).committedHeadHash)))

# 2. get all saved multi-sigs
multi_sigs_for_batch = []
for state_root in state_roots:
multi_sigs = []
for node in txnPoolNodeSet:
multi_sig = node.bls_bft.bls_store.get(state_root)
if multi_sig:
multi_sigs.append(multi_sig)
multi_sigs_for_batch.append(multi_sigs)

# 3. check how many multi-sigs are saved
for multi_sigs in multi_sigs_for_batch:
assert len(multi_sigs) == saved_multi_sigs_count, \
"{} != {}".format(len(multi_sigs), saved_multi_sigs_count)

# 3. check that bls multi-sig is the same for all nodes we get PrePrepare for (that is for all expect the last one)
for multi_sigs in multi_sigs_for_batch[:-1]:
if multi_sigs:
assert multi_sigs.count(multi_sigs[0]) == len(multi_sigs)


def process_commits_for_key(key, pre_prepare, bls_bfts):
for sender_bls_bft in bls_bfts:
commit = create_commit_bls_sig(
Expand Down
1 change: 0 additions & 1 deletion plenum/test/bls/test_make_proof.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from base58 import b58encode
from plenum.test.pool_transactions.conftest import looper
from plenum.test.helper import sdk_send_random_and_check
from plenum.common.types import f
from plenum.common.constants import ROOT_HASH
Expand Down
3 changes: 0 additions & 3 deletions plenum/test/checkpoints/conftest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import pytest

from plenum.test.conftest import getValueFromModule
from plenum.test.pool_transactions.conftest import clientAndWallet1, \
client1, wallet1, client1Connected, looper, nodeThetaAdded, \
stewardAndWallet1, steward1, stewardWallet
from plenum.test.batching_3pc.conftest import tconf


Expand Down
4 changes: 2 additions & 2 deletions plenum/test/checkpoints/helper.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from plenum.test.helper import assertEquality


def chkChkpoints(nodes, total: int, stableIndex: int=None):
def chkChkpoints(nodes, total: int, stableIndex: int = None):
for node in nodes:
for r in node.replicas:
assert len(r.checkpoints) == total, '{} checkpoints {}, whereas total {}'.\
assert len(r.checkpoints) == total, '{} checkpoints {}, whereas total {}'. \
format(r, len(r.checkpoints), total)
if stableIndex is not None:
assert r.checkpoints.values()[stableIndex].isStable, r.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

def test_upper_bound_of_checkpoint_after_catchup_is_divisible_by_chk_freq(
chkFreqPatched, looper, txnPoolNodeSet, steward1, stewardWallet,
client1, wallet1, client1Connected, tdir, client_tdir, tconf,
client1, wallet1, tdir, client_tdir, tconf,
allPluginsPath):

sendReqsToNodesAndVerifySuffReplies(looper, wallet1, client1, 4)

_, _, epsilon = addNewStewardAndNode(looper, steward1, stewardWallet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

def test_second_checkpoint_after_catchup_can_be_stabilized(
chkFreqPatched, looper, txnPoolNodeSet, steward1, stewardWallet,
client1, wallet1, client1Connected, tdir, client_tdir, tconf,
client1, wallet1, tdir, client_tdir, tconf,
allPluginsPath):

_, _, epsilon = addNewStewardAndNode(looper, steward1, stewardWallet,
'EpsilonSteward', 'Epsilon',
tdir, client_tdir, tconf,
Expand Down
1 change: 1 addition & 0 deletions plenum/test/checkpoints/test_message_outside_watermark.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
CHK_FREQ = 5
LOG_SIZE = 3 * CHK_FREQ


def test_non_primary_recvs_3phase_message_outside_watermarks(chkFreqPatched, looper, txnPoolNodeSet, sdk_pool_handle,
sdk_wallet_client, reqs_for_logsize):
"""
Expand Down
1 change: 0 additions & 1 deletion plenum/test/checkpoints/test_message_outside_watermark1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from plenum.test.view_change.conftest import perf_chk_patched
from plenum.test.helper import sdk_send_random_and_check


TestRunningTimeLimitSec = 300
PerfCheckFreq = 30

Expand Down
1 change: 0 additions & 1 deletion plenum/test/checkpoints/test_ordering_after_catchup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

def add_new_node(looper, pool_nodes, steward, steward_wallet,
tdir, client_tdir, tconf, all_plugins_path):

name = randomString(6)
node_name = "Node-" + name
new_steward_name = "Steward-" + name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from stp_core.loop.eventually import eventually
from plenum.test.helper import sdk_send_batches_of_random_and_check


CHK_FREQ = 5


Expand Down
3 changes: 3 additions & 0 deletions plenum/test/cli/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def createAllNodes(request, cli):
def stopNodes():
for node in cli.nodes.values():
node.stop()

request.addfinalizer(stopNodes)


Expand All @@ -85,8 +86,10 @@ def be(ctx):
Fixture that is a 'be' function that closes over the test context.
'be' allows to change the current cli in the context.
"""

def _(cli):
ctx['current_cli'] = cli

return _


Expand Down
Loading