Skip to content

Commit

Permalink
Merge pull request #951 from HorizenOfficial/dev_081
Browse files Browse the repository at this point in the history
0.8.1 to master
  • Loading branch information
paolocappelletti authored Nov 7, 2023
2 parents 42b3b88 + 4120ce1 commit 3865ad2
Show file tree
Hide file tree
Showing 21 changed files with 563 additions and 108 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
**0.8.1**
1. Improved precision of eth_gasPrice RPC call

**0.8.0**
1. ZenDao native smart contracts
2. Added support for consensus parameter change (epoch lenght, slottime, active slot coefficient) using an hardfork
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,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.8.0.jar:./target/lib/* io.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.8.1.jar:./target/lib/* io.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
10 changes: 5 additions & 5 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ Otherwise, to run an Example App outside the IDE:
* (Windows)
```
cd Sidechains-SDK\examples\simpleapp
java -cp ./target/sidechains-sdk-simpleapp-0.8.0.jar;./target/lib/* io.horizen.examples.SimpleApp <path_to_config_file>
java -cp ./target/sidechains-sdk-simpleapp-0.8.1.jar;./target/lib/* io.horizen.examples.SimpleApp <path_to_config_file>
```
* (Linux)
```
cd ./Sidechains-SDK/examples/utxo/simpleapp
java -cp ./target/sidechains-sdk-simpleapp-0.8.0.jar:./target/lib/\* io.horizen.examples.SimpleApp <path_to_config_file>
java -cp ./target/sidechains-sdk-simpleapp-0.8.1.jar:./target/lib/\* io.horizen.examples.SimpleApp <path_to_config_file>
```
**Model: Account**
* (Windows)
```
cd Sidechains-SDK\examples\evmapp
java -cp ./target/sidechains-sdk-evmapp-0.8.0.jar;./target/lib/* io.horizen.examples.EvmApp <path_to_config_file>
java -cp ./target/sidechains-sdk-evmapp-0.8.1.jar;./target/lib/* io.horizen.examples.EvmApp <path_to_config_file>
```
* (Linux)
```
cd ./Sidechains-SDK/examples/account/evmapp
java -cp ./target/sidechains-evmapp-0.8.0.jar:./target/lib/\* io.horizen.examples.EvmApp <path_to_config_file>
java -cp ./target/sidechains-evmapp-0.8.1.jar:./target/lib/\* io.horizen.examples.EvmApp <path_to_config_file>
```
On some Linux OSs during backward transfers certificates proofs generation an extremely large RAM consumption may happen, that will lead to the process being force killed by the OS.
Expand All @@ -74,7 +74,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.8.0.jar:./target/lib/* io.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.8.1.jar:./target/lib/* io.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
4 changes: 2 additions & 2 deletions examples/account/evmapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-evmapp</artifactId>
<version>0.8.0</version>
<version>0.8.1</version>
<inceptionYear>2022</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -15,7 +15,7 @@
<dependency>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk</artifactId>
<version>0.8.0</version>
<version>0.8.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
6 changes: 3 additions & 3 deletions examples/account/evmapp_sctool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-evmapp_sctool</artifactId>
<version>0.8.0</version>
<version>0.8.1</version>
<inceptionYear>2022</inceptionYear>
<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand All @@ -14,13 +14,13 @@
<dependency>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-scbootstrappingtools</artifactId>
<version>0.8.0</version>
<version>0.8.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-evmapp</artifactId>
<version>0.8.0</version>
<version>0.8.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
16 changes: 8 additions & 8 deletions examples/mc_sc_workflow_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Build SDK components by using a command (in the root of the Sidechains-SDK folde

Run Bootstrapping tool using the command depending on the sidechain model:

- account: `java -jar tools/sidechains-sdk-account_sctools/target/sidechains-sdk-account_sctools-0.8.0.jar`
- utxo: `java -jar tools/sidechains-sdk-utxo_sctools/target/sidechains-sdk-utxo_sctools-0.8.0.jar`
- account: `java -jar tools/sidechains-sdk-account_sctools/target/sidechains-sdk-account_sctools-0.8.1.jar`
- utxo: `java -jar tools/sidechains-sdk-utxo_sctools/target/sidechains-sdk-utxo_sctools-0.8.1.jar`

All other commands are performed as commands for Bootstrapping tool in the next format: `"command name" "parameters for command in JSON format"`.
For any help, you could use the command `help`, for the exit just print `exit`
Expand Down Expand Up @@ -507,30 +507,30 @@ Run an Example App with the `my_settings.conf`:

* For Windows:
```
java -cp ./examples/utxo/simpleapp/target/sidechains-sdk-simpleapp-0.8.0.jar;./examples/simpleapp/target/lib/* io.horizen.examples.SimpleApp ./examples/my_settings.conf
java -cp ./examples/utxo/simpleapp/target/sidechains-sdk-simpleapp-0.8.1.jar;./examples/simpleapp/target/lib/* io.horizen.examples.SimpleApp ./examples/my_settings.conf
```
* For Linux (Glibc):
```
java -cp ./examples/utxo/simpleapp/target/sidechains-sdk-simpleapp-0.8.0.jar:./examples/simpleapp/target/lib/* io.horizen.examples.SimpleApp ./examples/my_settings.conf
java -cp ./examples/utxo/simpleapp/target/sidechains-sdk-simpleapp-0.8.1.jar:./examples/simpleapp/target/lib/* io.horizen.examples.SimpleApp ./examples/my_settings.conf
```
* For Linux (Jemalloc):
```
LD_PRELOAD=<path to jemalloc library>/libjemalloc.so.1 java -cp ./examples/utxo/simpleapp/target/sidechains-sdk-simpleapp-0.8.0.jar:./examples/simpleapp/target/lib/* io.horizen.examples.SimpleApp ./examples/my_settings.conf
LD_PRELOAD=<path to jemalloc library>/libjemalloc.so.1 java -cp ./examples/utxo/simpleapp/target/sidechains-sdk-simpleapp-0.8.1.jar:./examples/simpleapp/target/lib/* io.horizen.examples.SimpleApp ./examples/my_settings.conf
```

**Model: Account**

* For Windows:
```
java -cp ./examples/account/evmapp/target/sidechains-sdk-evmapp-0.8.0.jar;./examples/evmapp/target/lib/* io.horizen.examples.EvmApp ./examples/my_settings.conf
java -cp ./examples/account/evmapp/target/sidechains-sdk-evmapp-0.8.1.jar;./examples/evmapp/target/lib/* io.horizen.examples.EvmApp ./examples/my_settings.conf
```
* For Linux (Glibc):
```
java -cp ./examples/account/evmapp/target/sidechains-sdk-evmapp-0.8.0.jar:./examples/evmapp/target/lib/* io.horizen.examples.EvmApp ./examples/my_settings.conf
java -cp ./examples/account/evmapp/target/sidechains-sdk-evmapp-0.8.1.jar:./examples/evmapp/target/lib/* io.horizen.examples.EvmApp ./examples/my_settings.conf
```
* For Linux (Jemalloc):
```
LD_PRELOAD=<path to jemalloc library>/libjemalloc.so.1 java -cp ./examples/account/evmapp/target/sidechains-sdk-evmapp-0.8.0.jar:./examples/evmapp/target/lib/* io.horizen.examples.EvmApp ./examples/my_settings.conf
LD_PRELOAD=<path to jemalloc library>/libjemalloc.so.1 java -cp ./examples/account/evmapp/target/sidechains-sdk-evmapp-0.8.1.jar:./examples/evmapp/target/lib/* io.horizen.examples.EvmApp ./examples/my_settings.conf
```


Expand Down
4 changes: 2 additions & 2 deletions examples/utxo/simpleapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-simpleapp</artifactId>
<version>0.8.0</version>
<version>0.8.1</version>
<inceptionYear>2018</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -15,7 +15,7 @@
<dependency>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk</artifactId>
<version>0.8.0</version>
<version>0.8.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
6 changes: 3 additions & 3 deletions examples/utxo/utxoapp_sctool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-utxoapp_sctool</artifactId>
<version>0.8.0</version>
<version>0.8.1</version>
<inceptionYear>2018</inceptionYear>
<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand All @@ -14,13 +14,13 @@
<dependency>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-scbootstrappingtools</artifactId>
<version>0.8.0</version>
<version>0.8.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-simpleapp</artifactId>
<version>0.8.0</version>
<version>0.8.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.horizen</groupId>
<artifactId>Sidechains</artifactId>
<version>0.8.0</version>
<version>0.8.1</version>
<inceptionYear>2018</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
2 changes: 1 addition & 1 deletion qa/SidechainTestFramework/scutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

WAIT_CONST = 1

SNAPSHOT_VERSION_TAG = "0.8.0"
SNAPSHOT_VERSION_TAG = "0.8.1"

# log levels of the log4j trace system used by java applications
APP_LEVEL_OFF = "off"
Expand Down
63 changes: 32 additions & 31 deletions qa/sc_evm_gasPrice.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from SidechainTestFramework.account.httpCalls.transaction.sendTransaction import sendTransaction
from SidechainTestFramework.account.httpCalls.transaction.signTransaction import signTransaction
from SidechainTestFramework.account.utils import convertZenToWei
from SidechainTestFramework.scutil import generate_next_block, generate_next_blocks
from SidechainTestFramework.scutil import generate_next_block, generate_next_blocks, assert_equal
from test_framework.util import (assert_true)

"""
Expand Down Expand Up @@ -49,12 +49,12 @@ def __do_check_gas_price(self, minerFee, generate_blocks=1):
generate_next_blocks(sc_node, "first node", generate_blocks)

expected_price = int(sc_node.rpc_eth_getBlockByNumber('latest', True)['result']['baseFeePerGas'], 16)
if (minerFee + expected_price) > maxPrice:
expected_price = maxPrice
if minerFee > maxPrice:
expected_price += maxPrice
else:
expected_price += minerFee

assert_true(int(sc_node.rpc_eth_gasPrice()['result'], 16) == expected_price)
assert_equal(expected_price, int(sc_node.rpc_eth_gasPrice()['result'], 16))

def run_test(self):
ft_amount_in_zen = Decimal('1000.0')
Expand All @@ -73,38 +73,39 @@ def run_test(self):
transferred_amount_in_zen = Decimal('1.2')

# Create some txs for gasPrice calculation later
for i in range(5):
raw_tx = createRawEIP1559Transaction(sc_node,
fromAddress=evm_address_1,
toAddress=evm_address_2,
value=convertZenToWei(transferred_amount_in_zen),
nonce=str(nonce_addr_1),
maxPriorityFeePerGas=maxPriorityFeePerGas)
self.__do_send_raw_tx(raw_tx=raw_tx, evm_signer_address=evm_address_1)
nonce_addr_1 += 1

generate_next_block(sc_node, "first node")
assert_true(len(sc_node.rpc_eth_getBlockByNumber('latest', False)['result']['transactions']) == 5)
for j in range(10):
for i in range(5):
raw_tx = createRawEIP1559Transaction(sc_node,
fromAddress=evm_address_1,
toAddress=evm_address_2,
value=convertZenToWei(transferred_amount_in_zen),
nonce=str(nonce_addr_1),
maxPriorityFeePerGas=maxPriorityFeePerGas)
self.__do_send_raw_tx(raw_tx=raw_tx, evm_signer_address=evm_address_1)
nonce_addr_1 += 1
generate_next_block(sc_node, "first node")

self.__do_check_gas_price(maxPriorityFeePerGas, generate_blocks=10)
assert_true(len(sc_node.rpc_eth_getBlockByNumber('latest', False)['result']['transactions']) == 5)

self.__do_check_gas_price(maxPriorityFeePerGas, generate_blocks=15)
self.__do_check_gas_price(maxPriorityFeePerGas, generate_blocks=0)

self.__do_check_gas_price(0, generate_blocks=20)
self.__do_check_gas_price(maxPriorityFeePerGas, generate_blocks=40)

maxPriorityFeePerGas = 600000000000
for i in range(5):
raw_tx = createRawEIP1559Transaction(sc_node,
fromAddress=evm_address_1,
toAddress=evm_address_2,
value=convertZenToWei(transferred_amount_in_zen),
nonce=str(nonce_addr_1),
maxFeePerGas=maxPriorityFeePerGas,
maxPriorityFeePerGas=maxPriorityFeePerGas)
self.__do_send_raw_tx(raw_tx=raw_tx, evm_signer_address=evm_address_1)
nonce_addr_1 += 1

self.__do_check_gas_price(maxPriorityFeePerGas, generate_blocks=1)
for j in range(10):
for i in range(5):
raw_tx = createRawEIP1559Transaction(sc_node,
fromAddress=evm_address_1,
toAddress=evm_address_2,
value=convertZenToWei(transferred_amount_in_zen),
nonce=str(nonce_addr_1),
maxFeePerGas=maxPriorityFeePerGas,
maxPriorityFeePerGas=maxPriorityFeePerGas)
self.__do_send_raw_tx(raw_tx=raw_tx, evm_signer_address=evm_address_1)
nonce_addr_1 += 1
generate_next_block(sc_node, "first node")

self.__do_check_gas_price(maxPriorityFeePerGas, generate_blocks=0)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk</artifactId>
<version>0.8.0</version>
<version>0.8.1</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>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.</description>
<url>https://github.com/${project.github.organization}/${project.artifactId}</url>
Expand Down
Loading

0 comments on commit 3865ad2

Please sign in to comment.