Skip to content

Commit

Permalink
Merge pull request #117 from HorizenOfficial/development
Browse files Browse the repository at this point in the history
version 1.4.0 to master
  • Loading branch information
paolocappelletti authored Jun 18, 2024
2 parents 5add04f + 5de188e commit efb06c8
Show file tree
Hide file tree
Showing 42 changed files with 1,696 additions and 76 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog
## 1.4.0
* SDK dependency updated to version 0.12.0 (see [SDK changelog](https://github.com/HorizenOfficial/Sidechains-SDK/blob/0.12.0/CHANGELOG.md))
* Fork configuration to enable new on-chain delegated staking reward mechanism and new handling of rewards from mainchain
* Added support for metrics endpoint
* Bug fix: Modify entrypoint.sh: Improve declared ip detection in MacOS environments

## 1.3.1
* Bug fix: Modify entrypoint.sh: Allow all node types to set FORGER_MAXCONNECTIONS env variable
Expand Down
14 changes: 7 additions & 7 deletions api/version.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
{
"network":"mainnet",
"networkName": "eon",
"version":"1.3.1",
"dockerImages":["zencash/evmapp:1.3.1","zencash/evmapp:latest"],
"ghReleaseLink":"github.com/HorizenOfficial/eon/releases/tag/1.3.1"
"version":"1.4.0",
"dockerImages":["zencash/evmapp:1.4.0","zencash/evmapp:latest"],
"ghReleaseLink":"github.com/HorizenOfficial/eon/releases/tag/1.4.0"
},
{
"network":"testnet",
"networkName": "gobi",
"version":"1.3.1",
"dockerImages":["zencash/evmapp:1.3.1","zencash/evmapp:latest"],
"ghReleaseLink":"github.com/HorizenOfficial/eon/releases/tag/1.3.1"
"version":"1.4.0",
"dockerImages":["zencash/evmapp:1.4.0","zencash/evmapp:latest"],
"ghReleaseLink":"github.com/HorizenOfficial/eon/releases/tag/1.4.0"
}
]
]
6 changes: 3 additions & 3 deletions bootstraptool/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>bootstraptool</artifactId>
<version>1.3.1</version>
<version>1.4.0</version>
<inceptionYear>2023</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -16,12 +16,12 @@
<dependency>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk-account_sctools</artifactId>
<version>0.11.0</version>
<version>0.12.0</version>
</dependency>
<dependency>
<groupId>io.horizen</groupId>
<artifactId>eon</artifactId>
<version>1.3.1</version>
<version>1.4.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
35 changes: 22 additions & 13 deletions ci/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ if [ -n "${TRAVIS_TAG}" ]; then
check_signed_tag "${TRAVIS_TAG}"

# Checking format of production release pom version
if ! [[ "${ROOT_POM_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9]+)?(-RC[0-9]+)?$ ]]; then
echo "Warning: package(s) version is in the wrong format for PRODUCTION} release. Expecting: d.d.d(-RC[0-9]+)?. The build is not going to be released !!!"
if ! [[ "${ROOT_POM_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9]+)?$ ]]; then
echo "Warning: package(s) version is in the wrong format for PRODUCTION} release. Expecting: d.d.d(-[0-9]+)?. The build is not going to be released !!!"
export IS_A_RELEASE="false"
fi

Expand All @@ -124,21 +124,30 @@ if [ -n "${TRAVIS_TAG}" ]; then
check_signed_tag "${TRAVIS_TAG}"

# Checking if package version matches DEV release version
if ! [[ "${ROOT_POM_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9]+)?(-RC[0-9]+)?(-SNAPSHOT){1}$ ]]; then
echo "Warning: package(s) version is in the wrong format for DEVELOPMENT release. Expecting: d.d.d(-RC[0-9]+)?(-SNAPSHOT){1}. The build is not going to be released !!!"
export IS_A_RELEASE="false"
fi

# Checking Github tag format
if ! [[ "${TRAVIS_TAG}" =~ "${ROOT_POM_VERSION}"[0-9]*$ ]]; then
echo "" && echo "=== Warning: GIT tag format differs from the pom file version. ===" && echo ""
echo -e "Github tag name: ${TRAVIS_TAG}\nPom file version: ${ROOT_POM_VERSION}.\nThe build is not going to be released !!!"
if [[ "${ROOT_POM_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9]+)?(-SNAPSHOT){1}$ ]]; then
if [[ "${TRAVIS_TAG}" =~ "${ROOT_POM_VERSION}"[0-9]*$ ]]; then
echo "" && echo "=== Development release ===" && echo ""
export IS_A_RELEASE="true"
else
echo "" && echo "=== Warning: GIT tag format differs from the pom file version. ===" && echo ""
echo -e "Github tag name: ${TRAVIS_TAG}\nPom file version: ${ROOT_POM_VERSION}.\nThe build is not going to be released !!!"
export IS_A_RELEASE="false"
fi
elif [[ "${ROOT_POM_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-RC[0-9]+){1}$ ]]; then
if [[ "${TRAVIS_TAG}" == "${ROOT_POM_VERSION}" ]]; then
echo "" && echo "=== RC release ===" && echo ""
export IS_A_RELEASE="true"
else
echo "" && echo "=== Warning: GIT tag format differs from the pom file version. ===" && echo ""
echo -e "Github tag name: ${TRAVIS_TAG}\nPom file version: ${ROOT_POM_VERSION}.\nThe build is not going to be released !!!"
export IS_A_RELEASE="false"
fi
else
echo "Warning: package(s) version is in the wrong format for DEVELOPMENT or RC release. Expecting: d.d.d(-SNAPSHOT){1} or d.d.d(-RC[0-9]+){1}. The build is not going to be released !!!"
export IS_A_RELEASE="false"
fi

if [ "${IS_A_RELEASE}" = "true" ]; then
echo "" && echo "=== Development release ===" && echo ""

export PROD_RELEASE="false"
export IS_A_GH_PRERELEASE="true"
fi
Expand Down
17 changes: 14 additions & 3 deletions doc/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,18 @@ Following endpoints are available on EON node:

#### Forge stakes management:

[/transaction/makeForgerStake](/doc/api/transaction/makeForgerStake.md)\
[/transaction/spendForgingStake](/doc/api/transaction/spendForgingStake.md)\
[/transaction/allForgingStakes](/doc/api/transaction/allForgingStakes.md)\
[/transaction/myForgingStakes](/doc/api/transaction/myForgingStakes.md)
[/transaction/myForgingStakes](/doc/api/transaction/myForgingStakes.md)\
[/transaction/pagedForgersStakesByForger](/doc/api/transaction/pagedForgersStakesByForger.md)\
[/transaction/pagedForgersStakesByDelegator](/doc/api/transaction/pagedForgersStakesByDelegator.md)\
[/transaction/registerForger](/doc/api/transaction/registerForger.md)\
[/transaction/updateForger](/doc/api/transaction/updateForger.md)

Deprecated methods:

[/transaction/pagedForgingStakes](/doc/api/transaction/pagedForgingStakes.md)\
[/transaction/makeForgerStake](/doc/api/transaction/makeForgerStake.md)\
[/transaction/spendForgingStake](/doc/api/transaction/spendForgingStake.md)

#### Restricted forgers management:

Expand Down Expand Up @@ -97,3 +105,6 @@ Following endpoints are available on EON node:
[/node/blacklistedPeers](/doc/api/node/blacklistedPeers.md)\
[/node/stop](/doc/api/node/stop.md)

## Metrics endpoints
[/metrics](/doc/api/metrics/index.md)

46 changes: 46 additions & 0 deletions doc/api/metrics/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[&lt; EON API Documentation](/doc/api/index.md)
### metrics

Returns metrics about this node in Prometheus format.

**Parameters**

No parameters

**Example request**

curl -sX POST 'http://127.0.0.1:9085/metrics' -H 'Content-Type: application/json' -H 'accept: application/json'

**Response**

The metrics will be exposed one line per metric, in this format:

```
metric_id value
```

Available metrics:

Following metrics will be available (also listed in the endpoint /metrics/help):

- **block_apply_time**<br>
Time to apply block to node wallet and state (milliseconds)
- **block_apply_time_fromslotstart**<br>
Delta between timestamp when block has been applied successfully on this node and start timestamp of the slot it belongs to (milliseconds)
- **block_applied_ok**<br>
Number of received blocks applied successfully (absolute value since start of the node)
- **block_applied_ko**<br>
Number of received blocks not applied (absolute value since start of the node)
- **mempool_size**<br>
Mempool size (number of transactions in this node mempool)
- **forge_block_count**<br>
Number of forged blocks by this node (absolute value since start of the node)
- **forge_lottery_time**<br>
Time to execute the lottery (milliseconds)
- **forge_blockcreation_time**<br>
Time to create a new forged block (calculated from the start timestamp of the slot it belongs to) (milliseconds)





4 changes: 1 addition & 3 deletions doc/api/transaction/allForgingStakes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Returns all forging stakes.
{
"result" : {
"stakes" : [ {
"stakeId" : "15f8f1054ae53bd707078248ce44d434b975dbdd250af65b21b6be4b4e601021",
"forgerStakeData" : {
"forgerPublicKeys" : {
"blockSignPublicKey" : {
Expand All @@ -30,7 +29,6 @@ Returns all forging stakes.
"stakedAmount" : 1000000000000000000
}
}, {
"stakeId" : "f62dcc5facc6440d6da2f7b927c6440e9bcb643817a12bf733e5304cd655ecd9",
"forgerStakeData" : {
"forgerPublicKeys" : {
"blockSignPublicKey" : {
Expand All @@ -41,7 +39,7 @@ Returns all forging stakes.
}
},
"ownerPublicKey" : {
"address" : "62b1bc6fd237b775138d910274ff2911d7aea5cc"
"address" : "138d910274ff29162b1bc6fd237b7751d7aea5cc"
},
"stakedAmount" : 99000000000000000000
}
Expand Down
6 changes: 3 additions & 3 deletions doc/api/transaction/getKeysOwnerScAddresses.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[&lt; EON API Documentation](/doc/api/index.md)
### transaction/getKeysOwnerScAddresses

Return the list of all EON sidechain addresses that have at least one mainchain associated.\
This function is used for voting pourposes in ZENDAO.
Returns the list of all EON sidechain addresses that have at least one mainchain address associated.\
This function is used for voting purposes in ZENDAO.

**Parameters**

Expand All @@ -17,4 +17,4 @@ No parameter needed.

{
"owners": ["<eon_address1>", "<eon_address2>", ...]
}
}
4 changes: 2 additions & 2 deletions doc/api/transaction/getKeysOwnership.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
### transaction/getKeysOwnership

Return the list of Horizen mainchain addresses associated to a given EON sidechain addres.\
This function is used for voting pourposes in ZENDAO.
This function is used for voting purposes in ZENDAO.

**Parameters**

Expand All @@ -22,4 +22,4 @@ This function is used for voting pourposes in ZENDAO.
"keysOwnership": {
"<sidechain address>": ["<mainchain_address1>", "<mainchain_address2>", ...]
}
}
}
4 changes: 4 additions & 0 deletions doc/api/transaction/makeForgerStake.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
Creates and signs a transaction to create a forger stake.\
Can be performed by both the forger and by other delegators.

> [!IMPORTANT]
> This endpoint is deprecated and disabled from EON 1.4.0.
> Same action will be possible through the native smart contract method delegate on [ForgerStakesV2](/doc/nativesc/contracts/ForgerStakesV2.md)
**Parameters**

See request body below.
Expand Down
4 changes: 1 addition & 3 deletions doc/api/transaction/myForgingStakes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Returns the forging stakes belonging to keys contained in the node wallet.
{
"result" : {
"stakes" : [ {
"stakeId" : "15f8f1054ae53bd707078248ce44d434b975dbdd250af65b21b6be4b4e601021",
"forgerStakeData" : {
"forgerPublicKeys" : {
"blockSignPublicKey" : {
Expand All @@ -30,7 +29,6 @@ Returns the forging stakes belonging to keys contained in the node wallet.
"stakedAmount" : 1000000000000000000
}
}, {
"stakeId" : "f62dcc5facc6440d6da2f7b927c6440e9bcb643817a12bf733e5304cd655ecd9",
"forgerStakeData" : {
"forgerPublicKeys" : {
"blockSignPublicKey" : {
Expand All @@ -41,7 +39,7 @@ Returns the forging stakes belonging to keys contained in the node wallet.
}
},
"ownerPublicKey" : {
"address" : "62b1bc6fd237b775138d910274ff2911d7aea5cc"
"address" : "5138d910274ff2962b1bc6fd237b7711d7aea5cc"
},
"stakedAmount" : 99000000000000000000
}
Expand Down
2 changes: 1 addition & 1 deletion doc/api/transaction/openForgerList.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ When the majority of the closed forgers have voted to open forging, everyone wil
| Name | Type | Required | Description |
| -------- | ------- | ------- | ------- |
| forgerIndex | integer | yes | Index (0-based) of the forger that is voting, referred to the allowed forgers list in the configuration file. Forger's keys of the voter must be present in the local wallet. |
| nonce | integer | no | Nonce associated to the address that is sending the tx. If omitted the next valid nonce will be calculated automatically. |
| nonce | integer | no | Nonce associated to the address that is sending the tx. If omitted, the latest nonce saved in the state will be used by default. |
| gasInfo | object | no | Info about GAS |

Parameters of the gasInfo object:
Expand Down
55 changes: 55 additions & 0 deletions doc/api/transaction/pagedForgersStakesByDelegator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[&lt; EON API Documentation](/doc/api/index.md)
### transaction/pagedForgerStakesByDelegator

Returns the paginated list of forging stakes, filtered by a specific delegator.<br>
Available from: EON 1.4.0

**Parameters**

| Name | Type | Required | Description |
| -------- | ------- | ------- | ------- |
| delegatorAddress | address | yes | Address of the delegator |
| startPos | integer | no (default 0) | Start position in the paginated list |
| size | integer | no (default 10)| Number of records to return |

**Example request**

curl -sX POST 'http://127.0.0.1:9085/transaction/pagedForgerStakesByDelegator' -H 'Content-Type: application/json' -H 'accept: application/json' -d <requestBody>

The request body format is like this:

{
"delegatorAddress": "62b1bc6fd237b775138d910274ff2911d7aea5cc",
"startPos": 0,
"size": 10
}


**Example response**

{
"result" : {
"nextPos": 10,
"stakes" : [ {
"forgerPublicKeys" : {
"blockSignPublicKey" : {
"publicKey" : "10e9b5236a56cddb9f0332e9dd6d69151494f24172b26ab24a27473bbc92a181"
},
"vrfPublicKey" : {
"publicKey" : "6a376f8a88b386f69296baa0792641d393c85a19b28dfd4a11d8f0a74618873280"
}
},
"stakedAmount" : 1000000000000000000
}, {
"forgerPublicKeys" : {
"blockSignPublicKey" : {
"publicKey" : "4172b26ab24a27473bbc910e9b5236a56cddb9f0332e9dd6d69151494f22a181"
},
"vrfPublicKey" : {
"publicKey" : "aa0792641d393c85a19b28dfd4a6a376f8a88b386f69296b11d8f0a74618873280"
}
},
"stakedAmount" : 99000000000000000000
}]
}
}
Loading

0 comments on commit efb06c8

Please sign in to comment.