Skip to content

Commit

Permalink
Update Splice from CCI (#228)
Browse files Browse the repository at this point in the history
Signed-off-by: DA Automation <[email protected]>
Co-authored-by: DA Automation <[email protected]>
  • Loading branch information
canton-network-da and DA Automation authored Feb 17, 2025
1 parent 6f7908e commit 5a1c5ee
Show file tree
Hide file tree
Showing 64 changed files with 1,230 additions and 180,590 deletions.
2 changes: 1 addition & 1 deletion LATEST_RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.10
0.3.11
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.11
0.3.12
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ canton {
user = ${?CANTON_DB_USER}
password = "supersafe"
password = ${?CANTON_DB_PASSWORD}
tcpKeepAlive = true
}
}
parameters {
Expand Down
1 change: 1 addition & 0 deletions apps/app/src/pack/examples/splitwell/splitwell.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ canton {
user = ${?CANTON_DB_USER}
password = "supersafe"
password = ${?CANTON_DB_PASSWORD}
tcpKeepAlive = true
}
}
parameters {
Expand Down
13 changes: 9 additions & 4 deletions apps/app/src/pack/examples/sv-helm/sv-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ participantAddress: "participant-MIGRATION_ID"
# Please make the ``global-domain-sequencer`` service accessible for other validators to subscribe to, and set the URL below to your sequencer service.
# Make sure your cluster's ingress is correctly configured for the sequencer service and can be accessed through the provided URL.
# Replace MIGRATION_ID with the migration ID of the global synchronizer.
#DOCS_PRUNING_START
domain:
sequencerAddress: "global-domain-MIGRATION_ID-sequencer"
mediatorAddress: "global-domain-MIGRATION_ID-mediator"
sequencerPublicUrl: "https://sequencer-MIGRATION_ID.sv.YOUR_HOSTNAME"
sequencerAvailabilityDelay: "60 seconds"
sequencerPruningConfig:
# Enable or disable sequencer pruning
enabled: true
# The pruning interval is the time between two consecutive prunings.
pruningInterval: "1 hour"
# The retention period is the time for which the sequencer will retain the data.
retentionPeriod: "30 days"
#DOCS_PRUNING_END
sequencerAddress: "global-domain-MIGRATION_ID-sequencer"
mediatorAddress: "global-domain-MIGRATION_ID-mediator"
sequencerPublicUrl: "https://sequencer-MIGRATION_ID.sv.YOUR_HOSTNAME"
sequencerAvailabilityDelay: "60 seconds"

# Please make the ``scan`` service `publicUrl` accessible for other validators to read from, and set the URL below to your Scan service.
# Make sure your cluster's ingress is correctly configured for Scan and can be accessed through the provided URL.
Expand Down
2 changes: 2 additions & 0 deletions apps/app/src/test/resources/include/canton-basic.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include required("storage-postgres.conf")

canton {
features = {
enable-testing-commands = yes
Expand Down
11 changes: 1 addition & 10 deletions apps/app/src/test/resources/include/scans/_scan.conf
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
{
include required("../splice-instance-names.conf")
storage = ${_shared.storage}
storage {
type = postgres
config {
dataSourceClass = "org.postgresql.ds.PGSimpleDataSource"
properties = {
serverName = "localhost"
serverName = ${?POSTGRES_HOST}
portNumber = "5432"
portNumber = ${?POSTGRES_PORT}
databaseName = "splice_apps"
user = "canton"
user = ${?POSTGRES_USER}
password = "supersafe"
password = ${?POSTGRES_PASSWORD}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
providerSplitwellBackend {
include required("../scan-client")
storage = ${_shared.storage}
storage {
type = postgres
config {
dataSourceClass = "org.postgresql.ds.PGSimpleDataSource"
properties = {
serverName = "localhost"
serverName = ${?POSTGRES_HOST}
portNumber = "5432"
portNumber = ${?POSTGRES_PORT}
databaseName = "splice_apps"
user = "canton"
user = ${?POSTGRES_USER}
password = "supersafe"
password = ${?POSTGRES_PASSWORD}
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions apps/app/src/test/resources/include/storage-postgres.conf
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Visit the advanced configuration example for further details on this shared persistence configuration
_shared {
storage {
type = postgres
config {
dataSourceClass = "org.postgresql.ds.PGSimpleDataSource"
properties = {
serverName = "localhost"
serverName = ${?CANTON_DB_HOST}
serverName = ${?POSTGRES_HOST}
portNumber = "5432"
portNumber = ${?CANTON_DB_PORT}
user = "postgres"
user = ${?CANTON_DB_USER}
password = "postgres"
password = ${?CANTON_DB_PASSWORD}
portNumber = ${?POSTGRES_PORT}
user = "canton"
user = ${?POSTGRES_USER}
password = "supersafe"
password = ${?POSTGRES_PASSWORD}
tcpKeepAlive = true
}
}
parameters {
# The following is an educated guess of a sane default for the number of DB connections.
# https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing
max-connections = 64
max-connections = 8
}
}
}
11 changes: 1 addition & 10 deletions apps/app/src/test/resources/include/svs/_sv.conf
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
{
include required("../splice-instance-names.conf")
storage = ${_shared.storage}
storage {
type = postgres
config {
dataSourceClass = "org.postgresql.ds.PGSimpleDataSource"
properties = {
serverName = "localhost"
serverName = ${?POSTGRES_HOST}
portNumber = "5432"
portNumber = ${?POSTGRES_PORT}
databaseName = "splice_apps"
user = "canton"
user = ${?POSTGRES_USER}
password = "supersafe"
password = ${?POSTGRES_PASSWORD}
}
}
}
Expand Down
11 changes: 1 addition & 10 deletions apps/app/src/test/resources/include/validators/_validator.conf
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
{
storage = ${_shared.storage}
storage {
type = postgres
config {
dataSourceClass = "org.postgresql.ds.PGSimpleDataSource"
properties = {
serverName = "localhost"
serverName = ${?POSTGRES_HOST}
portNumber = "5432"
portNumber = ${?POSTGRES_PORT}
databaseName = "splice_apps"
user = "canton"
user = ${?POSTGRES_USER}
password = "supersafe"
password = ${?POSTGRES_PASSWORD}
}
}
}
Expand Down
12 changes: 2 additions & 10 deletions apps/app/src/test/resources/local-sv-node/scan-app/app.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include required("../../include/storage-postgres.conf")
_scan_participant_client {
admin-api = {
address = "0.0.0.0"
Expand All @@ -21,20 +22,11 @@ canton {
sv1ScanLocal {
include required("../../include/splice-instance-names.conf")

storage = ${_shared.storage}
storage {
type = postgres
config {
dataSourceClass = "org.postgresql.ds.PGSimpleDataSource"
properties = {
serverName = "localhost"
serverName = ${?POSTGRES_HOST}
portNumber = "5432"
portNumber = ${?POSTGRES_PORT}
databaseName = "splice_apps"
user = "canton"
user = ${?POSTGRES_USER}
password = "supersafe"
password = ${?POSTGRES_PASSWORD}
}
}
}
Expand Down
12 changes: 2 additions & 10 deletions apps/app/src/test/resources/local-sv-node/sv-app/app.conf
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
include required("../../include/storage-postgres.conf")
_sv {
include required("../../include/splice-instance-names.conf")
storage = ${_shared.storage}
storage {
type = postgres
config {
dataSourceClass = "org.postgresql.ds.PGSimpleDataSource"
properties = {
serverName = "localhost"
serverName = ${?POSTGRES_HOST}
portNumber = "5432"
portNumber = ${?POSTGRES_PORT}
databaseName = "splice_apps"
user = "canton"
user = ${?POSTGRES_USER}
password = "supersafe"
password = ${?POSTGRES_PASSWORD}
}
}
}
Expand Down
12 changes: 2 additions & 10 deletions apps/app/src/test/resources/local-sv-node/validator-app/app.conf
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
include required("../../include/storage-postgres.conf")
canton {
validator-apps {
sv1ValidatorLocal {
storage = ${_shared.storage}
storage {
type = postgres
config {
dataSourceClass = "org.postgresql.ds.PGSimpleDataSource"
properties = {
serverName = "localhost"
serverName = ${?POSTGRES_HOST}
portNumber = "5432"
portNumber = ${?POSTGRES_PORT}
databaseName = "splice_apps"
user = "canton"
user = ${?POSTGRES_USER}
password = "supersafe"
password = ${?POSTGRES_PASSWORD}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
include required("../../include/storage-postgres.conf")
canton {
validator-apps {
aliceValidatorLocal {
storage = ${_shared.storage}
storage {
type = postgres
config {
dataSourceClass = "org.postgresql.ds.PGSimpleDataSource"
properties = {
serverName = "localhost"
serverName = ${?POSTGRES_HOST}
portNumber = "5432"
portNumber = ${?POSTGRES_PORT}
databaseName = "splice_apps"
user = "canton"
user = ${?POSTGRES_USER}
password = "supersafe"
password = ${?POSTGRES_PASSWORD}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions apps/app/src/test/resources/minimal-topology-2svs.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include required("include/canton-basic.conf")

canton {
sv-apps {
sv1 { include required("include/svs/sv1") }
Expand Down
2 changes: 2 additions & 0 deletions apps/app/src/test/resources/minimal-topology.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include required("include/canton-basic.conf")

canton {
sv-apps {
sv1 { include required("include/svs/sv1") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.lfdecentralizedtrust.splice.integration.tests

import com.auth0.jwt.JWT
import com.auth0.jwt.algorithms.Algorithm
import monocle.macros.syntax.lens.*
import org.lfdecentralizedtrust.splice.auth.AuthUtil
import org.lfdecentralizedtrust.splice.codegen.java.splice
import org.lfdecentralizedtrust.splice.codegen.java.splice.validatorlicense.ValidatorLicense
Expand Down Expand Up @@ -54,6 +55,18 @@ class ValidatorIntegrationTest extends IntegrationTest with WalletTestUtil {
)
)
})
.addConfigTransformToFront((_, config) => {
// Set a broken sequencer URL for sv4 to test that validators can still successfully connect.
config
.focus(_.svApps)
.modify(_.updatedWith(InstanceName.tryCreate("sv4")) {
_.map(
_.focus(_.localSynchronizerNode).modify(
_.map(_.focus(_.sequencer.externalPublicApiUrl).replace("http://example.com"))
)
)
})
})

"start and restart cleanly" in { implicit env =>
initDsoWithSv1Only()
Expand Down Expand Up @@ -99,6 +112,7 @@ class ValidatorIntegrationTest extends IntegrationTest with WalletTestUtil {

"validator apps connect to all DSO sequencers" in { implicit env =>
initDso()

// Start Alice’s validator
aliceValidatorBackend.startSync()

Expand All @@ -111,12 +125,11 @@ class ValidatorIntegrationTest extends IntegrationTest with WalletTestUtil {
)
.value
.sequencerConnections

sequencerConnections.connections.size shouldBe 4
sequencerConnections.sequencerTrustThreshold shouldBe PositiveInt.tryCreate(2)
sequencerConnections.submissionRequestAmplification shouldBe SubmissionRequestAmplification(
PositiveInt.tryCreate(2),
NonNegativeFiniteDuration.ofSeconds(10),
NonNegativeFiniteDuration.ofSeconds(5),
)
}
}
Expand Down
32 changes: 16 additions & 16 deletions apps/common/frontend/src/contexts/LedgerApiContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,30 +100,30 @@ export class LedgerApiClient {
);
const command = {
ExerciseCommand: {
template_id: choice.template().templateId,
contract_id: contractId,
templateId: choice.template().templateId,
contractId: contractId,
choice: choice.choiceName,
choice_argument: choice.argumentEncode(argument),
choiceArgument: choice.argumentEncode(argument),
},
};

const body = {
commands: [command],
workflow_id: '',
application_id: '',
command_id: uuidv4(),
deduplication_period: { Empty: {} },
act_as: actAs,
read_as: readAs,
submission_id: '',
disclosed_contracts: disclosedContracts.map(c => ({
workflowId: '',
applicationId: '',
commandId: uuidv4(),
deduplicationPeriod: { Empty: {} },
actAs: actAs,
readAs: readAs,
submissionId: '',
disclosedContracts: disclosedContracts.map(c => ({
contractId: c.contractId,
createdEventBlob: c.createdEventBlob,
domainId: '',
templateId: c.templateId,
})),
domain_id: domainId || '',
package_id_selection_preference: [],
domainId: domainId || '',
packageIdSelectionPreference: [],
};

const describeChoice = `Exercised choice: actAs=${JSON.stringify(
Expand All @@ -150,10 +150,10 @@ export class LedgerApiClient {
throw e;
});

const tree = responseBody.transaction_tree;
const rootEvent = tree.events_by_id[tree.root_event_ids[0]];
const tree = responseBody.transactionTree;
const rootEvent = tree.eventsById[tree.rootEventIds[0]];
const exerciseResult = choice.resultDecoder.runWithException(
rootEvent.ExercisedTreeEvent.exercise_result
rootEvent.ExercisedTreeEvent.exerciseResult
);
return exerciseResult;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ class MediatorAdminConnection(
MediatorAdministrationCommands.Initialize(
domainId,
SequencerConnections.single(sequencerConnection),
// TODO(#10985) Consider enabling this.
SequencerConnectionValidation.Disabled,
SequencerConnectionValidation.StrictActive,
)
)

Expand Down
Loading

0 comments on commit 5a1c5ee

Please sign in to comment.