Skip to content
Merged
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 @@ -5,36 +5,33 @@ package org.lfdecentralizedtrust.splice.setup

import cats.data.EitherT
import cats.implicits.catsSyntaxOptionId
import org.lfdecentralizedtrust.splice.environment.{
BaseLedgerConnection,
DarResource,
ParticipantAdminConnection,
RetryFor,
RetryProvider,
}
import org.lfdecentralizedtrust.splice.identities.NodeIdentitiesDump
import com.digitalasset.canton.SynchronizerAlias
import com.digitalasset.canton.config.RequireTypes.PositiveInt
import com.digitalasset.canton.logging.{NamedLoggerFactory, NamedLogging}
import com.digitalasset.canton.topology.{ParticipantId, PartyId, SynchronizerId, UniqueIdentifier}
import com.digitalasset.canton.topology.store.TopologyStoreId
import com.digitalasset.canton.topology.transaction.{
HostingParticipant,
ParticipantPermission,
PartyToParticipant,
TopologyChangeOp,
}
import com.digitalasset.canton.topology.{ParticipantId, PartyId, SynchronizerId, UniqueIdentifier}
import com.digitalasset.canton.tracing.TraceContext
import com.google.protobuf.ByteString
import io.grpc.Status
import org.lfdecentralizedtrust.splice.environment.{
BaseLedgerConnection,
ParticipantAdminConnection,
RetryFor,
}
import org.lfdecentralizedtrust.splice.identities.NodeIdentitiesDump

import scala.concurrent.{ExecutionContextExecutor, Future}

class ParticipantPartyMigrator(
connection: BaseLedgerConnection,
participantAdminConnection: ParticipantAdminConnection,
decentralizedSynchronizerAlias: SynchronizerAlias,
retryProvider: RetryProvider,
override val loggerFactory: NamedLoggerFactory,
)(implicit
ec: ExecutionContextExecutor,
Expand All @@ -47,7 +44,6 @@ class ParticipantPartyMigrator(
ledgerApiUser: String,
synchronizerAlias: SynchronizerAlias,
getAcsSnapshot: PartyId => Future[ByteString],
requiredDars: Seq[DarResource] = Seq.empty,
overridePartiesToMigrate: Option[Seq[PartyId]],
): Future[Unit] = {
for {
Expand Down Expand Up @@ -97,7 +93,7 @@ class ParticipantPartyMigrator(
case None =>
logger.info(s"Importing ACS for party ids $partiesToMigrateFinal from scan")
for {
_ <- importAcs(partiesToMigrateFinal, getAcsSnapshot, requiredDars)
_ <- importAcs(partiesToMigrateFinal, getAcsSnapshot)
_ <- connection.ensureUserHasPrimaryParty(ledgerApiUser, validatorPartyId)
} yield ()
}
Expand Down Expand Up @@ -343,25 +339,8 @@ class ParticipantPartyMigrator(
private def importAcs(
partyIds: Seq[PartyId],
getAcsSnapshot: PartyId => Future[ByteString],
requiredDars: Seq[DarResource],
): Future[Unit] = {
for {
// dars are uploaded async during the init phase
_ <- retryProvider.waitUntil(
RetryFor.WaitingOnInitDependency,
"dars_uploaded",
"Required dars are uploaded",
participantAdminConnection.listDars().map { dars =>
val availablePackageIds = dars.map(_.mainPackageId)
if (!requiredDars.forall(dar => availablePackageIds.contains(dar.packageId)))
throw Status.FAILED_PRECONDITION
.withDescription(
s"Required dars $requiredDars are not yet available"
)
.asRuntimeException()
},
logger,
)
_ <- participantAdminConnection.disconnectFromAllDomains()
_ <- Future.traverse(partyIds) { partyId =>
for {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ class ValidatorApp(
override def packagesForJsonDecoding =
super.packagesForJsonDecoding ++ DarResources.wallet.all ++ DarResources.amuletNameService.all ++ DarResources.dsoGovernance.all

def packagesForUploading =
super.packagesForJsonDecoding ++ DarResources.wallet.all ++ DarResources.amuletNameService.all

override def preInitializeBeforeLedgerConnection()(implicit
traceContext: TraceContext
): Future[Unit] = for {
Expand Down Expand Up @@ -298,7 +295,6 @@ class ValidatorApp(
connection,
participantAdminConnection,
config.domains.global.alias,
retryProvider,
loggerFactory,
)
appInitStep("Migrating party data") {
Expand All @@ -319,10 +315,6 @@ class ValidatorApp(
logger,
retryProvider,
),
Seq(
DarResources.amulet.bootstrap,
DarResources.amuletNameService.bootstrap,
),
partiesToMigrate.map(_.map(party => PartyId.tryFromProtoPrimitive(party))),
)
} yield ()
Expand Down
1 change: 1 addition & 0 deletions docs/src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Release Notes

- Expose token-standard endpoints on the validator scan-proxy. The paths are the normal token standard path with a ``/api/validator/v0/scan-proxy`` prefix.
- Fix a bug where transfers using transfer pre-approvals (both through the wallet UI and automatic via sweeps) were broken until the DARs released in 0.4.0 are effective.
- Fix a bug that requires the latest dars to be uploaded when `re-onboarding a validator and recovering the balances of all the users <https://dev.global.canton.network.digitalasset.com/validator_operator/validator_disaster_recovery.html#re-onboard-a-validator-and-recover-balances-of-all-users-it-hosts>`_

- Sequencer

Expand Down
Loading