Skip to content
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 @@ -809,6 +809,9 @@ object ConfigTransforms {
): ConfigTransform =
updateAllSvAppFoundDsoConfigs_(c => c.copy(initialRewardConfig = Some(rewardConfig)))

def withFeaturedAppMarkers: ConfigTransform =
updateAllSvAppFoundDsoConfigs_(c => c.copy(initialRewardConfig = None))

private def portTransform(bump: Int, c: AdminServerConfig): AdminServerConfig =
c.copy(internalPort = c.internalPort.map(_ + bump))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class BatchedFeaturedAppActivityMarkerIntegrationTest
override def environmentDefinition: SpliceEnvironmentDefinition =
EnvironmentDefinition
.simpleTopology1Sv(this.getClass.getSimpleName)
// Uses FeaturedAppMarkers: test exercises the FeaturedAppActivityMarker mechanism
.addConfigTransform((_, config) => ConfigTransforms.withFeaturedAppMarkers(config))
.addConfigTransforms((_, config) =>
ConfigTransforms.updateAutomationConfig(ConfigTransforms.ConfigurableApp.Sv)(
_.withPausedTrigger[FeaturedAppActivityMarkerTrigger]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class ExternalPartySetupProposalIntegrationTest
override def environmentDefinition: EnvironmentDefinition = {
EnvironmentDefinition
.simpleTopology1Sv(this.getClass.getSimpleName)
// Uses FeaturedAppMarkers: test asserts on AppRewardCoupon which TBAR replaces with RewardCouponV2
.addConfigTransform((_, config) => ConfigTransforms.withFeaturedAppMarkers(config))
.addConfigTransforms(
// set renewal duration to be same as pre-approval lifetime to ensure renewal
// gets triggered immediately
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class FeaturedAppActivityMarkerIntegrationTest
EnvironmentDefinition
// Using 4Svs so that we see whether they manage to jointly complete all work
.simpleTopology4Svs(this.getClass.getSimpleName)
// Uses FeaturedAppMarkers: test exercises the FeaturedAppActivityMarker mechanism
.addConfigTransform((_, config) => ConfigTransforms.withFeaturedAppMarkers(config))
.addConfigTransforms((_, config) =>
ConfigTransforms.updateAllSvAppFoundDsoConfigs_(
_.copy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.lfdecentralizedtrust.splice.integration.tests
import com.digitalasset.canton.SynchronizerAlias
import org.lfdecentralizedtrust.splice.codegen.java.splice.splitwell as splitwellCodegen
import org.lfdecentralizedtrust.splice.codegen.java.splice.wallet.payment as walletCodegen
import org.lfdecentralizedtrust.splice.config.ConfigTransforms
import org.lfdecentralizedtrust.splice.integration.EnvironmentDefinition
import org.lfdecentralizedtrust.splice.integration.tests.SpliceTests.IntegrationTest
import org.lfdecentralizedtrust.splice.splitwell.automation.AcceptedAppPaymentRequestsTrigger
Expand All @@ -20,6 +21,8 @@ class SplitwellIntegrationTest
override def environmentDefinition: SpliceEnvironmentDefinition =
EnvironmentDefinition
.simpleTopology1Sv(this.getClass.getSimpleName)
// Uses FeaturedAppMarkers: test asserts on AppRewardCoupon which TBAR replaces with RewardCouponV2
.addConfigTransform((_, config) => ConfigTransforms.withFeaturedAppMarkers(config))
.withAdditionalSetup(implicit env => {
aliceValidatorBackend.participantClient.upload_dar_unless_exists(splitwellDarPath)
bobValidatorBackend.participantClient.upload_dar_unless_exists(splitwellDarPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ class SvExpiredRewardsCollectionTimeBasedIntegrationTest
with SvTestUtil {

override def environmentDefinition =
super.environmentDefinition.addConfigTransform((_, config) =>
ConfigTransforms.updateAllValidatorConfigs_(
// Bump lifetime above base duration to burn fees and generate validator rewards
_.focus(_.transferPreapproval.preapprovalLifetime)
.replace(NonNegativeFiniteDuration.ofDays(100))
)(config)
)
super.environmentDefinition
// Uses FeaturedAppMarkers: test asserts on AppRewardCoupon which TBAR replaces with RewardCouponV2
.addConfigTransform((_, config) => ConfigTransforms.withFeaturedAppMarkers(config))
.addConfigTransform((_, config) =>
ConfigTransforms.updateAllValidatorConfigs_(
// Bump lifetime above base duration to burn fees and generate validator rewards
_.focus(_.transferPreapproval.preapprovalLifetime)
.replace(NonNegativeFiniteDuration.ofDays(100))
)(config)
)

"collect expired reward coupons" in { implicit env =>
def getRewardCoupons(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import org.lfdecentralizedtrust.splice.codegen.java.splice.api.token.{
holdingv1,
metadatav1,
}
import org.lfdecentralizedtrust.splice.config.ConfigTransforms
import org.lfdecentralizedtrust.splice.environment.DarResources
import org.lfdecentralizedtrust.splice.integration.EnvironmentDefinition
import org.lfdecentralizedtrust.splice.integration.tests.SpliceTests.{
Expand Down Expand Up @@ -55,6 +56,8 @@ class TokenStandardAllocationIntegrationTest
override def environmentDefinition: EnvironmentDefinition = {
EnvironmentDefinition
.simpleTopology1Sv(this.getClass.getSimpleName)
// Uses FeaturedAppMarkers: test asserts on AppRewardCoupon which TBAR replaces with RewardCouponV2
.addConfigTransform((_, config) => ConfigTransforms.withFeaturedAppMarkers(config))
.withAdditionalSetup(implicit env => {
Seq(
sv1ValidatorBackend,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ class UnsupportedPackageVettingIntegrationTest
sv1Backend.participantClient.synchronizers.list_connected().head.synchronizerId

val validatorDarsAbovePackageConfigVersion = Seq(
DarResources.wallet_0_1_18,
DarResources.walletPayments_0_1_17,
DarResources.amuletNameService_0_1_18,
DarResources.amulet_0_1_17,
DarResources.wallet_0_1_21,
DarResources.walletPayments_0_1_20,
DarResources.amuletNameService_0_1_21,
DarResources.amulet_0_1_20,
)
val svDarsAbovePackageConfigVersion = Seq(
DarResources.dsoGovernance_0_1_23
DarResources.dsoGovernance_0_1_26
) ++ validatorDarsAbovePackageConfigVersion

clue("sv1 votes to downgrade to the previous package versions") {
Expand All @@ -149,12 +149,12 @@ class UnsupportedPackageVettingIntegrationTest
AmuletConfigSchedule(amuletRules).getConfigAsOf(env.environment.clock.now)

val downgradedPackageConfig = new PackageConfig(
DarResources.amulet_0_1_16.metadata.version.toString(),
DarResources.amuletNameService_0_1_17.metadata.version.toString(),
DarResources.dsoGovernance_0_1_22.metadata.version.toString(),
DarResources.amulet_0_1_19.metadata.version.toString(),
DarResources.amuletNameService_0_1_20.metadata.version.toString(),
DarResources.dsoGovernance_0_1_25.metadata.version.toString(),
currentConfig.packageConfig.validatorLifecycle,
DarResources.wallet_0_1_17.metadata.version.toString(),
DarResources.walletPayments_0_1_16.metadata.version.toString(),
DarResources.wallet_0_1_20.metadata.version.toString(),
DarResources.walletPayments_0_1_19.metadata.version.toString(),
)
val newAmuletConfig = new AmuletConfig(
currentConfig.transferConfig,
Expand Down Expand Up @@ -198,7 +198,7 @@ class UnsupportedPackageVettingIntegrationTest
) should contain allElementsOf validatorDarsAbovePackageConfigVersion.map(_.packageId)
}
eventually(40.seconds) {
alicesTapsWithPackageId(DarResources.amulet_0_1_16.packageId)
alicesTapsWithPackageId(DarResources.amulet_0_1_19.packageId)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class WalletTxLogIntegrationTest
// The wallet automation periodically merges amulets, which leads to non-deterministic balance changes.
// We disable the automation for this suite.
.withoutAutomaticRewardsCollectionAndAmuletMerging
// Uses FeaturedAppMarkers: test asserts on AppRewardCoupon which TBAR replaces with RewardCouponV2
.addConfigTransform((_, config) => ConfigTransforms.withFeaturedAppMarkers(config))
// Set a non-unit amulet price to better test CC-USD conversion.
.addConfigTransform((_, config) => ConfigTransforms.setAmuletPrice(amuletPrice)(config))
.addConfigTransform((_, config) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class WalletTxLogWithRewardsCollectionTimeBasedIntegrationTest
.simpleTopology1SvWithSimTime(this.getClass.getSimpleName)
// Set a non-unit amulet price to better test CC-USD conversion.
.addConfigTransform((_, config) => ConfigTransforms.setAmuletPrice(amuletPrice)(config))
// Uses FeaturedAppMarkers: test asserts on AppRewardCoupon which TBAR replaces with RewardCouponV2
.addConfigTransform((_, config) => ConfigTransforms.withFeaturedAppMarkers(config))
.addConfigTransforms(
(_, config) =>
// without this, you can have 1 or 2 transfers in the txlog, or just 1 with different balance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ object DarResources {
)
val amulet = PackageResource(
amulet_current,
amulet_0_1_15,
amulet_0_1_19,
Seq(
amulet_0_1_0,
amulet_0_1_1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ trait PackageVersionSupport extends NamedLogging {
now,
DarResources.amulet,
DarResources.amulet_0_1_16,
ignoreRedundantCheck = true,
)

def supports24hSubmissionDelay(
Expand All @@ -96,7 +97,7 @@ trait PackageVersionSupport extends NamedLogging {
now,
DarResources.amulet,
DarResources.amulet_0_1_17,
ignoreRedundantCheck = false,
ignoreRedundantCheck = true,
)
}

Expand Down Expand Up @@ -152,6 +153,7 @@ trait PackageVersionSupport extends NamedLogging {
now,
DarResources.amulet,
DarResources.amulet_0_1_19,
ignoreRedundantCheck = true,
)

def supportsMintingDelegation(parties: Seq[PartyId], now: CantonTimestamp)(implicit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object DarResourcesGenerator {

// TODO(tech-debt): consider moving this to a dedicated config file if it bugs us here
private val minimumInitializations: Map[String, String] = Map(
"splice-amulet" -> "0.1.15",
"splice-amulet" -> "0.1.19",
"splice-amulet-name-service" -> "0.1.16",
"splice-dso-governance" -> "0.1.21",
"splice-wallet" -> "0.1.15",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ object SvOnboardingConfig {
developmentFundManager: Option[PartyId] = None,
initialExternalPartyConfigStateTickDuration: Option[NonNegativeFiniteDuration] = None,
optValidatorFaucetCap: Option[BigDecimal] = None,
initialRewardConfig: Option[InitialRewardConfig] = None,
initialRewardConfig: Option[InitialRewardConfig] = Some(InitialRewardConfig()),
) extends SvOnboardingConfig

case class JoinWithKey(
Expand Down Expand Up @@ -242,7 +242,7 @@ object SvOnboardingConfig {
}

final case class InitialRewardConfig(
mintingVersion: String = "RewardVersion_FeaturedAppMarkers",
mintingVersion: String = "RewardVersion_TrafficBasedAppRewards",
dryRunVersion: Option[String] = None,
batchSize: Long = 100,
rewardCouponTimeToLiveMicros: Long = 36L * 60 * 60 * 1000000, // 36 hours
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ class SV1Initializer(
logger,
),
).tupled
// Wait for the current amulet package to be available for command
// preprocessing. The vetting topology transaction may not yet be
// effective on the participant even though vetCurrentPackages returned.
_ <- initConnection.waitForPackages(
Set(DarResources.amulet_current.packageId)
)
storeKey = SvStore.Key(svParty, dsoParty)
domainMigrationId <- resolveDomainMigrationId(Future.successful(0L))
svStore = newSvStore(
Expand Down
Loading