|
1 | 1 | package org.lfdecentralizedtrust.splice.integration.tests |
2 | 2 |
|
3 | | -import com.digitalasset.canton.admin.api.client.data.PruningSchedule |
4 | | -import com.digitalasset.canton.config.CantonRequireTypes.InstanceName |
5 | | -import com.digitalasset.canton.config.RequireTypes.Port |
6 | | -import com.digitalasset.canton.config.{ |
7 | | - FullClientConfig, |
8 | | - NonNegativeFiniteDuration, |
9 | | - PositiveDurationSeconds, |
10 | | -} |
11 | | -import com.digitalasset.canton.logging.SuppressionRule |
12 | | -import com.digitalasset.canton.util.ShowUtil.* |
13 | | -import org.lfdecentralizedtrust.splice.config.{ |
14 | | - ConfigTransforms, |
15 | | - ParticipantClientConfig, |
16 | | - PruningConfig, |
17 | | -} |
| 3 | +import org.lfdecentralizedtrust.splice.config.{ConfigTransforms, ParticipantClientConfig} |
18 | 4 | import org.lfdecentralizedtrust.splice.console.ValidatorAppBackendReference |
19 | | -import org.lfdecentralizedtrust.splice.store.AppStoreWithIngestion.SpliceLedgerConnectionPriority.Low |
20 | 5 | import org.lfdecentralizedtrust.splice.sv.automation.singlesv.SequencerPruningTrigger |
21 | 6 | import org.lfdecentralizedtrust.splice.sv.config.SequencerPruningConfig |
22 | 7 | import org.lfdecentralizedtrust.splice.util.{ProcessTestUtil, WalletTestUtil} |
23 | 8 | import org.lfdecentralizedtrust.splice.validator.automation.ReconcileSequencerConnectionsTrigger |
| 9 | +import com.digitalasset.canton.config.CantonRequireTypes.InstanceName |
| 10 | +import com.digitalasset.canton.config.{FullClientConfig, NonNegativeFiniteDuration} |
| 11 | +import com.digitalasset.canton.config.RequireTypes.Port |
| 12 | +import com.digitalasset.canton.logging.SuppressionRule |
| 13 | +import com.digitalasset.canton.util.ShowUtil.* |
24 | 14 | import org.slf4j.event.Level |
25 | 15 |
|
26 | 16 | import scala.concurrent.duration.* |
27 | 17 |
|
28 | | -class PruningIntegrationTest |
| 18 | +class SequencerPruningIntegrationTest |
29 | 19 | extends SvIntegrationTestBase |
30 | 20 | with WalletTestUtil |
31 | 21 | with ProcessTestUtil { |
@@ -62,70 +52,31 @@ class PruningIntegrationTest |
62 | 52 | )(config), |
63 | 53 | (_, config) => |
64 | 54 | config.copy( |
65 | | - validatorApps = |
66 | | - config.validatorApps.updatedWith(InstanceName.tryCreate("sv1Validator")) { |
67 | | - _.map { config => |
68 | | - config.copy( |
69 | | - // schedule needs to be defined to activate participant pruning |
70 | | - participantPruningSchedule = Some( |
71 | | - PruningConfig( |
72 | | - "0 /1 * * * ?", |
73 | | - PositiveDurationSeconds.tryFromDuration(1.seconds), |
74 | | - PositiveDurationSeconds.tryFromDuration(1.seconds), |
75 | | - ) |
76 | | - ) |
77 | | - ) |
78 | | - } |
79 | | - } + ( |
80 | | - InstanceName.tryCreate("bobValidatorLocal") -> { |
81 | | - val bobValidatorConfig = config |
82 | | - .validatorApps(InstanceName.tryCreate("bobValidator")) |
83 | | - bobValidatorConfig |
84 | | - .copy( |
85 | | - participantClient = ParticipantClientConfig( |
86 | | - FullClientConfig(port = Port.tryCreate(5902)), |
87 | | - bobValidatorConfig.participantClient.ledgerApi.copy( |
88 | | - clientConfig = |
89 | | - bobValidatorConfig.participantClient.ledgerApi.clientConfig.copy( |
90 | | - port = Port.tryCreate(5901) |
91 | | - ) |
92 | | - ), |
| 55 | + validatorApps = config.validatorApps + ( |
| 56 | + InstanceName.tryCreate("bobValidatorLocal") -> { |
| 57 | + val bobValidatorConfig = config |
| 58 | + .validatorApps(InstanceName.tryCreate("bobValidator")) |
| 59 | + bobValidatorConfig |
| 60 | + .copy( |
| 61 | + participantClient = ParticipantClientConfig( |
| 62 | + FullClientConfig(port = Port.tryCreate(5902)), |
| 63 | + bobValidatorConfig.participantClient.ledgerApi.copy( |
| 64 | + clientConfig = |
| 65 | + bobValidatorConfig.participantClient.ledgerApi.clientConfig.copy( |
| 66 | + port = Port.tryCreate(5901) |
| 67 | + ) |
93 | 68 | ), |
94 | | - // We disable the ReconcileSequencerConnectionsTrigger to prevent domain disconnections |
95 | | - // from interfering with traffic top-ups (see #14474) |
96 | | - automation = bobValidatorConfig.automation |
97 | | - .withPausedTrigger[ReconcileSequencerConnectionsTrigger], |
98 | | - ) |
99 | | - } |
100 | | - ) |
| 69 | + ), |
| 70 | + // We disable the ReconcileSequencerConnectionsTrigger to prevent domain disconnections |
| 71 | + // from interfering with traffic top-ups (see #14474) |
| 72 | + automation = bobValidatorConfig.automation |
| 73 | + .withPausedTrigger[ReconcileSequencerConnectionsTrigger], |
| 74 | + ) |
| 75 | + } |
| 76 | + ) |
101 | 77 | ), |
102 | 78 | ) |
103 | 79 |
|
104 | | - "participant can be pruned" should { |
105 | | - |
106 | | - "when configured, sv1 participant prunes every minute" in { implicit env => |
107 | | - initDsoWithSv1Only() |
108 | | - |
109 | | - clue("Check sv1 participant has the expected smallest pruning schedule") { |
110 | | - sv1ValidatorBackend.participantClient.pruning.get_schedule() shouldBe Some( |
111 | | - PruningSchedule( |
112 | | - "0 /1 * * * ?", |
113 | | - PositiveDurationSeconds.tryFromDuration(1.seconds), |
114 | | - PositiveDurationSeconds.tryFromDuration(1.seconds), |
115 | | - ) |
116 | | - ) |
117 | | - } |
118 | | - |
119 | | - eventually(timeUntilSuccess = 70.seconds) { |
120 | | - sv1Backend.svAutomation |
121 | | - .connection(Low) |
122 | | - // returns 0 when participant pruning is disabled |
123 | | - .latestPrunedOffset() |
124 | | - .futureValue should be > 0L |
125 | | - } |
126 | | - } |
127 | | - } |
128 | | - |
129 | 80 | "sequencer can be pruned even if a participant is down" in { implicit env => |
130 | 81 | clue("Initialize DSO with 2 SVs") { |
131 | 82 | startAllSync( |
@@ -188,4 +139,5 @@ class PruningIntegrationTest |
188 | 139 | timeUntilSuccess = 3.minutes, |
189 | 140 | ) |
190 | 141 | } |
| 142 | + |
191 | 143 | } |
0 commit comments