|
1 | 1 | package org.lfdecentralizedtrust.splice.integration.tests |
2 | 2 |
|
3 | | -import com.digitalasset.canton.admin.api.client.data.PruningSchedule |
4 | | -import org.lfdecentralizedtrust.splice.config.{ |
5 | | - ConfigTransforms, |
6 | | - ParticipantClientConfig, |
7 | | - PruningConfig, |
8 | | -} |
| 3 | +import org.lfdecentralizedtrust.splice.config.{ConfigTransforms, ParticipantClientConfig} |
9 | 4 | import org.lfdecentralizedtrust.splice.console.ValidatorAppBackendReference |
10 | 5 | import org.lfdecentralizedtrust.splice.sv.automation.singlesv.SequencerPruningTrigger |
11 | 6 | import org.lfdecentralizedtrust.splice.sv.config.SequencerPruningConfig |
12 | 7 | import org.lfdecentralizedtrust.splice.util.{ProcessTestUtil, WalletTestUtil} |
13 | 8 | import org.lfdecentralizedtrust.splice.validator.automation.ReconcileSequencerConnectionsTrigger |
14 | 9 | import com.digitalasset.canton.config.CantonRequireTypes.InstanceName |
15 | | -import com.digitalasset.canton.config.{ |
16 | | - FullClientConfig, |
17 | | - NonNegativeFiniteDuration, |
18 | | - PositiveDurationSeconds, |
19 | | -} |
| 10 | +import com.digitalasset.canton.config.{FullClientConfig, NonNegativeFiniteDuration} |
20 | 11 | import com.digitalasset.canton.config.RequireTypes.Port |
21 | 12 | import com.digitalasset.canton.logging.SuppressionRule |
22 | 13 | import com.digitalasset.canton.util.ShowUtil.* |
23 | | -import org.lfdecentralizedtrust.splice.store.AppStoreWithIngestion.SpliceLedgerConnectionPriority.Low |
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,79 +52,31 @@ class PruningIntegrationTest |
62 | 52 | )(config), |
63 | 53 | (_, config) => |
64 | 54 | config.copy( |
65 | | - // reduce it so that the test hits 2 acs commitments intervals |
66 | | - // as pruning can be done only up to the end of the latest complete acs commitment interval |
67 | | - svApps = config.svApps.updatedWith(InstanceName.tryCreate("sv1")) { |
68 | | - _.map { config => |
69 | | - config.copy(acsCommitmentReconciliationInterval = |
70 | | - PositiveDurationSeconds.ofSeconds(30) |
71 | | - ) |
72 | | - } |
73 | | - }, |
74 | | - validatorApps = |
75 | | - config.validatorApps.updatedWith(InstanceName.tryCreate("sv1Validator")) { |
76 | | - _.map { config => |
77 | | - config.copy( |
78 | | - // schedule needs to be defined to activate participant pruning |
79 | | - participantPruningSchedule = Some( |
80 | | - PruningConfig( |
81 | | - "0 /1 * * * ?", |
82 | | - PositiveDurationSeconds.tryFromDuration(10.seconds), |
83 | | - PositiveDurationSeconds.tryFromDuration(20.seconds), |
84 | | - ) |
85 | | - ) |
86 | | - ) |
87 | | - } |
88 | | - } + ( |
89 | | - InstanceName.tryCreate("bobValidatorLocal") -> { |
90 | | - val bobValidatorConfig = config |
91 | | - .validatorApps(InstanceName.tryCreate("bobValidator")) |
92 | | - bobValidatorConfig |
93 | | - .copy( |
94 | | - participantClient = ParticipantClientConfig( |
95 | | - FullClientConfig(port = Port.tryCreate(5902)), |
96 | | - bobValidatorConfig.participantClient.ledgerApi.copy( |
97 | | - clientConfig = |
98 | | - bobValidatorConfig.participantClient.ledgerApi.clientConfig.copy( |
99 | | - port = Port.tryCreate(5901) |
100 | | - ) |
101 | | - ), |
| 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 | + ) |
102 | 68 | ), |
103 | | - // We disable the ReconcileSequencerConnectionsTrigger to prevent domain disconnections |
104 | | - // from interfering with traffic top-ups (see #14474) |
105 | | - automation = bobValidatorConfig.automation |
106 | | - .withPausedTrigger[ReconcileSequencerConnectionsTrigger], |
107 | | - ) |
108 | | - } |
109 | | - ), |
| 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 | + ) |
110 | 77 | ), |
111 | 78 | ) |
112 | 79 |
|
113 | | - "participant can be pruned" should { |
114 | | - |
115 | | - "when configured, sv1 participant prunes every minute" in { implicit env => |
116 | | - initDsoWithSv1Only() |
117 | | - |
118 | | - clue("Check sv1 participant has the expected smallest pruning schedule") { |
119 | | - sv1ValidatorBackend.participantClient.pruning.get_schedule() shouldBe Some( |
120 | | - PruningSchedule( |
121 | | - "0 /1 * * * ?", |
122 | | - PositiveDurationSeconds.tryFromDuration(10.seconds), |
123 | | - PositiveDurationSeconds.tryFromDuration(20.seconds), |
124 | | - ) |
125 | | - ) |
126 | | - } |
127 | | - |
128 | | - eventually(2.minutes) { |
129 | | - sv1Backend.svAutomation |
130 | | - .connection(Low) |
131 | | - // returns 0 when participant pruning is disabled |
132 | | - .latestPrunedOffset() |
133 | | - .futureValue should be > 0L |
134 | | - } |
135 | | - } |
136 | | - } |
137 | | - |
138 | 80 | "sequencer can be pruned even if a participant is down" in { implicit env => |
139 | 81 | clue("Initialize DSO with 2 SVs") { |
140 | 82 | startAllSync( |
@@ -197,5 +139,4 @@ class PruningIntegrationTest |
197 | 139 | timeUntilSuccess = 3.minutes, |
198 | 140 | ) |
199 | 141 | } |
200 | | - |
201 | 142 | } |
0 commit comments