diff --git a/ledger/ledger-api-client/src/main/scala/com/digitalasset/ledger/client/services/commands/tracker/CommandTracker.scala b/ledger/ledger-api-client/src/main/scala/com/digitalasset/ledger/client/services/commands/tracker/CommandTracker.scala index 6e2b4fdb0af3..3cb31f1ed8fe 100644 --- a/ledger/ledger-api-client/src/main/scala/com/digitalasset/ledger/client/services/commands/tracker/CommandTracker.scala +++ b/ledger/ledger-api-client/src/main/scala/com/digitalasset/ledger/client/services/commands/tracker/CommandTracker.scala @@ -3,10 +3,12 @@ package com.daml.ledger.client.services.commands.tracker +import java.time.{Duration, Instant} + import akka.stream.stage._ import akka.stream.{Attributes, Inlet, Outlet} import com.daml.grpc.{GrpcException, GrpcStatus} -import com.daml.ledger.api.v1.commands.Commands +import com.daml.ledger.api.v1.command_completion_service.Checkpoint import com.daml.ledger.api.v1.completion.Completion import com.daml.ledger.api.v1.ledger_offset.LedgerOffset import com.daml.ledger.client.services.commands.tracker.CommandTracker._ @@ -24,9 +26,6 @@ import com.google.protobuf.empty.Empty import com.google.rpc.status.{Status => StatusProto} import io.grpc.Status import org.slf4j.LoggerFactory -import java.time.{Duration, Instant} - -import com.daml.ledger.api.v1.command_completion_service.Checkpoint import scala.annotation.nowarn import scala.collection.compat._ @@ -255,22 +254,8 @@ private[commands] class CommandTracker[Context]( ) with NoStackTrace } val commandTimeout = submission.value.timeout match { - // The command submission timeout takes precedence. case Some(timeout) => durationOrdering.min(timeout, maximumCommandTimeout) - case None => - commands.deduplicationPeriod match { - // We keep supporting the `deduplication_time` field as the command timeout, - // for historical reasons. - case Commands.DeduplicationPeriod.DeduplicationTime(deduplicationTimeProto) => - val deduplicationTime = Duration.ofSeconds( - deduplicationTimeProto.seconds, - deduplicationTimeProto.nanos.toLong, - ) - durationOrdering.min(deduplicationTime, maximumCommandTimeout) - // All other deduplication periods do not influence the command timeout. - case _ => - maximumCommandTimeout - } + case None => maximumCommandTimeout } val trackingData = TrackingData( commandId = commandId, diff --git a/ledger/ledger-api-client/src/test/suite/scala/com/digitalasset/ledger/client/services/commands/CommandTrackerFlowTest.scala b/ledger/ledger-api-client/src/test/suite/scala/com/digitalasset/ledger/client/services/commands/CommandTrackerFlowTest.scala index 48b71cc9a5b1..95722902acb5 100644 --- a/ledger/ledger-api-client/src/test/suite/scala/com/digitalasset/ledger/client/services/commands/CommandTrackerFlowTest.scala +++ b/ledger/ledger-api-client/src/test/suite/scala/com/digitalasset/ledger/client/services/commands/CommandTrackerFlowTest.scala @@ -29,7 +29,6 @@ import com.daml.ledger.client.services.commands.tracker.CompletionResponse.{ } import com.daml.ledger.client.services.commands.tracker.{CompletionResponse, TrackedCommandKey} import com.daml.util.Ctx -import com.google.protobuf.duration.{Duration => DurationProto} import com.google.protobuf.empty.Empty import com.google.protobuf.timestamp.Timestamp import com.google.rpc.code._ @@ -329,31 +328,6 @@ class CommandTrackerFlowTest succeed } - "use the command deduplication time, if provided" in { - val Handle(submissions, results, _, _) = runCommandTrackingFlow(allSubmissionsSuccessful) - - val deduplicationTime = DurationProto.of(0, 200000000) // 200ms - submissions.sendNext( - Ctx( - context, - CommandSubmission( - Commands( - commandId = commandId, - submissionId = submissionId, - deduplicationPeriod = - Commands.DeduplicationPeriod.DeduplicationTime(deduplicationTime), - ) - ), - ) - ) - - results.expectNext( - 500.milliseconds, - Ctx(context, Left(CompletionResponse.TimeoutResponse(commandId))), - ) - succeed - } - "cap the timeout at the maximum command timeout" in { val Handle(submissions, results, _, _) = runCommandTrackingFlow( allSubmissionsSuccessful,