Skip to content

Commit

Permalink
[main] Update 2024-09-11.06 (#222)
Browse files Browse the repository at this point in the history
Reference commit: b25a89eaed

Co-authored-by: Canton <[email protected]>
  • Loading branch information
canton-machine and Canton authored Sep 11, 2024
1 parent 6fa7435 commit 37f1308
Show file tree
Hide file tree
Showing 290 changed files with 4,687 additions and 4,615 deletions.
4 changes: 4 additions & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Canton CANTON_VERSION has been released on RELEASE_DATE. You can download the Daml Open Source edition from the Daml Connect [Github Release Section](https://github.com/digital-asset/daml/releases/tag/vCANTON_VERSION). The Enterprise edition is available on [Artifactory](https://digitalasset.jfrog.io/artifactory/canton-enterprise/canton-enterprise-CANTON_VERSION.zip).
Please also consult the [full documentation of this release](https://docs.daml.com/CANTON_VERSION/canton/about.html).

## Until 2024-09-06 (Exclusive)

- Console.bootstrap.domain has new parameter domainThreshold, the minimum number of domain owners that need to authorize on behalf of the domain's namespace.

## Until 2024-09-04 (Exclusive)

- google.protobuf.XValue wrapper messages are replaced by `optional X` in the protobuf definitions. Incompatibility for manually crafted Protobuf messages and wire formats. Protobuf bindings must be regenerated, but should remain compatible.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ trait CantonConfig {
adminWorkflow = participantParameters.adminWorkflow,
maxUnzippedDarSize = participantParameters.maxUnzippedDarSize,
stores = participantParameters.stores,
transferTimeProofFreshnessProportion =
participantParameters.transferTimeProofFreshnessProportion,
reassignmentTimeProofFreshnessProportion =
participantParameters.reassignmentTimeProofFreshnessProportion,
protocolConfig = ParticipantProtocolConfig(
minimumProtocolVersion = participantParameters.minimumProtocolVersion.map(_.unwrap),
alphaVersionSupport = participantParameters.alphaVersionSupport,
Expand Down Expand Up @@ -518,7 +518,6 @@ private[canton] object CantonNodeParameterConverter {
nonStandardConfig = parent.parameters.nonStandardConfig,
dbMigrateAndStart = node.storage.parameters.migrateAndStart,
exitOnFatalFailures = parent.parameters.exitOnFatalFailures,
useUnifiedSequencer = node.parameters.useUnifiedSequencer,
watchdog = node.parameters.watchdog,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ trait ConsoleMacros extends NamedLogging with NoTracing {
)
def decentralized_namespace(
owners: Seq[InstanceReference],
threshold: PositiveInt,
store: String = AuthorizedStore.filterName,
): (Namespace, Seq[GenericSignedTopologyTransaction]) = {
val ownersNE = NonEmpty
Expand All @@ -685,7 +686,7 @@ trait ConsoleMacros extends NamedLogging with NoTracing {
existingDnsO.getOrElse(
owner.topology.decentralized_namespaces.propose_new(
owners.map(_.namespace).toSet,
PositiveInt.tryCreate(1.max(owners.size - 1)),
threshold,
store = store,
)
)
Expand Down Expand Up @@ -818,12 +819,17 @@ trait ConsoleMacros extends NamedLogging with NoTracing {
domainName: String,
staticDomainParameters: data.StaticDomainParameters,
domainOwners: Seq[InstanceReference],
domainThreshold: PositiveInt,
sequencers: Seq[SequencerReference],
mediatorsToSequencers: Map[MediatorReference, Seq[SequencerReference]],
mediatorRequestAmplification: SubmissionRequestAmplification,
): DomainId = {
val (decentralizedNamespace, foundingTxs) =
bootstrap.decentralized_namespace(domainOwners, store = AuthorizedStore.filterName)
bootstrap.decentralized_namespace(
domainOwners,
domainThreshold,
store = AuthorizedStore.filterName,
)

val domainId = DomainId(
UniqueIdentifier.tryCreate(domainName, decentralizedNamespace.toProtoPrimitive)
Expand Down Expand Up @@ -919,7 +925,8 @@ trait ConsoleMacros extends NamedLogging with NoTracing {
domainName: String,
sequencers: Seq[SequencerReference],
mediators: Seq[MediatorReference],
domainOwners: Seq[InstanceReference] = Seq.empty,
domainOwners: Seq[InstanceReference],
domainThreshold: PositiveInt,
staticDomainParameters: data.StaticDomainParameters,
mediatorRequestAmplification: SubmissionRequestAmplification =
SubmissionRequestAmplification.NoAmplification,
Expand All @@ -929,6 +936,7 @@ trait ConsoleMacros extends NamedLogging with NoTracing {
sequencers,
mediators.map(_ -> sequencers).toMap,
domainOwners,
domainThreshold,
staticDomainParameters,
mediatorRequestAmplification,
)
Expand All @@ -942,6 +950,7 @@ trait ConsoleMacros extends NamedLogging with NoTracing {
sequencers: Seq[SequencerReference],
mediatorsToSequencers: Map[MediatorReference, Seq[SequencerReference]],
domainOwners: Seq[InstanceReference],
domainThreshold: PositiveInt,
staticDomainParameters: data.StaticDomainParameters,
mediatorRequestAmplification: SubmissionRequestAmplification,
): DomainId = {
Expand All @@ -965,6 +974,7 @@ trait ConsoleMacros extends NamedLogging with NoTracing {
domainName,
staticDomainParameters,
domainOwnersOrDefault,
domainThreshold,
uniqueSequencers,
mediatorsToSequencers,
mediatorRequestAmplification,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import com.digitalasset.canton.console.{
SequencerReference,
}
import com.digitalasset.canton.crypto.SyncCryptoApiProvider
import com.digitalasset.canton.data.CantonTimestamp
import com.digitalasset.canton.data.{CantonTimestamp, CantonTimestampSecond}
import com.digitalasset.canton.discard.Implicits.DiscardOps
import com.digitalasset.canton.grpc.{ByteStringStreamObserver, FileStreamObserver}
import com.digitalasset.canton.logging.{NamedLoggerFactory, NamedLogging, TracedLogger}
Expand Down Expand Up @@ -701,6 +701,13 @@ class LocalCommitmentsAdministrationGroup(
timestampFromInstant(endAtOrBefore),
)
}

def lastComputedAndSent(
domain: DomainAlias
): Option[CantonTimestampSecond] =
access { node =>
node.sync.stateInspection.findLastComputedAndSent(domain)
}
}

class CommitmentsAdministrationGroup(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ bootstrap.domain(
sequencers = Seq(sequencer1),
mediators = Seq(mediator1),
domainOwners = Seq(sequencer1, mediator1),
domainThreshold = PositiveInt.two,
staticDomainParameters = StaticDomainParameters.defaultsWithoutKMS(ProtocolVersion.latest),
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Composability tutorial part 1 - auto transfers section
// Composability tutorial part 1 - auto reassignments section

// create the domains
val iouAlias = "iou"
Expand All @@ -10,6 +10,7 @@ val iouId = bootstrap.domain(
sequencers = Seq(iou_sequencer),
mediators = Seq(iou_mediator),
domainOwners = Seq(iouDomainOwner),
domainThreshold = PositiveInt.one,
staticDomainParameters = StaticDomainParameters.defaultsWithoutKMS(ProtocolVersion.latest),
)

Expand All @@ -19,6 +20,7 @@ val paintId = bootstrap.domain(
sequencers = Seq(paint_sequencer),
mediators = Seq(paint_mediator),
domainOwners = Seq(paintDomainOwner),
domainThreshold = PositiveInt.one,
staticDomainParameters = StaticDomainParameters.defaultsWithoutKMS(ProtocolVersion.latest),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ val iouId = bootstrap.domain(
sequencers = Seq(iou_sequencer),
mediators = Seq(iou_mediator),
domainOwners = Seq(iouDomainOwner),
domainThreshold = PositiveInt.one,
staticDomainParameters = StaticDomainParameters.defaultsWithoutKMS(ProtocolVersion.latest),
)

Expand All @@ -21,6 +22,7 @@ val paintId = bootstrap.domain(
sequencers = Seq(paint_sequencer),
mediators = Seq(paint_mediator),
domainOwners = Seq(paintDomainOwner),
domainThreshold = PositiveInt.one,
staticDomainParameters = StaticDomainParameters.defaultsWithoutKMS(ProtocolVersion.latest),
)

Expand Down Expand Up @@ -95,18 +97,18 @@ val Seq(paintOffer) = decodeAllCreated(OfferToPaintHouseByOwner.COMPANION)(
participant2.ledger_api.javaapi.commands.submit_flat(Seq(HouseOwner), paintOfferCmd, domainId = Some(paintId)))
// architecture-handbook-entry-end: paint-offer

// architecture-handbook-entry-begin: transfer
// architecture-handbook-entry-begin: reassignment
// Wait until the painter sees the paint offer in the active contract store
participant3.ledger_api.state.acs.await_active_contract(Painter, paintOffer.id.toLf)

// Painter transfers the paint offer to the IOU domain
// Painter reassigns the paint offer to the IOU domain
participant3.ledger_api.commands.submit_reassign(
Painter, // Initiator of the transfer
paintOffer.id.toLf, // Contract to be transferred
Painter, // Initiator of the reassignment
paintOffer.id.toLf, // Contract to be reassigned
paintId, // Source domain
iouId // Target domain
)
// architecture-handbook-entry-end: transfer
// architecture-handbook-entry-end: reassignment

// architecture-handbook-entry-begin: accept
// Painter accepts the paint offer on the IOU domain
Expand All @@ -116,7 +118,7 @@ val Seq(painterIou) = decodeAllCreated(Iou.COMPANION)(acceptTx)
val Seq(paintHouse) = decodeAllCreated(PaintHouse.COMPANION)(acceptTx)
// architecture-handbook-entry-end: accept

// architecture-handbook-entry-begin: transfer-back
// architecture-handbook-entry-begin: reassignment-back
// Wait until the house owner sees the PaintHouse agreement
participant2.ledger_api.state.acs.await_active_contract(HouseOwner, paintHouse.id.toLf)

Expand All @@ -127,7 +129,7 @@ participant2.ledger_api.commands.submit_reassign(
iouId,
paintId
)
// architecture-handbook-entry-end: transfer-back
// architecture-handbook-entry-end: reassignment-back

// architecture-handbook-entry-begin: call
// Painter converts the Iou into cash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ val iouId = bootstrap.domain(
sequencers = Seq(iou_sequencer),
mediators = Seq(iou_mediator),
domainOwners = Seq(iouDomainOwner),
domainThreshold = PositiveInt.one,
staticDomainParameters = StaticDomainParameters.defaultsWithoutKMS(ProtocolVersion.latest),
)

Expand All @@ -20,6 +21,7 @@ val paintId = bootstrap.domain(
sequencers = Seq(paint_sequencer),
mediators = Seq(paint_mediator),
domainOwners = Seq(paintDomainOwner),
domainThreshold = PositiveInt.one,
staticDomainParameters = StaticDomainParameters.defaultsWithoutKMS(ProtocolVersion.latest),
)

Expand Down Expand Up @@ -119,10 +121,10 @@ val Seq(paintOffer) = decodeAllCreated(OfferToPaintHouseByOwner.COMPANION)(
// Wait until the painter sees the paint offer in the active contract store
participant3.ledger_api.state.acs.await_active_contract(Painter, paintOffer.id.toLf)

// Painter transfers the paint offer to the IOU domain
// Painter reasigns the paint offer to the IOU domain
val paintOfferReassignmentId = participant3.ledger_api.commands.submit_unassign(
Painter, // Initiator of the transfer
paintOffer.id.toLf, // Contract to be transferred
Painter, // Initiator of the reassignment
paintOffer.id.toLf, // Contract to be reassigned
paintId, // Source domain
iouId // Target domain
).unassignedEvent.unassignId
Expand Down Expand Up @@ -161,7 +163,7 @@ participant2.ledger_api.commands.submit_unassign(
paintId
)
// After the exclusivity period, which is set to 2 seconds,
// the contract is automatically transferred into the target domain
// the contract is automatically reassigned into the target domain
utils.retry_until_true(10.seconds) {
// in the absence of other activity, force the participants to update their view of the latest domain time
participant2.testing.fetch_domain_times()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ bootstrap.domain(
sequencers = Seq(sequencer1),
mediators = Seq(mediator1),
domainOwners = Seq(sequencer1, mediator1),
domainThreshold = PositiveInt.two,
staticDomainParameters = StaticDomainParameters.defaultsWithoutKMS(ProtocolVersion.latest),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class NodesTest extends FixtureAnyWordSpec with BaseTest with HasExecutionContex
override def parameters: LocalNodeParametersConfig = new LocalNodeParametersConfig {
override def batching: BatchingConfig = BatchingConfig()
override def caching: CachingConfigs = CachingConfigs()
override def useUnifiedSequencer: Boolean = testedUseUnifiedSequencer
override def alphaVersionSupport: Boolean = false
override def watchdog: Option[WatchdogConfig] = None
}
Expand All @@ -110,7 +109,6 @@ class NodesTest extends FixtureAnyWordSpec with BaseTest with HasExecutionContex
dontWarnOnDeprecatedPV: Boolean = false,
initialProtocolVersion: ProtocolVersion = testedProtocolVersion,
exitOnFatalFailures: Boolean = true,
useUnifiedSequencer: Boolean = testedUseUnifiedSequencer,
watchdog: Option[WatchdogConfig] = None,
) extends CantonNodeParameters

Expand Down Expand Up @@ -220,10 +218,7 @@ class NodesTest extends FixtureAnyWordSpec with BaseTest with HasExecutionContex
new CommunityDbMigrationsFactory(loggerFactory),
timeouts,
configs,
_ =>
MockedNodeParameters.cantonNodeParameters(
_useUnifiedSequencer = testedUseUnifiedSequencer
),
_ => MockedNodeParameters.cantonNodeParameters(),
startUpGroup = 0,
NodesTest.this.loggerFactory,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package com.digitalasset.canton.integration.tests
import com.digitalasset.canton.DomainAlias
import com.digitalasset.canton.admin.api.client.data.{NodeStatus, WaitingForInitialization}
import com.digitalasset.canton.config.CommunityStorageConfig
import com.digitalasset.canton.config.RequireTypes.PositiveInt
import com.digitalasset.canton.console.{CommandFailure, InstanceReference}
import com.digitalasset.canton.integration.CommunityTests.{
CommunityIntegrationTest,
Expand Down Expand Up @@ -49,6 +50,7 @@ sealed trait EnterpriseFeatureInCommunityIntegrationTest
Seq(sequencer1),
Seq(mediator1),
Seq[InstanceReference](sequencer1, mediator1),
PositiveInt.two,
staticDomainParameters = CommunityEnvironmentDefinition.defaultStaticDomainParameters,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ abstract class ExampleIntegrationTest(configPaths: File*)
CommunityConfigTransforms.updateAllParticipantConfigs { case (_, config) =>
// to make sure that the picked up time for the snapshot is the most recent one
config
.focus(_.parameters.transferTimeProofFreshnessProportion)
.focus(_.parameters.reassignmentTimeProofFreshnessProportion)
.replace(NonNegativeInt.zero)
},
CommunityConfigTransforms.uniquePorts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package com.digitalasset.canton.integration.tests

import com.digitalasset.canton.admin.api.client.data.{NodeStatus, WaitingForInitialization}
import com.digitalasset.canton.config.CommunityStorageConfig
import com.digitalasset.canton.config.RequireTypes.PositiveInt
import com.digitalasset.canton.console.InstanceReference
import com.digitalasset.canton.integration.CommunityTests.{
CommunityIntegrationTest,
Expand Down Expand Up @@ -46,6 +47,7 @@ sealed trait SimplestPingCommunityIntegrationTest
Seq(sequencer1),
Seq(mediator1),
Seq[InstanceReference](sequencer1, mediator1),
PositiveInt.two,
staticDomainParameters = CommunityEnvironmentDefinition.defaultStaticDomainParameters,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ service SequencerAuthenticationService {
message SequencerAuthentication {
message ChallengeRequest {
string member = 1;
repeated string member_protocol_versions = 2;
repeated int32 member_protocol_versions = 2;
}

message ChallengeResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,27 @@ service SequencerConnectService {
}

message SequencerConnect {
// Messages for performing a version handshake with a sequencer service
// Reused between sequencer services
// IMPORTANT: changing the version handshakes can lead to issues with upgrading domains - be very careful
// when changing the handshake message format
message HandshakeRequest {
com.digitalasset.canton.protocol.v30.Handshake.Request handshake_request = 1;
repeated int32 client_protocol_versions = 1;
optional int32 minimum_protocol_version = 2;
}

message HandshakeResponse {
com.digitalasset.canton.protocol.v30.Handshake.Response handshake_response = 1;
int32 server_protocol_version = 1;
oneof value {
Success success = 2;
Failure failure = 3;
}

message Success {}

message Failure {
string reason = 1;
}
}

message GetDomainIdRequest {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,6 @@ message ServiceAgreement {
string legal_text = 2;
}

// Messages for performing a version handshake with a sequencer service
// Reused between sequencer services
// IMPORTANT: changing the version handshakes can lead to issues with upgrading domains - be very careful
// when changing the handshake message format
message Handshake {
message Request {
repeated string client_protocol_versions = 1;
optional string minimum_protocol_version = 2;
}

message Response {
string server_protocol_version = 1;
oneof value {
Success success = 2;
Failure failure = 3;
}
}

message Success {}

message Failure {
string reason = 1;
}
}

// Messages used for synchronization between sequencer nodes

// Submission cost computed by the sender for a SubmissionRequest
Expand Down
Loading

0 comments on commit 37f1308

Please sign in to comment.