Skip to content

Commit

Permalink
Release 0.3.4
Browse files Browse the repository at this point in the history
Release 0.3.4
  • Loading branch information
lander86 authored May 30, 2022
2 parents ae1b1ab + 6bf329c commit ad65bc0
Show file tree
Hide file tree
Showing 63 changed files with 1,651 additions and 147 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**0.3.4**
1. Added the possibility to perform a backup of a sidechain non coin-boxes and restore these boxes into a new bootstrapped sidechain of the same type.
2. log4j version updated.

**0.3.3**
1. Mainchain block deserialization fix: CompactSize usage issue.
2. Bootstrapping tool improvement: scgenesisinfo data parsing.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.jar:./target/lib/* com.horizen.examples.SimpleApp <path_to_config_file>
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 java -cp ./target/sidechains-sdk-simpleapp-0.3.4.jar:./target/lib/* com.horizen.examples.SimpleApp <path_to_config_file>
```
- In the folder `ci` you will find the script `run_sc.sh` to automatically check and use jemalloc library while starting the sidechain node.

Expand Down
2 changes: 1 addition & 1 deletion ci/run_sc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eo pipefail

SIMPLE_APP_VERSION="${SIMPLE_APP_VERSION:-0.3.3}"
SIMPLE_APP_VERSION="${SIMPLE_APP_VERSION:-0.3.4}"

if [ -d "$1" ] && [ -f "$2" ]; then
path_to_jemalloc="$(ldconfig -p | grep "$(arch)" | grep 'libjemalloc\.so\.1$' | tr -d ' ' | cut -d '>' -f 2)"
Expand Down
6 changes: 3 additions & 3 deletions examples/simpleapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.jar;./target/lib/* com.horizen.examples.SimpleApp <path_to_config_file>
java -cp ./target/sidechains-sdk-simpleapp-0.3.4.jar;./target/lib/* com.horizen.examples.SimpleApp <path_to_config_file>
```
* (Linux)
```
cd ./Sidechains-SDK/examples/simpleapp
java -cp ./target/sidechains-sdk-simpleapp-0.3.3.jar:./target/lib/* com.horizen.examples.SimpleApp <path_to_config_file>
java -cp ./target/sidechains-sdk-simpleapp-0.3.4.jar:./target/lib/* com.horizen.examples.SimpleApp <path_to_config_file>
```
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.
Expand All @@ -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.3.jar:./target/lib/* com.horizen.examples.SimpleApp <path_to_config_file>
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 java -cp ./target/sidechains-sdk-simpleapp-0.3.4.jar:./target/lib/* com.horizen.examples.SimpleApp <path_to_config_file>
```
- In the folder `ci` you will find the script `run_sc.sh` to automatically check and use jemalloc library while starting the sidechain node.
Expand Down
8 changes: 4 additions & 4 deletions examples/simpleapp/mc_sc_workflow_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.jar`
`java -jar tools/sctool/target/sidechains-sdk-scbootstrappingtools-0.3.4.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`
Expand Down Expand Up @@ -397,15 +397,15 @@ Run SimpleApp with the `my_settings.conf`:

* For Windows:
```
java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.3.jar;./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/my_settings.conf
java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.4.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.3.jar:./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/my_settings.conf
java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.4.jar:./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/my_settings.conf
```
* For Linux (Jemalloc):
```
LD_PRELOAD=<path to jemalloc library>/libjemalloc.so.1 java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.3.jar:./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/my_settings.conf
LD_PRELOAD=<path to jemalloc library>/libjemalloc.so.1 java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.4.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.

Expand Down
4 changes: 2 additions & 2 deletions examples/simpleapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-simpleapp</artifactId>
<version>0.3.3</version>
<version>0.3.4</version>
<inceptionYear>2018</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -16,7 +16,7 @@
<dependency>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk</artifactId>
<version>0.3.3</version>
<version>0.3.4</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.horizen.examples;

import com.horizen.storage.BoxBackupInterface;
import com.horizen.storage.BackupStorage;
import com.horizen.backup.BoxIterator;

public class BoxBackup implements BoxBackupInterface {
@Override
public void backup(BoxIterator source, BackupStorage db) throws Exception {

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.horizen.examples;

import com.horizen.backup.BoxIterator;
import com.horizen.block.SidechainBlock;
import com.horizen.box.Box;
import com.horizen.proposition.Proposition;
Expand Down Expand Up @@ -91,4 +92,9 @@ public void closeStorages() {
appStorage1.close();
appStorage2.close();
}


public Try<ApplicationState> onBackupRestore(BoxIterator i) {
return new Success<>(this);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.horizen.examples;

import com.horizen.backup.BoxIterator;
import com.horizen.box.Box;
import com.horizen.proposition.Proposition;
import com.horizen.secret.Secret;
Expand Down Expand Up @@ -84,4 +85,9 @@ public void closeStorages() {
walletStorage1.close();
walletStorage2.close();
}

@Override
public void onBackupRestore(BoxIterator i) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void configureApp() {
File stateUtxoMerkleTreeStore = new File(dataDirAbsolutePath + "/stateUtxoMerkleTree");
File historyStore = new File(dataDirAbsolutePath + "/history");
File consensusStore = new File(dataDirAbsolutePath + "/consensusData");

File backupStore = new File(dataDirAbsolutePath + "/backupStorage");


// Here I can add my custom rest api and/or override existing one
Expand Down Expand Up @@ -133,6 +133,9 @@ public void configureApp() {
bind(Storage.class)
.annotatedWith(Names.named("ConsensusStorage"))
.toInstance(new VersionedLevelDbStorageAdapter(consensusStore));
bind(Storage.class)
.annotatedWith(Names.named("BackupStorage"))
.toInstance(new VersionedLevelDbStorageAdapter(backupStore));

bind(new TypeLiteral<List<ApplicationApiGroup>> () {})
.annotatedWith(Names.named("CustomApiGroups"))
Expand All @@ -145,5 +148,6 @@ public void configureApp() {
bind(SidechainAppStopper.class)
.annotatedWith(Names.named("ApplicationStopper"))
.toInstance(applicationStopper);

}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.horizen</groupId>
<artifactId>Sidechains</artifactId>
<version>0.3.3</version>
<version>0.3.4</version>
<inceptionYear>2018</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
2 changes: 1 addition & 1 deletion qa/SidechainTestFramework/sc_test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.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.4.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")
Expand Down
6 changes: 3 additions & 3 deletions qa/SidechainTestFramework/scutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,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.3.jar",
"..") + "/tools/sctool/target/sidechains-sdk-scbootstrappingtools-0.3.4.jar",
command_name, json_param], stdout=subprocess.PIPE)
sc_bootstrap_output = java_ps.communicate()[0]
try:
Expand All @@ -142,7 +142,7 @@ def launch_db_tool(dirName, command_name, json_parameters):
json_param = json.dumps(json_parameters)
java_ps = subprocess.Popen(["java", "-jar",
os.getenv("SIDECHAIN_SDK",
"..") + "/tools/dbtool/target/sidechains-sdk-dbtools-0.3.3.jar",
"..") + "/tools/dbtool/target/sidechains-sdk-dbtools-0.3.4.jar",
storagesPath, command_name, json_param], stdout=subprocess.PIPE)
db_tool_output = java_ps.communicate()[0]
try:
Expand Down Expand Up @@ -468,7 +468,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.3.jar" + lib_separator + "../examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp"
binary = "../examples/simpleapp/target/sidechains-sdk-simpleapp-0.3.4.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
Expand Down
7 changes: 7 additions & 0 deletions qa/httpCalls/backup/blockIdForBackup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import json


# execute a backup/getSidechainBlockIdForBackup call
def getBlockIdForBackup(sidechainNode):
response = sidechainNode.backup_getSidechainBlockIdForBackup()
return response
3 changes: 3 additions & 0 deletions qa/run_sc_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from sc_db_tool_cmds import DBToolTest
from websocket_server_fee_payments import SCWsServerFeePayments
from sc_closed_forger import SidechainClosedForgerTest
from sc_blockid_for_backup import SidechainBlockIdForBackupTest


def run_test(test):
Expand Down Expand Up @@ -139,6 +140,8 @@ def run_tests(log_file):
result = run_test(DBToolTest())
assert_equal(0, result, "DBToolTest test failed!")

result = run_test(SidechainBlockIdForBackupTest())
assert_equal(0, result, "sc_blockid_for_backup test failed!")

if __name__ == "__main__":
log_file = open("sc_test.log", "w")
Expand Down
Loading

0 comments on commit ad65bc0

Please sign in to comment.