Skip to content

Commit

Permalink
Merge branch 'development' into storage_version_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
paolocappelletti authored Oct 4, 2023
2 parents a3167cf + c15e2a4 commit 9a941fc
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 52 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
## 1.0.1-SNAPSHOT
* SDK dependency updated to version 0.8.1

## 1.0.0-SNAPSHOT
## 1.0.0
* SDK dependency updated to version 0.8.0
* Fork configuration to enable ZenDao support and change consensus parameters (consensus epoch slot time and lenght, acrive slot coefficient)
* Fork configuration to enable decentralized governance (ZenDao) and change consensus parameters (consensus epoch slot time and lenght, acrive slot coefficient)
* Introduced a delay of 6 blocks in the inclusion of the mainchain blocks

## 0.2.1
* Updated SDK dependency to 0.7.2

## 0.2.0-1
* Updated entrypoint script logic
* Updated CI/CD
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Horizen - Zen Blockchain Foundation
Copyright (c) 2023 The Horizen Foundation
Copyright (c) 2023 Zen Blockchain Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,29 @@

Horizen EON is a public proof-of-stake sidechain and a fully EVM-compatible smart contracting platform that allows developers to efficiently build and deploy dapps on Horizen, while fully benefiting from the Ethereum ecosystem.

[Public Release Notes](/doc/index.md)

[Changelog](/CHANGELOG.md)

### EVM compatibility
Current EVM implementation is based on go-ethereum [Paravin](https://github.com/ethereum/go-ethereum/releases/tag/v1.10.26) (`v1.10.26`).<br>
Solidity compiler is supported up to version `0.8.19`.

### Supported platforms

EON node is available on Linux and Windows (64bit).

### Documentation

More information of how to connect wallets, write smart contracts and interact with EON is available [here]( https://eon.horizen.io/docs/).
More information of how to connect wallets, write smart contracts, run a local node and interact with EON is available [here]( https://eon.horizen.io/docs/).

### Project structure
- node: <br>
the module contains everything you need to run an EON node;

- bootstraptool: <br>
the module contains the tools you need in order to register and create the configuration file for the EON sidechain.<br>
the module contains the tools you need if you intend to register a new sidechain and create the configuration file for it
<br>
Usage:<br>
- obtain the jar by running <b>mvn package [-Ppregobi] [-Pgobi]</b> <br>
NOTE: The -Ppregobi OR -Pgobi suffix is needed ONLY to build a bootstrapping tool for Pregobi/Gobi testnet network.
Expand Down
16 changes: 16 additions & 0 deletions api/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"network":"mainnet",
"networkName": "eon",
"version":"0.2.1",
"dockerImages":["zencash/evmapp:0.2.1","zencash/evmapp:latest"],
"ghReleaseLink":"github.com/HorizenOfficial/eon/releases/tag/0.2.1"
},
{
"network":"testnet",
"networkName": "gobi",
"version":"0.2.1",
"dockerImages":["zencash/evmapp:0.2.1","zencash/evmapp:latest"],
"ghReleaseLink":"github.com/HorizenOfficial/eon/releases/tag/0.2.1"
}
]
3 changes: 3 additions & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# EON Release Notes

## Version [1.0.0](/doc/release/1.0.0.md)
22 changes: 22 additions & 0 deletions doc/release/1.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Release notes - version 1.0.0
---

## Notes about new/updated Features
The 1.0.0 version has been updated to the 0.8.0 SDK version, which introduces new configuration properties for handling the peers connections: refer to [SDK release notes](https://github.com/HorizenOfficial/Sidechains-SDK/tree/master/doc/release/0.8.0.md) for a detailed explanation.

This EON version introduces a new native smart contract to support decentralized governance workflow.

The following changes will be applied to the consensus parameters:
- number of consensus epoch slots increased from 720 to 15000 per consensus epoch
- length of each consensus epoch slot decreased from 12 to 3 seconds
- active slot coefficient (number of slots with at least one leader divided by total number of slot) set to 0.167

A delay of 6 mainchain blocks for the inclusion of the mainchain blocks references has been introduced on the forgers.


---
## Update from previous version instructions
Also for the update instructions please refer to the section in the [SDK release notes](https://github.com/HorizenOfficial/Sidechains-SDK/tree/master/doc/release/0.8.0.md)

---
Full [Changelog](/CHANGELOG.md) available.
106 changes: 65 additions & 41 deletions dockerfiles/evmapp/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ SCNODE_REST_APIKEYHASH=""
MAX_INCOMING_CONNECTIONS=""
MAX_OUTGOING_CONNECTIONS=""
WS_ADDRESS=""
ONLY_CONNECT_TO_KNOWN_PEERS=""
FORGER_MAXCONNECTIONS=""

SCNODE_REMOTE_KEY_MANAGER_ENABLED="${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-false}"
export SCNODE_REMOTE_KEY_MANAGER_ENABLED
Expand Down Expand Up @@ -87,8 +89,6 @@ to_check=(
"SCNODE_WS_SERVER_PORT"
"SCNODE_WS_CLIENT_ENABLED"
"SCNODE_WS_SERVER_ENABLED"
"SCNODE_ONLY_CONNECT_TO_KNOWN_PEERS"
"SCNODE_FORGER_MAXCONNECTIONS"
)
for var in "${to_check[@]}"; do
if [ -z "${!var:-}" ]; then
Expand All @@ -115,50 +115,56 @@ if [ "${SCNODE_CERT_SIGNING_ENABLED:-}" = "true" ]; then
exit 1
fi

# Checking all REMOTE_KEY_MANAGER_ENABLED parameters when SCNODE_REMOTE_KEY_MANAGER_ENABLED=true
if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ]; then
# Checking KEY_MANAGER_REQUEST_TIMEOUT
if [ -z "${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT:-}" ]; then
echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true, 'SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT' variable is required to be set."
sleep 5
exit 1
else
REMOTE_KEY_MANAGER_REQUEST_TIMEOUT="$(echo -en "\n requestTimeout = ${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT}")"
export REMOTE_KEY_MANAGER_REQUEST_TIMEOUT
fi
if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -z "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS:-}" ]; then
echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true SCNODE_REMOTE_KEY_MANAGER_ADDRESS needs to be set."
sleep 5
exit 1
fi

# Checking KEY_MANAGER_PARALLEL_REQUESTS
if [ -z "${SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS:-}" ]; then
echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true, 'SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS' variable is required to be set."
sleep 5
exit 1
else
if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -z "${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT:-}" ]; then
echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT needs to be set."
sleep 5
exit 1
elif [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -n "${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT:-}" ]; then
# setting SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT if provided
REMOTE_KEY_MANAGER_REQUEST_TIMEOUT=""
REMOTE_KEY_MANAGER_REQUEST_TIMEOUT="$(echo -en "\n requestTimeout = ${SCNODE_REMOTE_KEY_MANAGER_REQUEST_TIMEOUT}")"
export REMOTE_KEY_MANAGER_REQUEST_TIMEOUT
fi

if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -z "${SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS:-}" ]; then
echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS needs to be set."
sleep 5
exit 1
if [ "${SCNODE_REMOTE_KEY_MANAGER_ENABLED:-}" = "true" ] && [ -n "${SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS:-}" ]; then
# setting SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS if provided
REMOTE_KEY_MANAGER_PARALLEL_REQUESTS=""
REMOTE_KEY_MANAGER_PARALLEL_REQUESTS="$(echo -en "\n numOfParallelRequests = ${SCNODE_REMOTE_KEY_MANAGER_PARALLEL_REQUESTS}")"
export REMOTE_KEY_MANAGER_PARALLEL_REQUESTS
fi
fi

# Checking REMOTE_KEY_MANAGER_ADDRESS and its connectivity
if [ -z "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS:-}" ]; then
echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true SCNODE_REMOTE_KEY_MANAGER_ADDRESS needs to be set."
# Checking REMOTE_KEY_MANAGER_ADDRESS and its connectivity
if [ -z "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS:-}" ]; then
echo "Error: When SCNODE_CERT_SIGNING_ENABLED=true and SCNODE_REMOTE_KEY_MANAGER_ENABLED=true SCNODE_REMOTE_KEY_MANAGER_ADDRESS needs to be set."
sleep 5
exit 1
else
host="$(cut -d'/' -f 3 <<< "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}" | cut -d':' -f 1)"
port="$(cut -d ':' -f 3 <<< "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}")"
port="${port:-80}"
# make sure host and port are reachable
i=0
while ! nc -z "${host}" "${port}" &> /dev/null; do
echo "Waiting for '${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}' endpoint to be ready."
sleep 5
exit 1
else
host="$(cut -d'/' -f 3 <<< "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}" | cut -d':' -f 1)"
port="$(cut -d ':' -f 3 <<< "${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}")"
port="${port:-80}"
# make sure host and port are reachable
i=0
while ! nc -z "${host}" "${port}" &> /dev/null; do
echo "Waiting for '${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}' endpoint to be ready."
sleep 5
i="$((i+1))"
if [ "$i" -gt 48 ]; then
echo "Error: '${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}' endpoint is not ready after 4 minutes."
exit 1
fi
done
fi
fi
i="$((i+1))"
if [ "$i" -gt 48 ]; then
echo "Error: '${SCNODE_REMOTE_KEY_MANAGER_ADDRESS}' endpoint is not ready after 4 minutes."
exit 1
fi
done
fi
fi

if [ "${SCNODE_FORGER_ENABLED:-}" = "true" ] || [ "${SCNODE_CERT_SUBMITTER_ENABLED:-}" = "true" ]; then
Expand All @@ -169,6 +175,24 @@ if [ "${SCNODE_FORGER_ENABLED:-}" = "true" ] || [ "${SCNODE_CERT_SUBMITTER_ENABL
fi
fi

# Checking SCNODE_FORGER_MAXCONNECTIONS for Forger nodes
if [ "${SCNODE_FORGER_ENABLED:-}" = "true" ]; then
if [ -n "${SCNODE_FORGER_MAXCONNECTIONS:-}" ]; then
FORGER_MAXCONNECTIONS="$(echo -en "\n maxForgerConnections = ${SCNODE_FORGER_MAXCONNECTIONS}")"
else
echo "Error: Environment variable SCNODE_FORGER_MAXCONNECTIONS is required when SCNODE_FORGER_ENABLED=true !!!"
sleep 5
exit 1
fi
fi
export FORGER_MAXCONNECTIONS

# setting onlyConnectToKnownPeers if provided
if [ -n "${SCNODE_ONLY_CONNECT_TO_KNOWN_PEERS:-}" ]; then
ONLY_CONNECT_TO_KNOWN_PEERS="$(echo -en "\n onlyConnectToKnownPeers = ${SCNODE_ONLY_CONNECT_TO_KNOWN_PEERS}")"
fi
export ONLY_CONNECT_TO_KNOWN_PEERS

# Flexibility for log levels
if [ -z "${SCNODE_LOG_FILE_LEVEL:-}" ]; then
SCNODE_LOG_FILE_LEVEL='info'
Expand Down Expand Up @@ -290,7 +314,7 @@ SUBST='$SCNODE_CERT_MASTERS_PUBKEYS:$SCNODE_CERT_SIGNERS_MAXPKS:$SCNODE_CERT_SIG
'$SCNODE_NET_DECLAREDADDRESS:$SCNODE_NET_KNOWNPEERS:$SCNODE_NET_MAGICBYTES:$SCNODE_NET_NODENAME:$SCNODE_NET_P2P_PORT:$SCNODE_NET_API_LIMITER_ENABLED:$SCNODE_NET_SLOW_MODE:$SCNODE_NET_REBROADCAST_TXS:$SCNODE_NET_HANDLING_TXS:'\
'$SCNODE_WALLET_GENESIS_SECRETS:$SCNODE_WALLET_MAXTX_FEE:$SCNODE_WALLET_SEED:$WS_ADDRESS:$MAX_INCOMING_CONNECTIONS:$MAX_OUTGOING_CONNECTIONS:$SCNODE_WS_SERVER_PORT:'\
'$SCNODE_WS_CLIENT_ENABLED:$SCNODE_WS_SERVER_ENABLED:$SCNODE_REMOTE_KEY_MANAGER_ENABLED:$SCNODE_REMOTE_KEY_MANAGER_ADDRESS:$SCNODE_LOG_FILE_LEVEL:$SCNODE_LOG_CONSOLE_LEVEL:$REMOTE_KEY_MANAGER_REQUEST_TIMEOUT:$REMOTE_KEY_MANAGER_PARALLEL_REQUESTS:'\
'$SCNODE_REST_APIKEYHASH:$SCNODE_REST_PORT:$SCNODE_ONLY_CONNECT_TO_KNOWN_PEERS:$SCNODE_FORGER_MAXCONNECTIONS'\
'$SCNODE_REST_APIKEYHASH:$SCNODE_REST_PORT:$ONLY_CONNECT_TO_KNOWN_PEERS:$FORGER_MAXCONNECTIONS'\

export SUBST
envsubst "${SUBST}" < /sidechain/config/sc_settings.conf.tmpl > /sidechain/config/sc_settings.conf
Expand Down
4 changes: 1 addition & 3 deletions dockerfiles/evmapp/sc_settings.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ sparkz {
rebroadcastQueueSize = 1024
rebroadcastBatchSize = 75
handlingTransactionsEnabled = $SCNODE_NET_HANDLING_TXS
onlyConnectToKnownPeers = $SCNODE_ONLY_CONNECT_TO_KNOWN_PEERS
maxForgerConnections = $SCNODE_FORGER_MAXCONNECTIONS
isForgerNode = $SCNODE_FORGER_ENABLED
isForgerNode = $SCNODE_FORGER_ENABLED$FORGER_MAXCONNECTIONS$ONLY_CONNECT_TO_KNOWN_PEERS
}

apiRateLimiter {
Expand Down
5 changes: 3 additions & 2 deletions node/src/main/java/io/horizen/eon/EonForkConfigurator.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ public class EonForkConfigurator extends ForkConfigurator {
//EON fork 2: ZenDAO + Change of consensus params + change of active slot coefficient
static final int F2_REGTEST_FORKPOINT = 7;
static final int F2_PREGOBI_TESTNET_FORKPOINT = 1698; //estimated start: Wed 13 Sept 2023 15:31 Milano time
static final int F2_GOBI_TESTNET_FORKPOINT = 100000000; //todo
static final int F2_GOBI_TESTNET_FORKPOINT = 1804; ///estimated start: Mon 09 Oct 2023 16:21 Milano time
static final int F2_TESTNET_FORKPOINT = 800;
static final int F2_MAINNET_FORKPOINT = 100000000; //todo
static final int F2_MAINNET_FORKPOINT = 1109; ///estimated start: Thu 19 Oct 2023 15:55 Milano time



private final SidechainForkConsensusEpoch mandatorySidechainFork1;
Expand Down

0 comments on commit 9a941fc

Please sign in to comment.