From 0a3af707c547ea417a464bc5804e9c5b2ad93814 Mon Sep 17 00:00:00 2001 From: Oleksandr Iozhytsia Date: Mon, 28 Mar 2022 18:39:20 +0300 Subject: [PATCH 1/2] WithdrawalEpochValidator fix: allow to have MC2ScAggTx in the last block of the withdrawal epoch. --- qa/run_sc_tests.py | 4 + qa/sc_withdrawal_epoch_last_block.py | 133 ++++++++++++++++++ .../horizen/proof/AbstractSignature25519.java | 2 +- .../com/horizen/block/SidechainBlock.scala | 13 +- .../validation/WithdrawalEpochValidator.scala | 8 +- .../MainchainBlockReferenceFixture.scala | 10 +- .../WithdrawalEpochValidatorTest.scala | 58 +++++++- 7 files changed, 210 insertions(+), 18 deletions(-) create mode 100644 qa/sc_withdrawal_epoch_last_block.py diff --git a/qa/run_sc_tests.py b/qa/run_sc_tests.py index c344f74adc..d1b0f89ef1 100644 --- a/qa/run_sc_tests.py +++ b/qa/run_sc_tests.py @@ -13,6 +13,7 @@ from sc_multiple_certs import SCMultipleCerts from sc_nodes_initialize import SidechainNodesInitializationTest from sc_versions_and_mc_certs import SCVersionsAndMCCertificates +from sc_withdrawal_epoch_last_block import SCWithdrawalEpochLastBlock from test_framework.util import assert_equal from mc_sc_connected_nodes import MCSCConnectedNodes from mc_sc_forging1 import MCSCForging1 @@ -75,6 +76,9 @@ def run_tests(log_file): result = run_test(SCForwardTransfer()) assert_equal(0, result, "sc_forward_transfer test failed!") + result = run_test(SCWithdrawalEpochLastBlock()) + assert_equal(0, result, "sc_withdrawal_epoch_last_block test failed!") + result = run_test(SCCumCommTreeHash()) assert_equal(0, result, "sc_cum_comm_tree_hash test failed!") diff --git a/qa/sc_withdrawal_epoch_last_block.py b/qa/sc_withdrawal_epoch_last_block.py new file mode 100644 index 0000000000..6677735530 --- /dev/null +++ b/qa/sc_withdrawal_epoch_last_block.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python3 +import json + +from SidechainTestFramework.sc_boostrap_info import SCNodeConfiguration, SCCreationInfo, MCConnectionInfo, \ + SCNetworkConfiguration +from SidechainTestFramework.sc_test_framework import SidechainTestFramework +from test_framework.util import assert_equal, assert_true, start_nodes, \ + websocket_port_by_mc_node_index, forward_transfer_to_sidechain +from SidechainTestFramework.scutil import bootstrap_sidechain_nodes, \ + start_sc_nodes, is_mainchain_block_included_in_sc_block, \ + check_mainchain_block_reference_info, generate_next_block, generate_next_blocks + +""" +Check that in the SC block, that contains MC block ref leading to the withdrawal epoch end, we allow to have MC2SCAggTx, +but not SC2SC transactions. + +Configuration: + Start 1 MC node and 1 SC node (with default websocket configuration). + SC node connected to the first MC node. + +Test: + For the SC node: + - Mine MC blocks till one block before the withdrawal epoch end. + - Forge SC blocks to sync with MC. + - Create new forward transfer to sidechain. + - Mine MC block that will have a FT. + - Generate CoreTx on SC node. + - Try to generate SC block that will end with MC block ref with AggTx, but without Sc2Sc tx. + - Check that Sc2Sc tx is still in the mempool. +""" +class SCWithdrawalEpochLastBlock(SidechainTestFramework): + sc_nodes_bootstrap_info=None + withdrawal_epoch_length=5 + + def setup_nodes(self): + return start_nodes(1, self.options.tmpdir) + + def sc_setup_chain(self): + mc_node = self.nodes[0] + sc_node_configuration = SCNodeConfiguration( + MCConnectionInfo(address="ws://{0}:{1}".format(mc_node.hostname, websocket_port_by_mc_node_index(0))) + ) + network = SCNetworkConfiguration(SCCreationInfo(mc_node, 100, self.withdrawal_epoch_length), sc_node_configuration) + self.sc_nodes_bootstrap_info = bootstrap_sidechain_nodes(self.options, network) + + def sc_setup_nodes(self): + return start_sc_nodes(1, self.options.tmpdir) + + def run_test(self): + mc_node = self.nodes[0] + sc_node = self.sc_nodes[0] + withdrawal_epoch_blocks_left = self.withdrawal_epoch_length - 1 + + # Send some coins to SC node wallet. + mc_return_address = mc_node.getnewaddress() + (sc_info, mc_block_count) = forward_transfer_to_sidechain(self.sc_nodes_bootstrap_info.sidechain_id, + mc_node, + self.sc_nodes_bootstrap_info.genesis_account.publicKey, + self.sc_nodes_bootstrap_info.genesis_account_balance, + mc_return_address, + generate_block=True) + + generate_next_blocks(sc_node, "first node", 1) + withdrawal_epoch_blocks_left -= 1 + + # Check the MC block reference's inclusion + sc_best_block = sc_node.block_best()["result"] + mc_block = self.nodes[0].getblock(str(mc_block_count)) + + res = is_mainchain_block_included_in_sc_block(sc_best_block["block"], mc_block) + assert_true(res, "The mainchain block is not included in SC node.") + + sc_mc_best_block_ref_info = sc_node.mainchain_bestBlockReferenceInfo()["result"] + assert_true( + check_mainchain_block_reference_info(sc_mc_best_block_ref_info, mc_block), + "The mainchain block is not included inside SC block reference info.") + + # Generate more MC blocks to reach 1 block before the end of the withdrawal epoch + mc_node.generate(withdrawal_epoch_blocks_left - 1) + + # Generate SC block + generate_next_blocks(sc_node, "first node", 1) + + # Send 1 more FT in the withdrawal epoch last MC block. + (sc_info, mc_block_count) = forward_transfer_to_sidechain(self.sc_nodes_bootstrap_info.sidechain_id, + mc_node, + self.sc_nodes_bootstrap_info.genesis_account.publicKey, + self.sc_nodes_bootstrap_info.genesis_account_balance, + mc_return_address, + generate_block=True) + + # Create SC to SC tx on SC node + fee = 10 + sendCoins = { + "outputs": [ + { + "publicKey": self.sc_nodes_bootstrap_info.genesis_account.publicKey, + "value": self.sc_nodes_bootstrap_info.genesis_account_balance - fee + } + ], + "fee": fee, + } + sc_node.transaction_sendCoinsToAddress(json.dumps(sendCoins)) + + # Check mempool + assert_equal(1, len(sc_node.transaction_allTransactions()["result"]["transactions"]), + "FT spending Tx expected to be in the SC node mempool.") + + # Generate 1 more SC block and check that we have 1 MC block ref with AggTx and no SC2SCTx + generate_next_block(sc_node, "first node") + sc_best_block = sc_node.block_best()["result"] + + # Check that there are no SC2SC txs + assert_equal(0, len(sc_best_block["block"]["sidechainTransactions"]), "No sidechain transactions expected.") + + # Check the MC block reference's inclusion + mc_block = self.nodes[0].getblock(str(mc_block_count)) + + res = is_mainchain_block_included_in_sc_block(sc_best_block["block"], mc_block) + assert_true(res, "The mainchain block is not included in SC node.") + + sc_mc_best_block_ref_info = sc_node.mainchain_bestBlockReferenceInfo()["result"] + assert_true( + check_mainchain_block_reference_info(sc_mc_best_block_ref_info, mc_block), + "The mainchain block is not included inside SC block reference info.") + + # Check mempool if SC 2 SC tx is still present + assert_equal(1, len(sc_node.transaction_allTransactions()["result"]["transactions"]), + "FT spending Tx expected to be in the SC node mempool.") + + +if __name__ == "__main__": + SCWithdrawalEpochLastBlock().main() diff --git a/sdk/src/main/java/com/horizen/proof/AbstractSignature25519.java b/sdk/src/main/java/com/horizen/proof/AbstractSignature25519.java index e5bdbf37f8..4b7fad58f8 100644 --- a/sdk/src/main/java/com/horizen/proof/AbstractSignature25519.java +++ b/sdk/src/main/java/com/horizen/proof/AbstractSignature25519.java @@ -15,7 +15,7 @@ public abstract class AbstractSignature25519 { @JsonProperty("signature") - final byte[] signatureBytes; + protected final byte[] signatureBytes; public AbstractSignature25519(byte[] signatureBytes) { this.signatureBytes = Arrays.copyOf(signatureBytes, signatureBytes.length); diff --git a/sdk/src/main/scala/com/horizen/block/SidechainBlock.scala b/sdk/src/main/scala/com/horizen/block/SidechainBlock.scala index cde70df729..73fe0d6701 100644 --- a/sdk/src/main/scala/com/horizen/block/SidechainBlock.scala +++ b/sdk/src/main/scala/com/horizen/block/SidechainBlock.scala @@ -51,18 +51,9 @@ class SidechainBlock(override val header: SidechainBlockHeader, override lazy val id: ModifierId = header.id - // TODO: prettify override lazy val transactions: Seq[SidechainTypes#SCBT] = { - var txs = Seq[SidechainTypes#SCBT]() - - for(b <- mainchainBlockReferencesData) { - if (b.sidechainRelatedAggregatedTransaction.isDefined) { - txs = txs :+ b.sidechainRelatedAggregatedTransaction.get - } - } - for(tx <- sidechainTransactions) - txs = txs :+ tx.asInstanceOf[SidechainTypes#SCBT] - txs + mainchainBlockReferencesData.flatMap(_.sidechainRelatedAggregatedTransaction) ++ + sidechainTransactions } def feePaymentsHash: Array[Byte] = header.feePaymentsHash diff --git a/sdk/src/main/scala/com/horizen/validation/WithdrawalEpochValidator.scala b/sdk/src/main/scala/com/horizen/validation/WithdrawalEpochValidator.scala index 2680bc399f..1b9045436e 100644 --- a/sdk/src/main/scala/com/horizen/validation/WithdrawalEpochValidator.scala +++ b/sdk/src/main/scala/com/horizen/validation/WithdrawalEpochValidator.scala @@ -71,14 +71,14 @@ class WithdrawalEpochValidator(params: NetworkParams) extends HistoryBlockValida throw new IllegalArgumentException("Sidechain block %s contains MC Block references, that belong to different withdrawal epochs.".format(BytesUtils.toHexString(idToBytes(block.id)))) } else { // epoch is the same - if (blockEpochInfo.lastEpochIndex == params.withdrawalEpochLength && block.transactions.nonEmpty) // Block is the last block of the epoch and contains SC Txs - throw new IllegalArgumentException("Sidechain block %s is the last withdrawal epoch block, but contains Sidechain Transactions.".format(BytesUtils.toHexString(idToBytes(block.id)))) + // Block is the last block of the withdrawal epoch and contains SC2SC Txs. + // Note: MC2SCAggTx is allowed, because of being a part of MC block reference data. + if (blockEpochInfo.lastEpochIndex == params.withdrawalEpochLength && block.sidechainTransactions.nonEmpty) + throw new IllegalArgumentException("Sidechain block %s is the withdrawal epoch last block, but contains Sidechain Transactions.".format(BytesUtils.toHexString(idToBytes(block.id)))) } case None => throw new IllegalArgumentException("Sidechain block %s parent block is missed.".format(BytesUtils.toHexString(idToBytes(block.id)))) } - - val backwardTransferCertificateCount = block.mainchainBlockReferencesData.flatMap(_.topQualityCertificate).size } } diff --git a/sdk/src/test/scala/com/horizen/fixtures/MainchainBlockReferenceFixture.scala b/sdk/src/test/scala/com/horizen/fixtures/MainchainBlockReferenceFixture.scala index e77b72e996..0293f3ac89 100644 --- a/sdk/src/test/scala/com/horizen/fixtures/MainchainBlockReferenceFixture.scala +++ b/sdk/src/test/scala/com/horizen/fixtures/MainchainBlockReferenceFixture.scala @@ -2,11 +2,12 @@ package com.horizen.fixtures import java.time.Instant import java.util.Random - import com.horizen.block.{MainchainBlockReference, MainchainBlockReferenceData, MainchainHeader, SidechainBlock} import com.horizen.chain.{MainchainHeaderHash, byteArrayToMainchainHeaderHash} import com.horizen.params.NetworkParams +import com.horizen.transaction.MC2SCAggregatedTransaction import com.horizen.utils._ +import org.scalatestplus.mockito.MockitoSugar.mock import scala.annotation.tailrec import scala.collection.mutable @@ -113,4 +114,11 @@ trait MainchainBlockReferenceFixture extends MainchainHeaderFixture { generated } } + + + def mainchainBlockReferenceWithMockedAggTx(ref: MainchainBlockReference): MainchainBlockReference = { + new MainchainBlockReference(ref.header, MainchainBlockReferenceData(ref.header.hash, Some(mock[MC2SCAggregatedTransaction]), None, None, Seq(), None)) { + override def semanticValidity(params: NetworkParams): Try[Unit] = Success(Unit) + } + } } diff --git a/sdk/src/test/scala/com/horizen/validation/WithdrawalEpochValidatorTest.scala b/sdk/src/test/scala/com/horizen/validation/WithdrawalEpochValidatorTest.scala index 366413bc36..dae63ef242 100644 --- a/sdk/src/test/scala/com/horizen/validation/WithdrawalEpochValidatorTest.scala +++ b/sdk/src/test/scala/com/horizen/validation/WithdrawalEpochValidatorTest.scala @@ -235,7 +235,7 @@ class WithdrawalEpochValidatorTest extends JUnitSuite with MockitoSugar with Mai // Test 4: valid block - no MainchainBlockReferenceData, parent is at the beginning of the epoch Mockito.when(historyStorage.blockInfoOptionById(ArgumentMatchers.any[ModifierId]())).thenReturn({ - Some(SidechainBlockInfo(0, 0, null, 0, ModifierSemanticValidity.Valid, Seq(), Seq(), + Some(SidechainBlockInfo(0, 0, null, 0, ModifierSemanticValidity.Valid, Seq(), Seq(), WithdrawalEpochInfo(1, 0), Option(VrfGenerator.generateVrfOutput(2)), bytesToId(new Array[Byte](32)) )) }) @@ -461,5 +461,61 @@ class WithdrawalEpochValidatorTest extends JUnitSuite with MockitoSugar with Mai }) assertTrue("Sidechain block with MainchainBlockReferenceData that lead to the finish of the epoch and 2 more MainchainHeaders expected to be valid.", validator.validate(block, history).isSuccess) + + + // Test 15: valid block - MainchainBlockReferenceData with MC2SCAggTx, that lead to the end of the epoch. + mcRefs = Seq(generateMainchainBlockReference()).map(mainchainBlockReferenceWithMockedAggTx) // 1 MC block ref with mocked AggTx + + block = SidechainBlock.create( + bytesToId(new Array[Byte](32)), + SidechainBlock.BLOCK_VERSION, + Instant.now.getEpochSecond - 10000, + mcRefs.map(_.data), // 1 MainchainBlockReferenceData + Seq(), + mcRefs.map(_.header), // 1 MainchainHeaders + Seq(), + forgerMeta14.blockSignSecret, + forgerMeta14.forgingStakeInfo, + VrfGenerator.generateProof(456L), + MerkleTreeFixture.generateRandomMerklePath(456L), + new Array[Byte](32), + sidechainTransactionsCompanion + ).get + Mockito.when(historyStorage.blockInfoOptionById(ArgumentMatchers.any[ModifierId]())).thenReturn({ + Some(SidechainBlockInfo(0, 0, null, 0, ModifierSemanticValidity.Valid, Seq(), Seq(), + WithdrawalEpochInfo(1, withdrawalEpochLength - 1), // lead to the last epoch index -> no epoch switch + Option(VrfGenerator.generateVrfOutput(6)), bytesToId(new Array[Byte](32)) + )) + }) + assertTrue("Sidechain block with MainchainBlockReferenceData with Mc2ScAggTx that lead to the finish of the epoch expected to be valid.", + validator.validate(block, history).isSuccess) + + + // Test 16: valid block - 3 MainchainBlockReferenceData (where the first 2 has MC2SCAggTx), that lead to the end of the epoch. + mcRefs = Seq(generateMainchainBlockReference(), generateMainchainBlockReference()).map(mainchainBlockReferenceWithMockedAggTx) ++ Seq(generateMainchainBlockReference()) + + block = SidechainBlock.create( + bytesToId(new Array[Byte](32)), + SidechainBlock.BLOCK_VERSION, + Instant.now.getEpochSecond - 10000, + mcRefs.map(_.data), // 3 MainchainBlockReferenceData + Seq(), + mcRefs.map(_.header), // 3 MainchainHeaders + Seq(), + forgerMeta14.blockSignSecret, + forgerMeta14.forgingStakeInfo, + VrfGenerator.generateProof(456L), + MerkleTreeFixture.generateRandomMerklePath(456L), + new Array[Byte](32), + sidechainTransactionsCompanion + ).get + Mockito.when(historyStorage.blockInfoOptionById(ArgumentMatchers.any[ModifierId]())).thenReturn({ + Some(SidechainBlockInfo(0, 0, null, 0, ModifierSemanticValidity.Valid, Seq(), Seq(), + WithdrawalEpochInfo(1, withdrawalEpochLength - 3), // lead to the last epoch index -> no epoch switch + Option(VrfGenerator.generateVrfOutput(6)), bytesToId(new Array[Byte](32)) + )) + }) + assertTrue("Sidechain block with multiple MainchainBlockReferenceData with Mc2ScAggTx that lead to the finish of the epoch expected to be valid.", + validator.validate(block, history).isSuccess) } } From b2686defec901cda1f51b46200267915ef0c7433 Mon Sep 17 00:00:00 2001 From: Oleksandr Iozhytsia Date: Tue, 29 Mar 2022 10:42:19 +0300 Subject: [PATCH 2/2] Version updated to 0.3.1 --- CHANGELOG.md | 4 ++++ README.md | 2 +- ci/run_sc.sh | 2 +- examples/simpleapp/README.md | 6 +++--- examples/simpleapp/mc_sc_workflow_example.md | 8 ++++---- examples/simpleapp/pom.xml | 4 ++-- pom.xml | 2 +- qa/SidechainTestFramework/sc_test_framework.py | 2 +- qa/SidechainTestFramework/scutil.py | 4 ++-- sdk/pom.xml | 2 +- tools/sctool/pom.xml | 4 ++-- 11 files changed, 22 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 419866eca8..8d82130130 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +**0.3.1** +1. Withdrawal epoch validator: fix wrongly rejected sidechain block containing McBlockRef with MC2SCAggTx leading to the end of the withdrawal epoch. + + **Blaze changes (0.3.0)** 1. New proving system for certificates verification: Coboundary Marlin. 2. PGD: decentralized certificates signing. diff --git a/README.md b/README.md index 39aea91209..2ac8530077 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ While we keep monitoring the memory footprint of the proofs generation process, - After the installation, just run `export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1` before starting the sidechain node, or run the sidechain node adding `LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1` at the beginning of the java command line as follows: ``` -LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 java -cp ./target/sidechains-sdk-simpleapp-0.3.0.jar:./target/lib/* com.horizen.examples.SimpleApp +LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 java -cp ./target/sidechains-sdk-simpleapp-0.3.1.jar:./target/lib/* com.horizen.examples.SimpleApp ``` - In the folder `ci` you will find the script `run_sc.sh` to automatically check and use jemalloc library while starting the sidechain node. diff --git a/ci/run_sc.sh b/ci/run_sc.sh index ca56f6ef56..a40d2cea5e 100755 --- a/ci/run_sc.sh +++ b/ci/run_sc.sh @@ -2,7 +2,7 @@ set -eo pipefail -SIMPLE_APP_VERSION="${SIMPLE_APP_VERSION:-0.3.0}" +SIMPLE_APP_VERSION="${SIMPLE_APP_VERSION:-0.3.1}" if [ -d "$1" ] && [ -f "$2" ]; then path_to_jemalloc="$(ldconfig -p | grep "$(arch)" | grep 'libjemalloc\.so\.1$' | tr -d ' ' | cut -d '>' -f 2)" diff --git a/examples/simpleapp/README.md b/examples/simpleapp/README.md index 4f236b2b03..5fcd6a1054 100644 --- a/examples/simpleapp/README.md +++ b/examples/simpleapp/README.md @@ -19,12 +19,12 @@ Otherwise, to run SimpleApp outside the IDE: * (Windows) ``` cd Sidechains-SDK\examples\simpleapp - java -cp ./target/sidechains-sdk-simpleapp-0.3.0.jar;./target/lib/* com.horizen.examples.SimpleApp + java -cp ./target/sidechains-sdk-simpleapp-0.3.1.jar;./target/lib/* com.horizen.examples.SimpleApp ``` * (Linux) ``` cd ./Sidechains-SDK/examples/simpleapp - java -cp ./target/sidechains-sdk-simpleapp-0.3.0.jar:./target/lib/* com.horizen.examples.SimpleApp + java -cp ./target/sidechains-sdk-simpleapp-0.3.1.jar:./target/lib/* com.horizen.examples.SimpleApp ``` On some Linux OSs during backward transfers certificates proofs generation a extremely big RAM consumption may happen, that will lead to the process force killing by the OS. @@ -36,7 +36,7 @@ While we keep monitoring the memory footprint of the proofs generation process, - After the installation, just run `export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1` before starting the sidechain node, or run the sidechain node adding `LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1` at the beginning of the java command line as follows: ``` - LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 java -cp ./target/sidechains-sdk-simpleapp-0.3.0.jar:./target/lib/* com.horizen.examples.SimpleApp + LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 java -cp ./target/sidechains-sdk-simpleapp-0.3.1.jar:./target/lib/* com.horizen.examples.SimpleApp ``` - In the folder `ci` you will find the script `run_sc.sh` to automatically check and use jemalloc library while starting the sidechain node. diff --git a/examples/simpleapp/mc_sc_workflow_example.md b/examples/simpleapp/mc_sc_workflow_example.md index 4350e89275..ed8b109dcb 100644 --- a/examples/simpleapp/mc_sc_workflow_example.md +++ b/examples/simpleapp/mc_sc_workflow_example.md @@ -15,7 +15,7 @@ Build SDK components by using command (in the root of the SDK folder): Run Bootstrapping tool using command: -`java -jar tools/sctool/target/sidechains-sdk-scbootstrappingtools-0.3.0.jar` +`java -jar tools/sctool/target/sidechains-sdk-scbootstrappingtools-0.3.1.jar` All other commands are performed as commands for Bootstrapping tool in next format: `"command name" "parameters for command in JSON format"`. For any help you could use command `help`, for exit just print `exit` @@ -397,15 +397,15 @@ Run SimpleApp with the `my_settings.conf`: * For Windows: ``` - java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.0.jar;./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/my_settings.conf + java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.1.jar;./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/my_settings.conf ``` * For Linux (Glibc): ``` - java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.0.jar:./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/my_settings.conf + java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.1.jar:./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/my_settings.conf ``` * For Linux (Jemalloc): ``` - LD_PRELOAD=/libjemalloc.so.1 java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.0.jar:./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/my_settings.conf + LD_PRELOAD=/libjemalloc.so.1 java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.1.jar:./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/my_settings.conf ``` - In the folder `ci` you will find the script `run_sc.sh` to automatically check and use jemalloc library while starting the sidechain node. diff --git a/examples/simpleapp/pom.xml b/examples/simpleapp/pom.xml index 03e1287d47..f414caded4 100644 --- a/examples/simpleapp/pom.xml +++ b/examples/simpleapp/pom.xml @@ -2,7 +2,7 @@ 4.0.0 io.horizen sidechains-sdk-simpleapp - 0.3.0 + 0.3.1 2018 UTF-8 @@ -16,7 +16,7 @@ io.horizen sidechains-sdk - 0.3.0 + 0.3.1 diff --git a/pom.xml b/pom.xml index fd1f4b47ff..d5a00020ce 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.horizen Sidechains - 0.3.0 + 0.3.1 2018 UTF-8 diff --git a/qa/SidechainTestFramework/sc_test_framework.py b/qa/SidechainTestFramework/sc_test_framework.py index 101538e1b3..d16d5ee828 100644 --- a/qa/SidechainTestFramework/sc_test_framework.py +++ b/qa/SidechainTestFramework/sc_test_framework.py @@ -114,7 +114,7 @@ def main(self): help="Don't stop bitcoinds after the test execution") parser.add_option("--zendir", dest="zendir", default="ZenCore/src", help="Source directory containing zend/zen-cli (default: %default)") - parser.add_option("--scjarpath", dest="scjarpath", default="../examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.0.jar;../examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp", #New option. Main class path won't be needed in future + parser.add_option("--scjarpath", dest="scjarpath", default="../examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.1.jar;../examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp", #New option. Main class path won't be needed in future help="Directory containing .jar file for SC (default: %default)") parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="sc_test"), help="Root directory for datadirs") diff --git a/qa/SidechainTestFramework/scutil.py b/qa/SidechainTestFramework/scutil.py index af396c9921..aaf36dcd2c 100644 --- a/qa/SidechainTestFramework/scutil.py +++ b/qa/SidechainTestFramework/scutil.py @@ -121,7 +121,7 @@ def launch_bootstrap_tool(command_name, json_parameters): json_param = json.dumps(json_parameters) java_ps = subprocess.Popen(["java", "-jar", os.getenv("SIDECHAIN_SDK", - "..") + "/tools/sctool/target/sidechains-sdk-scbootstrappingtools-0.3.0.jar", + "..") + "/tools/sctool/target/sidechains-sdk-scbootstrappingtools-0.3.1.jar", command_name, json_param], stdout=subprocess.PIPE) sc_bootstrap_output = java_ps.communicate()[0] try: @@ -448,7 +448,7 @@ def start_sc_node(i, dirname, extra_args=None, rpchost=None, timewait=None, bina lib_separator = ";" if binary is None: - binary = "../examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.0.jar" + lib_separator + "../examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp" + binary = "../examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.1.jar" + lib_separator + "../examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp" # else if platform.system() == 'Linux': ''' In order to effectively attach a debugger (e.g IntelliJ) to the simpleapp, it is necessary to start the process diff --git a/sdk/pom.xml b/sdk/pom.xml index 10b2e702a0..9766b6f52a 100644 --- a/sdk/pom.xml +++ b/sdk/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen sidechains-sdk - 0.3.0 + 0.3.1 ${project.groupId}:${project.artifactId} Zendoo is a unique sidechain and scaling solution developed by Horizen. The Zendoo ${project.artifactId} is a framework that supports the creation of sidechains and their custom business logic, with the Horizen public blockchain as the mainchain. https://github.com/${project.github.organization}/${project.artifactId} diff --git a/tools/sctool/pom.xml b/tools/sctool/pom.xml index 181d406d0d..a0044b6b29 100644 --- a/tools/sctool/pom.xml +++ b/tools/sctool/pom.xml @@ -2,7 +2,7 @@ 4.0.0 io.horizen sidechains-sdk-scbootstrappingtools - 0.3.0 + 0.3.1 2018 UTF-8 @@ -16,7 +16,7 @@ io.horizen sidechains-sdk - 0.3.0 + 0.3.1