A network upgrade is a change or group of changes to the protocol consensus rules, which are activated at a defined block number.
Every consensus rule change needs to be associated with a specific RSKIP (RSK improvement proposal) in the RSKIPs github repository.
Consensus rules changes are introduced as part of a group of changes called Network Upgrade. Network upgrades are released to the general public as part of a specific RSK node version (defined by a release code name and version number. e.g.: RSK Wasabi 1.0.0), and the consensus rule changes introduced are selected by the community.
NetworkUpgrade
enum file.
public enum NetworkUpgrade {
WASABI_100("wasabi100"),
}
Set the network upgrade block activation height in [main||testnet||regtest||devnet].conf
files
# IE for main.conf
blockchain.config {
name = main
hardforkActivationHeights = {
wasabi100 = 1591000,
}
}
For local development you should ONLY need to edit
regtest.conf
.
[main||testnet||devnet].conf
will only need to be edited before a NetworkUpgrade deploy, when the block activation height is already known.
ConsensusRule
enum file.
public enum ConsensusRule {
RSKIP106("rskip106"),
}
reference.conf
file.
blockchain = {
config = {
consensusRules = {
rskip106 = wasabi100,
}
}
}
When implementing a network upgrade you’ll need to check if that change is active:
if (activations.isActive(ConsensusRule.RSKIP106) && address.equals(HD_WALLET_UTILS_ADDR_DW)) {
return new HDWalletUtils(config.getActivationConfig(), HD_WALLET_UTILS_ADDR);
}
To run tests with specific consensus rules changes, you’ll need to combine previously described methods at ActivationConfigTest.BASE_CONFIG
public class ActivationConfigTest {
private static final Config BASE_CONFIG = ConfigFactory
.parseString(String.join("\n",
"hardforkActivationHeights: {",
" wasabi100: 0",
"},",
"consensusRules: {",
" rskip106: wasabi100,",
"}"
));
}
Go to top