Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update testnet validation period duration and activation age #2904

Draft
wants to merge 1 commit into
base: remove_similar_isSvpOngoing_method
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,24 @@ public Instant getGenesisFederationCreationTime() {
public long getValidationPeriodDurationInBlocks() { return validationPeriodDurationInBlocks; }

public long getFederationActivationAge(ActivationConfig.ForBlock activations) {
return activations.isActive(ConsensusRule.RSKIP383) ? federationActivationAge : federationActivationAgeLegacy;
if (!activations.isActive(ConsensusRule.RSKIP383)) {
return federationActivationAgeLegacy;
}

if (btcParams.equals(NetworkParameters.fromID(NetworkParameters.ID_TESTNET))) {
return getTestnetFederationActivationAge(activations);
}
return federationActivationAge;
}

private long getTestnetFederationActivationAge(ActivationConfig.ForBlock activations) {
if (!activations.isActive(ConsensusRule.RSKIP419)) {
return federationActivationAge;
}

// after lovell, we have to consider the activation age
// has to be at least the validation period duration
return validationPeriodDurationInBlocks;
}

public long getFundsMigrationAgeSinceActivationBegin() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private FederationTestNetConstants() {
).map(hex -> ECKey.fromPublicOnly(Hex.decode(hex))).collect(Collectors.toList()));
federationChangeAuthorizer = new AddressBasedAuthorizer(federationChangeAuthorizedKeys, AddressBasedAuthorizer.MinimumRequiredCalculation.MAJORITY);

validationPeriodDurationInBlocks = 80L;
validationPeriodDurationInBlocks = 2000L;

federationActivationAgeLegacy = 60L;
federationActivationAge = 120L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void getValidationPeriodDuration(FederationConstants constants, long expectedDur
private static Stream<Arguments> validationPeriodDurationArgs() {
return Stream.of(
Arguments.of(MAINNET, 16000L),
Arguments.of(TESTNET, 80L),
Arguments.of(TESTNET, 2000L),
Arguments.of(REGTEST, 125L)
);
}
Expand Down
Loading