diff --git a/src/avalanche/proof.h b/src/avalanche/proof.h --- a/src/avalanche/proof.h +++ b/src/avalanche/proof.h @@ -41,7 +41,7 @@ namespace avalanche { /** Minimum amount per utxo */ -static constexpr Amount PROOF_DUST_THRESHOLD = 1 * COIN; +static constexpr Amount PROOF_DUST_THRESHOLD = 100 * COIN; class ProofValidationState; diff --git a/src/avalanche/test/peermanager_tests.cpp b/src/avalanche/test/peermanager_tests.cpp --- a/src/avalanche/test/peermanager_tests.cpp +++ b/src/avalanche/test/peermanager_tests.cpp @@ -346,7 +346,7 @@ BOOST_CHECK(pm.addNode(InsecureRand32(), p->getId())); } - BOOST_CHECK_EQUAL(pm.getSlotCount(), 400); + BOOST_CHECK_EQUAL(pm.getSlotCount(), 40000); BOOST_CHECK_EQUAL(pm.getFragmentation(), 0); for (int i = 0; i < 100; i++) { @@ -357,13 +357,13 @@ // Remove one peer, it nevers show up now. BOOST_CHECK(pm.removePeer(peerids[2])); - BOOST_CHECK_EQUAL(pm.getSlotCount(), 400); - BOOST_CHECK_EQUAL(pm.getFragmentation(), 100); + BOOST_CHECK_EQUAL(pm.getSlotCount(), 40000); + BOOST_CHECK_EQUAL(pm.getFragmentation(), 10000); // Make sure we compact to never get NO_PEER. - BOOST_CHECK_EQUAL(pm.compact(), 100); + BOOST_CHECK_EQUAL(pm.compact(), 10000); BOOST_CHECK(pm.verify()); - BOOST_CHECK_EQUAL(pm.getSlotCount(), 300); + BOOST_CHECK_EQUAL(pm.getSlotCount(), 30000); BOOST_CHECK_EQUAL(pm.getFragmentation(), 0); for (int i = 0; i < 100; i++) { @@ -378,22 +378,22 @@ BOOST_CHECK(pm.addNode(InsecureRand32(), p->getId())); } - BOOST_CHECK_EQUAL(pm.getSlotCount(), 700); + BOOST_CHECK_EQUAL(pm.getSlotCount(), 70000); BOOST_CHECK_EQUAL(pm.getFragmentation(), 0); BOOST_CHECK(pm.removePeer(peerids[0])); - BOOST_CHECK_EQUAL(pm.getSlotCount(), 700); - BOOST_CHECK_EQUAL(pm.getFragmentation(), 100); + BOOST_CHECK_EQUAL(pm.getSlotCount(), 70000); + BOOST_CHECK_EQUAL(pm.getFragmentation(), 10000); // Removing the last entry do not increase fragmentation. BOOST_CHECK(pm.removePeer(peerids[7])); - BOOST_CHECK_EQUAL(pm.getSlotCount(), 600); - BOOST_CHECK_EQUAL(pm.getFragmentation(), 100); + BOOST_CHECK_EQUAL(pm.getSlotCount(), 60000); + BOOST_CHECK_EQUAL(pm.getFragmentation(), 10000); // Make sure we compact to never get NO_PEER. - BOOST_CHECK_EQUAL(pm.compact(), 100); + BOOST_CHECK_EQUAL(pm.compact(), 10000); BOOST_CHECK(pm.verify()); - BOOST_CHECK_EQUAL(pm.getSlotCount(), 500); + BOOST_CHECK_EQUAL(pm.getSlotCount(), 50000); BOOST_CHECK_EQUAL(pm.getFragmentation(), 0); for (int i = 0; i < 100; i++) { @@ -427,14 +427,14 @@ pm.removePeer(p); } - BOOST_CHECK_EQUAL(pm.getSlotCount(), 300); - BOOST_CHECK_EQUAL(pm.getFragmentation(), 300); + BOOST_CHECK_EQUAL(pm.getSlotCount(), 30000); + BOOST_CHECK_EQUAL(pm.getFragmentation(), 30000); for (int i = 0; i < 100; i++) { BOOST_CHECK_EQUAL(pm.selectPeer(), NO_PEER); } - BOOST_CHECK_EQUAL(pm.compact(), 300); + BOOST_CHECK_EQUAL(pm.compact(), 30000); BOOST_CHECK(pm.verify()); BOOST_CHECK_EQUAL(pm.getSlotCount(), 0); BOOST_CHECK_EQUAL(pm.getFragmentation(), 0); diff --git a/src/avalanche/test/processor_tests.cpp b/src/avalanche/test/processor_tests.cpp --- a/src/avalanche/test/processor_tests.cpp +++ b/src/avalanche/test/processor_tests.cpp @@ -1286,7 +1286,7 @@ BOOST_AUTO_TEST_CASE(quorum_detection) { // Set min quorum parameters for our test - int minStake = 4'000'000; + int minStake = 400'000'000; gArgs.ForceSetArg("-avaminquorumstake", ToString(minStake)); gArgs.ForceSetArg("-avaminquorumconnectedstakeratio", "0.5"); diff --git a/test/functional/abc_feature_proof_cleanup.py b/test/functional/abc_feature_proof_cleanup.py --- a/test/functional/abc_feature_proof_cleanup.py +++ b/test/functional/abc_feature_proof_cleanup.py @@ -30,6 +30,7 @@ self.num_nodes = 1 self.extra_args = [[ '-enableavalanche=1', + '-avaproofstakeutxodustthreshold=1000000', '-avaproofstakeutxoconfirmations=1', '-enableavalanchepeerdiscovery=1', # Get rid of the getdata delay penalty for inbounds diff --git a/test/functional/abc_p2p_avalanche_peer_discovery.py b/test/functional/abc_p2p_avalanche_peer_discovery.py --- a/test/functional/abc_p2p_avalanche_peer_discovery.py +++ b/test/functional/abc_p2p_avalanche_peer_discovery.py @@ -52,6 +52,7 @@ self.setup_clean_chain = True self.num_nodes = 1 self.extra_args = [['-enableavalanche=1', + '-avaproofstakeutxodustthreshold=1000000', '-avaproofstakeutxoconfirmations=3', '-enableavalanchepeerdiscovery=1']] self.supports_cli = False diff --git a/test/functional/abc_p2p_avalanche_proof_voting.py b/test/functional/abc_p2p_avalanche_proof_voting.py --- a/test/functional/abc_p2p_avalanche_proof_voting.py +++ b/test/functional/abc_p2p_avalanche_proof_voting.py @@ -33,6 +33,7 @@ self.peer_replacement_cooldown = 2000 self.extra_args = [ ['-enableavalanche=1', + '-avaproofstakeutxodustthreshold=1000000', '-enableavalancheproofreplacement=1', '-avaproofstakeutxoconfirmations=2', f'-avalancheconflictingproofcooldown={self.conflicting_proof_cooldown}', f'-avalanchepeerreplacementcooldown={self.peer_replacement_cooldown}', '-avacooldown=0', '-avastalevotethreshold=140', '-avastalevotefactor=1'], @@ -306,6 +307,7 @@ def vote_tests(self, node): self.restart_node(0, extra_args=['-enableavalanche=1', + '-avaproofstakeutxodustthreshold=1000000', '-avaproofstakeutxoconfirmations=2', '-avacooldown=0', '-avalancheconflictingproofcooldown=0', @@ -477,6 +479,7 @@ # Restart the node with appropriate flags for this test self.restart_node(0, extra_args=[ '-enableavalanche=1', + '-avaproofstakeutxodustthreshold=1000000', '-enableavalancheproofreplacement=1', '-avaproofstakeutxoconfirmations=2', '-avalancheconflictingproofcooldown=0', diff --git a/test/functional/abc_p2p_avalanche_quorum.py b/test/functional/abc_p2p_avalanche_quorum.py --- a/test/functional/abc_p2p_avalanche_quorum.py +++ b/test/functional/abc_p2p_avalanche_quorum.py @@ -31,6 +31,7 @@ self.min_avaproofs_node_count = 8 self.extra_args = [[ '-enableavalanche=1', + '-avaproofstakeutxodustthreshold=1000000', '-enableavalanchepeerdiscovery=1', '-avaproofstakeutxoconfirmations=1', '-avacooldown=0', diff --git a/test/functional/abc_p2p_avalanche_voting.py b/test/functional/abc_p2p_avalanche_voting.py --- a/test/functional/abc_p2p_avalanche_voting.py +++ b/test/functional/abc_p2p_avalanche_voting.py @@ -24,6 +24,7 @@ self.num_nodes = 2 self.extra_args = [ ['-enableavalanche=1', + '-avaproofstakeutxodustthreshold=1000000', '-avaproofstakeutxoconfirmations=1', '-avacooldown=0'], ['-enableavalanche=1', diff --git a/test/functional/abc_p2p_compactproofs.py b/test/functional/abc_p2p_compactproofs.py --- a/test/functional/abc_p2p_compactproofs.py +++ b/test/functional/abc_p2p_compactproofs.py @@ -54,6 +54,7 @@ self.num_nodes = 2 self.extra_args = [[ '-enableavalanche=1', + '-avaproofstakeutxodustthreshold=1000000', '-avaproofstakeutxoconfirmations=1', '-avacooldown=0', '-enableavalanchepeerdiscovery=1', diff --git a/test/functional/abc_p2p_getavaaddr.py b/test/functional/abc_p2p_getavaaddr.py --- a/test/functional/abc_p2p_getavaaddr.py +++ b/test/functional/abc_p2p_getavaaddr.py @@ -85,6 +85,7 @@ self.setup_clean_chain = False self.num_nodes = 1 self.extra_args = [['-enableavalanche=1', + '-avaproofstakeutxodustthreshold=1000000', '-enableavalanchepeerdiscovery=1', '-enableavalancheproofreplacement=1', '-avaproofstakeutxoconfirmations=1', diff --git a/test/functional/abc_p2p_proof_inventory.py b/test/functional/abc_p2p_proof_inventory.py --- a/test/functional/abc_p2p_proof_inventory.py +++ b/test/functional/abc_p2p_proof_inventory.py @@ -54,6 +54,7 @@ self.num_nodes = 5 self.extra_args = [[ '-enableavalanche=1', + '-avaproofstakeutxodustthreshold=1000000', '-avaproofstakeutxoconfirmations=2', '-avacooldown=0', '-whitelist=noban@127.0.0.1', @@ -147,7 +148,8 @@ }] ) - self.restart_node(0, ['-enableavalanche=1']) + self.restart_node( + 0, ['-enableavalanche=1', '-avaproofstakeutxodustthreshold=1000000']) peer = node.add_p2p_connection(P2PInterface()) msg = msg_avaproof() diff --git a/test/functional/abc_rpc_addavalanchenode.py b/test/functional/abc_rpc_addavalanchenode.py --- a/test/functional/abc_rpc_addavalanchenode.py +++ b/test/functional/abc_rpc_addavalanchenode.py @@ -35,7 +35,8 @@ def set_test_params(self): self.num_nodes = 1 self.extra_args = [['-enableavalanche=1', - "-avaproofstakeutxoconfirmations=1", + '-avaproofstakeutxodustthreshold=1000000', + '-avaproofstakeutxoconfirmations=1', '-avacooldown=0']] def run_test(self): diff --git a/test/functional/abc_rpc_avalancheproof.py b/test/functional/abc_rpc_avalancheproof.py --- a/test/functional/abc_rpc_avalancheproof.py +++ b/test/functional/abc_rpc_avalancheproof.py @@ -57,8 +57,12 @@ def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 2 - self.extra_args = [ - ['-enableavalanche=1', '-avaproofstakeutxoconfirmations=1', '-avacooldown=0', '-legacyavaproof=1']] * self.num_nodes + self.extra_args = [['-enableavalanche=1', + '-avaproofstakeutxodustthreshold={}'.format( + PROOF_DUST_THRESHOLD), + '-avaproofstakeutxoconfirmations=1', + '-avacooldown=0', + '-legacyavaproof=1']] * self.num_nodes self.supports_cli = False self.rpc_timeout = 120 diff --git a/test/functional/abc_rpc_getavalancheinfo.py b/test/functional/abc_rpc_getavalancheinfo.py --- a/test/functional/abc_rpc_getavalancheinfo.py +++ b/test/functional/abc_rpc_getavalancheinfo.py @@ -39,6 +39,7 @@ '-enableavalanchepeerdiscovery=1', '-avaminquorumstake=250000000', '-avaminquorumconnectedstakeratio=0.9', + '-avaproofstakeutxodustthreshold=1000000', ]] def run_test(self): diff --git a/test/functional/abc_rpc_getavalanchepeerinfo.py b/test/functional/abc_rpc_getavalanchepeerinfo.py --- a/test/functional/abc_rpc_getavalanchepeerinfo.py +++ b/test/functional/abc_rpc_getavalanchepeerinfo.py @@ -21,6 +21,7 @@ self.setup_clean_chain = True self.num_nodes = 1 self.extra_args = [['-enableavalanche=1', + '-avaproofstakeutxodustthreshold=1000000', '-avaproofstakeutxoconfirmations=1', '-avacooldown=0']] diff --git a/test/functional/p2p_eviction.py b/test/functional/p2p_eviction.py --- a/test/functional/p2p_eviction.py +++ b/test/functional/p2p_eviction.py @@ -66,6 +66,7 @@ # avalanche availability score self.extra_args = [["-maxconnections=188", "-enableavalanche=1", + "-avaproofstakeutxodustthreshold=1000000", "-avaproofstakeutxoconfirmations=1", "-maxavalancheoutbound=16"]] diff --git a/test/functional/p2p_inv_download.py b/test/functional/p2p_inv_download.py --- a/test/functional/p2p_inv_download.py +++ b/test/functional/p2p_inv_download.py @@ -126,6 +126,7 @@ def set_test_params(self): self.num_nodes = 2 self.extra_args = [['-enableavalanche=1', + '-avaproofstakeutxodustthreshold=1000000', '-avaproofstakeutxoconfirmations=1', '-avacooldown=0']] * self.num_nodes diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py --- a/test/functional/rpc_net.py +++ b/test/functional/rpc_net.py @@ -45,8 +45,14 @@ def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 2 - self.extra_args = [["-enableavalanche=1", "-avaproofstakeutxoconfirmations=1", "-minrelaytxfee=10"], - ["-enableavalanche=1", "-avaproofstakeutxoconfirmations=1", "-minrelaytxfee=5"]] + self.extra_args = [["-enableavalanche=1", + "-avaproofstakeutxodustthreshold=1000000", + "-avaproofstakeutxoconfirmations=1", + "-minrelaytxfee=10"], + ["-enableavalanche=1", + "-avaproofstakeutxodustthreshold=1000000", + "-avaproofstakeutxoconfirmations=1", + "-minrelaytxfee=5"]] self.supports_cli = False def run_test(self):