Skip to content

Commit

Permalink
Merge pull request #44 from proximax-storage/v1.7.3-update
Browse files Browse the repository at this point in the history
update: v1.7.3 changes
  • Loading branch information
shinneng authored Jun 19, 2024
2 parents d0b1f4f + da1d3c0 commit d8ca1df
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 75 deletions.
2 changes: 1 addition & 1 deletion docker-api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:

catapult-api-node:
# Downloads Catapult Server from specified Docker repo
image: proximax/proximax-sirius-chain:v1.5.3-bullseye
image: proximax/proximax-sirius-chain:v1.7.3-bullseye
ports:
- 7903:7903
- 7902:7902
Expand Down
10 changes: 9 additions & 1 deletion docker-api/resources/config-network.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ enableUnconfirmedTransactionMinFeeValidation = false
enableUndoBlock = false
enableBlockSync = false

enableWeightedVoting = true
enableWeightedVoting = false
committeeSize = 6
committeeApproval = 0.67
committeePhaseTime = 5s
Expand All @@ -52,6 +52,12 @@ dbrbRegistrationGracePeriod = 30m
enableHarvesterExpiration = true
enableRemovingDbrbProcessOnShutdown = true

enableDbrbSharding = false
dbrbShardSize = 6

enableDbrbFastFinality = true
checkNetworkHeightInterval = 10

[bootstrap.harvesters]

8B1FBE2F65D4AD2EA7A1421109B76CCD13ED2D0F34FCA1F10C93BFA4CC0A5D53 = 80B7F6CC34A5D5C6DF69155F03CD5511BA7128A05261160C060B7FC1D457CBE8
Expand Down Expand Up @@ -202,6 +208,8 @@ minGreedFeeInterestDenominator = 10
activityScaleFactor = 1000000000
weightScaleFactor = 1000000000000000000
enableEqualWeights = true
[plugin:catapult.plugins.dbrb]
enabled = true
Expand Down
2 changes: 2 additions & 0 deletions docker-api/resources/config-node.properties
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ incomingSecurityModes = None
maxCacheDatabaseWriteBatchSize = 5MB
maxTrackedNodes = 5'000

transactionBatchSize = 50

[localnode]

host =
Expand Down
10 changes: 9 additions & 1 deletion docker-api/resources/supported-entities.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
"supportedVersions": [
3,
4,
5
5,
6
]
},
{
Expand Down Expand Up @@ -263,6 +264,13 @@
"supportedVersions": [
1
]
},
{
"name": "replicatorOnboarding",
"type": "18018",
"supportedVersions": [
2
]
}
]
}
10 changes: 9 additions & 1 deletion docker-method/resources/config-network.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ enableUnconfirmedTransactionMinFeeValidation = false
enableUndoBlock = false
enableBlockSync = false

enableWeightedVoting = true
enableWeightedVoting = false
committeeSize = 6
committeeApproval = 0.67
committeePhaseTime = 5s
Expand All @@ -52,6 +52,12 @@ dbrbRegistrationGracePeriod = 30m
enableHarvesterExpiration = true
enableRemovingDbrbProcessOnShutdown = true

enableDbrbSharding = false
dbrbShardSize = 6

enableDbrbFastFinality = true
checkNetworkHeightInterval = 10

[bootstrap.harvesters]

8B1FBE2F65D4AD2EA7A1421109B76CCD13ED2D0F34FCA1F10C93BFA4CC0A5D53 = 80B7F6CC34A5D5C6DF69155F03CD5511BA7128A05261160C060B7FC1D457CBE8
Expand Down Expand Up @@ -202,6 +208,8 @@ minGreedFeeInterestDenominator = 10
activityScaleFactor = 1000000000
weightScaleFactor = 1000000000000000000
enableEqualWeights = true
[plugin:catapult.plugins.dbrb]
enabled = true
Expand Down
2 changes: 2 additions & 0 deletions docker-method/resources/config-node.properties
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ incomingSecurityModes = None
maxCacheDatabaseWriteBatchSize = 5MB
maxTrackedNodes = 5'000

transactionBatchSize = 50

[localnode]

host =
Expand Down
10 changes: 9 additions & 1 deletion docker-method/resources/supported-entities.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
"supportedVersions": [
3,
4,
5
5,
6
]
},
{
Expand Down Expand Up @@ -263,6 +264,13 @@
"supportedVersions": [
1
]
},
{
"name": "replicatorOnboarding",
"type": "18018",
"supportedVersions": [
2
]
}
]
}
2 changes: 1 addition & 1 deletion scripts/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# VARS:
DEFAULT_PATH="/mnt/siriuschain/"
SERVICENAME="mainnet-peer"
SIRIUS_CHAIN_VERSION="release-v1.5.3"
SIRIUS_CHAIN_VERSION="release-v1.7.3"
DOCKERFOLDER='docker-method'
FAILMSG="UPGRADE FAIL"

Expand Down
72 changes: 3 additions & 69 deletions upgrade/README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,10 @@
# Weighted Voting Implementation (Fast Finality)
# Upgrade Notes

## Overview

Currently every harvester node generates a block every 15 seconds on average and builds its own local chain which it synchronizes with other nodes from time to time. This process makes rollbacks inevitable. In order to achieve fast finality properly current chain building is reworked. Every new block is generated by a single selected node, after which the block is confirmed by a committee. After the block is confirmed all nodes add it to their local chains.

## Harvesting Account Registration
Every harvesting account should be registered in blockchain in order to be selected as a committee member.

A new plugin named committee is implemented that stores harvesting account public keys and characteristics in cache. The characteristics are:

1. Activity of the harvesters (initially log(7/3)) is used for the account weight w calculation.

2. The height of last block signing (initially the height at which the account was registered as a harvester).

3. Effective balance of the harvester. The accounts that have insufficient effective balance won’t be elected into the committee.

4. Boolean value indicating whether the harvester is eligible to harvest blocks.

5. Greed of the harvester.

Two transactions for registering/unregistering harvesting accounts are implemented.

These transactions can be created in:
1. `add-harvester-util` (located in harvester folder)
2. [web-wallet](https://web-wallet.xpxsirius.io) (coming soon)


## Upgrading from v0.9.0 to v1.4.2

The Sirius Chain Mainnet will be upgraded to version `v1.4.2` and the network config will be updated at the same time to enable `Weighted Voting`.

`Weighted Voting` keeps the same state of blockchain on every node. On the other hand `NXT based consensus` protocol which is now running in mainnet allows small forks on the tail of the chain which appear all the time and are resolved automatically when the nodes synchronize their local chains with each other. In order to switch to `Weighted Voting` all nodes should run `v0.9.0` until the upgrade height is reached, the nodes will then stop produce new blocks. Then, after all small tail forks are resolved and all the nodes have the same state, the nodes should run `v1.4.2`.

The docker image for Sirius Chain `v1.4.2` will be released to Dockerhub once the network has reached the upgrade height.

There is an `upgrade_util` CLI tool located in the Git repository to assist node owner with the upgrade process.
The `upgrade_util` CLI tool will:
- ask for a directory where the node is installed. Default: /mnt/siriuschain
- ask for a REST server URL. Default: http://aldebaran.xpxsirius.io:3000
- prompt the node owner to update the boot key if the boot key is a multisig or conflicts with the harvesting key
- prompt node owner to register the harvest key in the blockchain if it is not yet registered. In that case the tool will ask for the private key of account on behalf of which the harvest key will be registered, that account will pay transaction fee.
- wait for upgrade chain height and resolving of the tail forks
- stop the sirius chain node
- update the node config

Run the following commands to download and execute the `upgrade_util` CLI:
```bash
wget https://raw.githubusercontent.com/proximax-storage/xpx-mainnet-chain-onboarding/release-v1.4.2/upgrade/upgrade_util
chmod +x ./upgrade_util
./upgrade_util
```

After the tool completes its work successfully, run the following steps:
```
cd resources
curl -O --silent https://raw.githubusercontent.com/proximax-storage/xpx-mainnet-chain-onboarding/release-v1.4.2/docker-method/resources/peers-api.json
curl -O --silent https://raw.githubusercontent.com/proximax-storage/xpx-mainnet-chain-onboarding/release-v1.4.2/docker-method/resources/peers-p2p.json
sed -i "s/^\(minFeeMultiplier\s*=\s*\).*\$/minFeeMultiplier = 140'000/" config-node.properties
```

The above updates the peer files and fee multiplier. In future, the above steps will be included in the `upgrade_util` tool/

Once the post-upgrade configuration steps are done, run the node with command:
```bash
docker-compose up -d
```

## Upgrading to v1.5.3
## Upgrading to v1.7.3

Run the following commands to download and execute the `upgrade.sh` script:
```bash
wget https://raw.githubusercontent.com/proximax-storage/xpx-mainnet-chain-onboarding/release-v1.5.3/scripts/upgrade.sh
wget https://raw.githubusercontent.com/proximax-storage/xpx-mainnet-chain-onboarding/release-v1.7.3/scripts/upgrade.sh
chmod +x ./upgrade.sh
./upgrade.sh
```
Expand Down

0 comments on commit d8ca1df

Please sign in to comment.