Skip to content
Open
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 @@ -58,7 +58,6 @@ import com.digitalasset.canton.time.Clock
import com.digitalasset.canton.tracing.TraceContext
import com.digitalasset.canton.util.ErrorUtil
import io.circe.syntax.EncoderOps
import io.grpc.Status
import io.opentelemetry.api.trace.Tracer
import org.apache.pekko.stream.Materializer
import org.lfdecentralizedtrust.splice.config.{NetworkAppClientConfig, UpgradesConfig}
Expand Down Expand Up @@ -110,29 +109,18 @@ class HttpSvAdminHandler(

// Similar to PublishScanConfigTrigger, this class creates its own scan connection
// on demand, because scan might not be available at application startup.
private def createScanConnection(): Future[ScanConnection] =
config.scan match {
case None =>
Future.failed(
Status.UNAVAILABLE
.withDescription(
"This application is not configured to connect to a scan service. " +
" Check the application configuration or use the scan API to query votes information."
)
.asRuntimeException()
)
case Some(scanConfig) =>
implicit val tc: TraceContext = TraceContext.empty
ScanConnection
.singleUncached(
ScanAppClientConfig(NetworkAppClientConfig(scanConfig.internalUrl)),
upgradesConfig,
clock,
retryProvider,
loggerFactory,
retryConnectionOnInitialFailure = true,
)
}
private def createScanConnection(): Future[ScanConnection] = {
implicit val tc: TraceContext = TraceContext.empty
ScanConnection
.singleUncached(
ScanAppClientConfig(NetworkAppClientConfig(config.scan.internalUrl)),
upgradesConfig,
clock,
retryProvider,
loggerFactory,
retryConnectionOnInitialFailure = true,
)
}
@SuppressWarnings(Array("org.wartremover.warts.Var"))
private var scanConnectionV: Option[Future[ScanConnection]] = None
private def scanConnectionF: Future[ScanConnection] = blocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,17 +368,15 @@ class SvDsoAutomationService(
)
)

config.scan.foreach { scan =>
registerTrigger(
new PublishScanConfigTrigger(
triggerContext,
dsoStore,
connection(SpliceLedgerConnectionPriority.Low),
scan,
upgradesConfig,
)
registerTrigger(
new PublishScanConfigTrigger(
triggerContext,
dsoStore,
connection(SpliceLedgerConnectionPriority.Low),
config.scan,
upgradesConfig,
)
}
)

config.followAmuletConversionRateFeed.foreach { c =>
registerTrigger(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import scala.concurrent.{ExecutionContextExecutor, Future}
class SequencerPruningTrigger(
override protected val context: TriggerContext,
store: SvDsoStore,
scanConfig: Option[SvScanConfig],
scanConfig: SvScanConfig,
upgradesConfig: UpgradesConfig,
sequencerAdminConnection: SequencerAdminConnection,
mediatorAdminConnection: MediatorAdminConnection,
Expand All @@ -65,27 +65,15 @@ class SequencerPruningTrigger(
private def createScanConnection()(implicit
tc: TraceContext
): Future[BackfillingScanConnection] =
scanConfig match {
case None =>
Future.failed(
Status.UNAVAILABLE
.withDescription(
"This application is not configured to connect to a scan service. " +
" Check the application configuration or use the scan API to query votes information."
)
.asRuntimeException()
)
case Some(scanConfig) =>
ScanConnection
.singleUncached(
ScanAppClientConfig(NetworkAppClientConfig(scanConfig.internalUrl)),
upgradesConfig,
clock,
context.retryProvider,
loggerFactory,
retryConnectionOnInitialFailure = true,
)
}
ScanConnection
.singleUncached(
ScanAppClientConfig(NetworkAppClientConfig(scanConfig.internalUrl)),
upgradesConfig,
clock,
context.retryProvider,
loggerFactory,
retryConnectionOnInitialFailure = true,
)

override def performWorkIfAvailable()(implicit traceContext: TraceContext): Future[Boolean] =
for {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ case class SvAppBackendConfig(
initialAmuletPriceVote: Option[BigDecimal] = None,
cometBftConfig: Option[SvCometBftConfig] = None,
localSynchronizerNode: Option[SvSynchronizerNodeConfig],
scan: Option[SvScanConfig],
scan: SvScanConfig,
participantBootstrappingDump: Option[ParticipantBootstrapDumpConfig] = None,
identitiesDump: Option[BackupDumpConfig] = None,
domainMigrationDumpPath: Option[Path] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,15 @@ class SynchronizerNodeReconciler(
synchronizerId: SynchronizerId,
state: SynchronizerNodeState,
migrationId: Long,
scan: Option[SvScanConfig],
scanConfig: SvScanConfig,
)(implicit
ec: ExecutionContext,
tc: TraceContext,
): Future[Unit] = {
def setConfigIfRequired() = for {
localSequencerConfig <- SvUtil.getSequencerConfig(synchronizerNode, migrationId)
localMediatorConfig <- SvUtil.getMediatorConfig(synchronizerNode)
localScanConfig = scan
.map(scanConfig => new ScanConfig(scanConfig.publicUrl.toString()))
.toJava
localScanConfig = java.util.Optional.of(new ScanConfig(scanConfig.publicUrl.toString()))
rulesAndState <- dsoStore.getDsoRulesWithSvNodeState(svParty)
nodeState = rulesAndState.svNodeState.payload
// TODO(DACH-NY/canton-network-node#4901): do not use default, but reconcile all configured domains
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ object SvUtil {
def getSV1SynchronizerNodeConfig(
cometBftNode: Option[CometBftNode],
localSynchronizerNode: LocalSynchronizerNode,
scanConfig: Option[SvScanConfig],
scanConfig: SvScanConfig,
synchronizerId: SynchronizerId,
clock: Clock,
migrationId: Long,
Expand Down Expand Up @@ -234,7 +234,7 @@ object SvUtil {
cometBftConfig,
sequencerConfig.toJava,
mediatorConfig.toJava,
scanConfig.map(c => new ScanConfig(c.publicUrl.toString())).toJava,
Optional.of(new ScanConfig(scanConfig.publicUrl.toString())),
Optional.empty(),
)
).asJava
Expand Down
4 changes: 3 additions & 1 deletion cluster/helm/splice-sv-node/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"defaultJvmOptions",
"domain",
"imageRepo",
"scan",
"nodeIdentifier",
"onboardingName",
"persistence",
Expand Down Expand Up @@ -287,7 +288,8 @@
"internalUrl": {
"type": "string"
}
}
},
"required": ["publicUrl", "internalUrl"]
},
"nodeIdentifier": {
"type": "string"
Expand Down
8 changes: 7 additions & 1 deletion docs/src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ Upcoming

- Published conversion rates are now clamped to the configured range and the clamped value is published instead of
only logging a warning and not publishing an updated value for out of range values.

- The SV app will no longer store the update history and such, will not be able to answer historical queries.
All updates involving the DSO party will still be stored and returned by Scan.

- Deployment

- The helm values under ``scan``, that is ``publicUrl`` and ``internalUrl`` are now mandatory.
All SVs already deploy scan on DevNet, TestNet and MainNet so this should have no impact.


0.4.20
------

Expand Down