Skip to content

Commit

Permalink
Merge pull request #975 from HorizenOfficial/dev
Browse files Browse the repository at this point in the history
0.10.0 to master
  • Loading branch information
paolocappelletti authored Dec 21, 2023
2 parents 4f40b9a + a6efa3c commit 4d9d397
Show file tree
Hide file tree
Showing 85 changed files with 4,181 additions and 335 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
**0.10.0**
1. Added support for multisg MC addresses in ZenDAO Native Smart Contract
2. Added support for ZenIP 42203/42206:
* it is now possible to move founds with a forward transfer directly to a smart contract address in the EON sidechain
* it is now possible to increment the EON forgers reward pool with a forward transfer to a specific address
5. Minor fixes:
* Forger Stake native smart contract: OpenStakeForgerList function can be invoked using the ABI-compliant signature. The old signature is still valid for backward compatibility.
* [eth RPC endpoint] Added upper limit (10000) for number of blocks to inspect when calling eth_getLogs
* [eth RPC endpoint] Fixed json representation in RPC response of signature V field for transaction type 2 - it should be in range of 0-1.
* [eth RPC endpoint] eth_gasPrice - algorithm to suggest gas price will take now 20th percentile instead of 40th

**0.9.0**
1. libevm dependency updated to 1.0.0.
2. Added support for EVM and native smart contracts interoperability.
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.9.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.10.0.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
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.9.0}"
SIMPLE_APP_VERSION="${SIMPLE_APP_VERSION:-0.10.0}"

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
1 change: 1 addition & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Horizen Sidechain SDK Release Notes

## Version [0.10.0](/doc/release/0.10.0.md)
## Version [0.9.0](/doc/release/0.9.0.md)
## Version [0.8.1](/doc/release/0.8.1.md)
## Version [0.8.0](/doc/release/0.8.0.md)
Expand Down
48 changes: 48 additions & 0 deletions doc/release/0.10.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Release notes - version 0.10.0

---

## Notes about new/updated Features

### Support for multisg MC addresses in ZenDAO Native Smart Contract

In ZenDAO Native Smart Contract, now MC multisig addresses can be associated to a SC address as any other MC transparent address.

### Support for ZenIP 42203 & ZenIP 42206

The new support for ZenIP 42203 & ZenIP 42206 will introduce the following two features:

- possibility to execute forward transfers from the Mainchain directly to smart contract addresses
- possibility to increment the forgers' rewards by executing a transfer (standard EOA or forward transfer) to the "special" address 0x000000000000000000003333333333333333333.
- The amount of ZEN collected by the address will be redistributed to each forger proportionally to the number of blocks forged within the latest "distribution window"
- The "distribution window" starts from the previous "distribution window" end. In the case of the 1st distribution, it starts from the hardfork introduced with this version.
- The "distribution window" ends when both the following conditions are met:
- the chain reaches a "Withdrawal epoch end"
- the balance of "special address" is greater than zero

---
## Bug Fixes
- Forger Stake native smart contract: OpenStakeForgerList function can now be invoked using the ABI-compliant signature.

In previous versions, the method signature was incorrectly missing a closing parenthesis at the end:
```
openStakeForgerList(uint32,bytes32,bytes32
```
instead of
```
openStakeForgerList(uint32,bytes32,bytes32)
```

For backward compatibility, the old signature is anyway still valid.

---

## Improvements

---
## Update test instructions from previous version


---
Full [Changelog](/CHANGELOG.md) file here

6 changes: 1 addition & 5 deletions doc/release/0.9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ import "./ForgerStakes.sol";
---
## Bug Fixes


---

## Improvements


## Improvements

---
## Update test instructions from previous version
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.9.0.jar;./target/lib/* io.horizen.examples.SimpleApp <path_to_config_file>
java -cp ./target/sidechains-sdk-simpleapp-0.10.0.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.9.0.jar:./target/lib/\* io.horizen.examples.SimpleApp <path_to_config_file>
java -cp ./target/sidechains-sdk-simpleapp-0.10.0.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.9.0.jar;./target/lib/* io.horizen.examples.EvmApp <path_to_config_file>
java -cp ./target/sidechains-sdk-evmapp-0.10.0.jar;./target/lib/* io.horizen.examples.EvmApp <path_to_config_file>
```
* (Linux)
```
cd ./Sidechains-SDK/examples/account/evmapp
java -cp ./target/sidechains-evmapp-0.9.0.jar:./target/lib/\* io.horizen.examples.EvmApp <path_to_config_file>
java -cp ./target/sidechains-evmapp-0.10.0.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.9.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.10.0.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.9.0</version>
<version>0.10.0</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.9.0</version>
<version>0.10.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.horizen.examples;

import io.horizen.account.fork.Version1_2_0Fork;
import io.horizen.account.fork.ContractInteroperabilityFork;
import io.horizen.fork.*;
import io.horizen.account.fork.GasFeeFork;
Expand Down Expand Up @@ -65,10 +66,13 @@ public List<Pair<SidechainForkConsensusEpoch, OptionalSidechainFork>> getOptiona
)
),
new Pair<>(
// TODO the actual fork point needs to be decided
new SidechainForkConsensusEpoch(50, 50, 50),
new ContractInteroperabilityFork(true)
)
),
new Pair<>(
new SidechainForkConsensusEpoch(60, 60, 60),
new Version1_2_0Fork(true)
)
);
}
}
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.9.0</version>
<version>0.10.0</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.9.0</version>
<version>0.10.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-evmapp</artifactId>
<version>0.9.0</version>
<version>0.10.0</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.9.0.jar`
- utxo: `java -jar tools/sidechains-sdk-utxo_sctools/target/sidechains-sdk-utxo_sctools-0.9.0.jar`
- account: `java -jar tools/sidechains-sdk-account_sctools/target/sidechains-sdk-account_sctools-0.10.0.jar`
- utxo: `java -jar tools/sidechains-sdk-utxo_sctools/target/sidechains-sdk-utxo_sctools-0.10.0.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.9.0.jar;./examples/simpleapp/target/lib/* io.horizen.examples.SimpleApp ./examples/my_settings.conf
java -cp ./examples/utxo/simpleapp/target/sidechains-sdk-simpleapp-0.10.0.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.9.0.jar:./examples/simpleapp/target/lib/* io.horizen.examples.SimpleApp ./examples/my_settings.conf
java -cp ./examples/utxo/simpleapp/target/sidechains-sdk-simpleapp-0.10.0.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.9.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.10.0.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.9.0.jar;./examples/evmapp/target/lib/* io.horizen.examples.EvmApp ./examples/my_settings.conf
java -cp ./examples/account/evmapp/target/sidechains-sdk-evmapp-0.10.0.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.9.0.jar:./examples/evmapp/target/lib/* io.horizen.examples.EvmApp ./examples/my_settings.conf
java -cp ./examples/account/evmapp/target/sidechains-sdk-evmapp-0.10.0.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.9.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.10.0.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.9.0</version>
<version>0.10.0</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.9.0</version>
<version>0.10.0</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.9.0</version>
<version>0.10.0</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.9.0</version>
<version>0.10.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-simpleapp</artifactId>
<version>0.9.0</version>
<version>0.10.0</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.9.0</version>
<version>0.10.0</version>
<inceptionYear>2018</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import json


def sendMultisigKeysOwnership(sidechainNode, *, sc_address, mc_addr, mc_signatures, redeemScript,
nonce=None, gas_limit=2300000, max_priority_fee_per_gas=900000000,
max_fee_per_gas=900000000, api_key=None):
j = {
"ownershipInfo": {
"scAddress" : sc_address,
"mcMultisigAddress": mc_addr,
"mcSignatures": mc_signatures,
"redeemScript": redeemScript
},
"nonce": nonce,
"gasInfo": {
"gasLimit": gas_limit,
"maxFeePerGas": max_fee_per_gas,
"maxPriorityFeePerGas": max_priority_fee_per_gas
}
}

request = json.dumps(j)
if api_key is not None:
response = sidechainNode.transaction_sendMultisigKeysOwnership(request, api_key)
else:
response = sidechainNode.transaction_sendMultisigKeysOwnership(request)


if "result" in response:
return response["result"]

raise RuntimeError("Something went wrong, see {}".format(str(response)))

Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ interface McAddrOwnership {

function sendKeysOwnership(bytes3 mcAddrBytes1, bytes32 mcAddrBytes2, bytes24 signature1, bytes32 signature2, bytes32 signature3) external returns (bytes32);

function sendMultisigKeysOwnership(string memory mcMultisigAddress, string memory redeemScript, string[] memory mcSignatures) external returns (bytes32);

function removeKeysOwnership(bytes3 mcAddrBytes1, bytes32 mcAddrBytes2) external returns (bytes32);
}
8 changes: 5 additions & 3 deletions qa/SidechainTestFramework/account/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,20 @@ def convertZenniesToZen(valueInZennies):
# smart contract address for handling forger stakes
WITHDRAWAL_REQ_SMART_CONTRACT_ADDRESS = "0000000000000000000011111111111111111111"
FORGER_STAKE_SMART_CONTRACT_ADDRESS = "0000000000000000000022222222222222222222"
FORGER_POOL_RECIPIENT_ADDRESS = "0000000000000000000033333333333333333333"
CERTIFICATE_KEY_ROTATION_SMART_CONTRACT_ADDRESS = "0000000000000000000044444444444444444444"
MC_ADDR_OWNERSHIP_SMART_CONTRACT_ADDRESS = "0000000000000000000088888888888888888888"
PROXY_SMART_CONTRACT_ADDRESS = "00000000000000000000AAAAAAAAAAAAAAAAAAAA"
# address used for burning coins
NULL_ADDRESS = "0000000000000000000000000000000000000000"

# TODO It may change. It should have the same value as in src/main/java/io/horizen/examples/AppForkConfigurator.java
INTEROPERABILITY_FORK_EPOCH = 50

# The activation epoch of the zendao feature, as coded in the sdk
ZENDAO_FORK_EPOCH = 7

# They should have the same value as in src/main/java/io/horizen/examples/AppForkConfigurator.java
INTEROPERABILITY_FORK_EPOCH = 50
VER_1_2_FORK_EPOCH = 60

# Block gas limit
BLOCK_GAS_LIMIT = 30000000

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.9.0"
SNAPSHOT_VERSION_TAG = "0.10.0"

# log levels of the log4j trace system used by java applications
APP_LEVEL_OFF = "off"
Expand Down
3 changes: 3 additions & 0 deletions qa/run_sc_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ testScriptsEvm=(
'account_websocket_server_sync.py'
'account_websocket_server_rpc.py'
'sc_evm_mc_addr_ownership.py'
'sc_evm_mc_addr_ownership_multisig.py'
'sc_evm_mc_addr_ownership_perf_test.py'
'sc_evm_proxy_nsc.py'
'sc_evm_seedernode.py'
Expand All @@ -139,6 +140,8 @@ testScriptsEvm=(
'sc_evm_rpc_eth.py'
'sc_evm_consensus_parameters_fork_with_sidechain_forks.py'
'sc_evm_consensus_parameters_fork_with_mainchain_forks.py'
'sc_evm_ft_to_smart_contract.py'
'sc_evm_forging_fee_payments_rollback.py'
);

testScriptsUtxo=(
Expand Down
Loading

0 comments on commit 4d9d397

Please sign in to comment.