Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #702 from radixdlt/feature/NODE-393-fork-olympia-r…
Browse files Browse the repository at this point in the history
…pf-001

Add mainnet candidate fork olympia-rpf-001
  • Loading branch information
dhedey authored Jun 27, 2022
2 parents 87d52ac + 7c7c3e0 commit d66a496
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@

import static com.radixdlt.constraintmachine.REInstruction.REMicroOp.MSG;

import com.google.common.collect.ImmutableSet;
import com.google.inject.AbstractModule;
import com.google.inject.multibindings.ProvidesIntoSet;
import com.radixdlt.application.system.FeeTable;
Expand All @@ -78,6 +79,7 @@
import com.radixdlt.application.validators.state.ValidatorMetaData;
import com.radixdlt.application.validators.state.ValidatorOwnerCopy;
import com.radixdlt.application.validators.state.ValidatorRegisteredCopy;
import com.radixdlt.statecomputer.forks.CandidateForkConfig;
import com.radixdlt.statecomputer.forks.ForkBuilder;
import com.radixdlt.statecomputer.forks.RERulesConfig;
import com.radixdlt.statecomputer.forks.RERulesVersion;
Expand Down Expand Up @@ -155,4 +157,45 @@ ForkBuilder olympia() {
100, // 100 max validators
MSG.maxLength()));
}

@ProvidesIntoSet
ForkBuilder olympiaRadixProtocolFork1() {
return new ForkBuilder(
"olympia-rpf-001",
ImmutableSet.of(new CandidateForkConfig.Threshold((short) 8500, 320)),
14493,
15224,
RERulesVersion.OLYMPIA_V1,
new RERulesConfig(
RESERVED_SYMBOLS,
Pattern.compile("[a-z0-9]+"), // Token symbol pattern
FeeTable.create(
Amount.ofNanoTokens(116400), // 0.0001164XRD per byte fee
Map.of(
TokenResource.class, Amount.ofMilliTokens(58220), // 58.22XRD per resource
ValidatorRegisteredCopy.class,
Amount.ofMilliTokens(2911), // 2.911XRD per validator update
ValidatorFeeCopy.class,
Amount.ofMilliTokens(2911), // 2.911XRD per register update
ValidatorOwnerCopy.class,
Amount.ofMilliTokens(2911), // 2.911XRD per register update
ValidatorMetaData.class,
Amount.ofMilliTokens(2911), // 2.911XRD per register update
AllowDelegationFlag.class,
Amount.ofMilliTokens(2911), // 2.911XRD per register update
PreparedStake.class, Amount.ofMicroTokens(291100), // 0.2911XRD per stake
PreparedUnstakeOwnership.class,
Amount.ofMicroTokens(291100) // 0.2911XRD per unstake
)),
(long) 1024 * 1024, // 1MB max user transaction size
OptionalInt.of(50), // 50 Txns per round
10_000, // Rounds per epoch
500, // Validator fee increases take effect after 500 epochs (roughly two weeks)
Amount.ofTokens(90), // 90XRD Minimum stake
500, // Unstakes are unlocked after 500 epochs without changes (roughly two weeks)
Amount.ofMilliTokens(1797), // 1.797XRD Rewards per proposal
9800, // 98.00% threshold for completed proposals to get any rewards
100, // 100 max validators
MSG.maxLength()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@

import static com.radixdlt.constraintmachine.REInstruction.REMicroOp.MSG;

import com.google.common.collect.ImmutableSet;
import com.google.inject.AbstractModule;
import com.google.inject.multibindings.ProvidesIntoSet;
import com.radixdlt.application.system.FeeTable;
Expand All @@ -78,6 +79,7 @@
import com.radixdlt.application.validators.state.ValidatorMetaData;
import com.radixdlt.application.validators.state.ValidatorOwnerCopy;
import com.radixdlt.application.validators.state.ValidatorRegisteredCopy;
import com.radixdlt.statecomputer.forks.CandidateForkConfig;
import com.radixdlt.statecomputer.forks.ForkBuilder;
import com.radixdlt.statecomputer.forks.RERulesConfig;
import com.radixdlt.statecomputer.forks.RERulesVersion;
Expand Down Expand Up @@ -155,4 +157,45 @@ ForkBuilder releasenetV2() {
100, // 100 max validators
MSG.maxLength()));
}

@ProvidesIntoSet
ForkBuilder olympiaRadixProtocolFork1() {
return new ForkBuilder(
"rlsnet-rpf-001",
ImmutableSet.of(new CandidateForkConfig.Threshold((short) 8500, 2)),
11420,
15000,
RERulesVersion.OLYMPIA_V1,
new RERulesConfig(
RESERVED_SYMBOLS,
Pattern.compile("[a-z0-9]+"), // Token symbol pattern
FeeTable.create(
Amount.ofNanoTokens(116400), // 0.0001164XRD per byte fee
Map.of(
TokenResource.class, Amount.ofMilliTokens(58220), // 58.22XRD per resource
ValidatorRegisteredCopy.class,
Amount.ofMilliTokens(2911), // 2.911XRD per validator update
ValidatorFeeCopy.class,
Amount.ofMilliTokens(2911), // 2.911XRD per register update
ValidatorOwnerCopy.class,
Amount.ofMilliTokens(2911), // 2.911XRD per register update
ValidatorMetaData.class,
Amount.ofMilliTokens(2911), // 2.911XRD per register update
AllowDelegationFlag.class,
Amount.ofMilliTokens(2911), // 2.911XRD per register update
PreparedStake.class, Amount.ofMicroTokens(291100), // 0.2911XRD per stake
PreparedUnstakeOwnership.class,
Amount.ofMicroTokens(291100) // 0.2911XRD per unstake
)),
(long) 1024 * 1024, // 1MB max user transaction size
OptionalInt.of(50), // 50 Txns per round
10_000, // Rounds per epoch
500, // Validator fee increases take effect after 500 epochs (roughly two weeks)
Amount.ofTokens(90), // 90XRD Minimum stake
500, // Unstakes are unlocked after 500 epochs without changes (roughly two weeks)
Amount.ofMilliTokens(1797), // 1.797XRD Rewards per proposal
9800, // 98.00% threshold for completed proposals to get any rewards
100, // 100 max validators
MSG.maxLength()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public static Amount ofMicroTokens(long units) {
UInt256.from(units).multiply(UInt256.TEN.pow(TokenUtils.SUB_UNITS_POW_10 - 6)));
}

public static Amount ofNanoTokens(long units) {
return new Amount(
UInt256.from(units).multiply(UInt256.TEN.pow(TokenUtils.SUB_UNITS_POW_10 - 9)));
}

public static Amount ofTokens(long units) {
return new Amount(UInt256.from(units).multiply(TokenUtils.SUB_UNITS));
}
Expand Down

0 comments on commit d66a496

Please sign in to comment.