Skip to content

Commit

Permalink
Remove reset service from grpc and documentation [DPP-804]
Browse files Browse the repository at this point in the history
CHANGELOG_BEGIN
Remove reset service from the ledger api protocol and the documentation
CHANGELOG_END
  • Loading branch information
mziolekda committed Jan 19, 2022
1 parent 954bc5e commit ca897c1
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 135 deletions.
3 changes: 0 additions & 3 deletions docs/source/app-dev/grpc/error-codes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,6 @@ The following gRPC status codes have changed for submission rejections in Sandbo
|INVALID_ARGUMENT |NOT_FOUND |PARTY_NOT_KNOWN_ON_LEDGER is now returned on transaction rejections on unallocated parties. |PARTY_NOT_KNOWN_ON_LEDGER |
+-----------------------------------+---------------------------------------+--------------------------------------------------------------------------------------------+----------------------------------------+

**NOTE**: Additionally, UNAVAILABLE is now returned when trying to reset the Sandbox server during an ongoing re-initialization (was FAILED_PRECONDITION).


Daml Sandbox and VMBC
======================================

Expand Down
1 change: 0 additions & 1 deletion docs/source/app-dev/ledger-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ all cases, the Ledger API exposes the same services:
- Testing services (on Sandbox only, *not* for production ledgers)

- Use the :ref:`time service <time-service>` to obtain the time as known by the ledger.
- Use the :ref:`reset service <reset-service>` to reset the ledger state, as a quicker alternative to restarting the whole ledger application.

For full information on the services see :doc:`/app-dev/services`.

Expand Down
11 changes: 0 additions & 11 deletions docs/source/app-dev/services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -262,17 +262,6 @@ Use the **time service** to obtain the time as known by the ledger server.

For full details, see :ref:`the proto documentation for the service <com.daml.ledger.api.v1.testing.TimeService>`.

.. _reset-service:

Reset service
=============

Use the **reset service** to reset the ledger state, as a quicker alternative to restarting the whole ledger application.

This resets all state in the ledger, *including the ledger ID*, so clients will have to re-fetch the ledger ID from the identity service after hitting this endpoint.

For full details, see :ref:`the proto documentation for the service <com.daml.ledger.api.v1.testing.ResetService>`.

Services diagram
****************

Expand Down
1 change: 0 additions & 1 deletion language-support/hs/bindings/src/DA/Ledger/Services.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ import DA.Ledger.Services.LedgerIdentityService as X
import DA.Ledger.Services.PackageManagementService as X
import DA.Ledger.Services.PartyManagementService as X
import DA.Ledger.Services.PackageService as X
import DA.Ledger.Services.ResetService as X
import DA.Ledger.Services.TimeService as X
import DA.Ledger.Services.TransactionService as X

This file was deleted.

22 changes: 8 additions & 14 deletions ledger-api/grpc-definitions/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -141,28 +141,22 @@ filegroup(
visibility = ["//visibility:private"],
)

ledger_api_haskellpb_sources_testing = [
"ResetService.hs",
"TimeService.hs",
]

genrule(
name = "ledger-api-haskellpb-sources-testing",
srcs = [
"@com_google_protobuf//:well_known_protos",
"@go_googleapis//google/rpc:status.proto",
":ledger-api-protos-fg-testing",
],
outs = ["Com/Daml/Ledger/Api/V1/Testing/" + b for b in ledger_api_haskellpb_sources_testing],
outs = ["Com/Daml/Ledger/Api/V1/Testing/TimeService.hs"],
cmd = """
for src in $(locations :ledger-api-protos-fg-testing); do
$(location @proto3-suite//:compile-proto-file) \
--includeDir """ + google_protobuf_src + """ \
--includeDir """ + google_rpc_src + """ \
--includeDir """ + ledger_api_proto_source_root + """ \
--proto com/daml/ledger/api/v1/testing/$$(basename $$src) \
--out $(@D)
done
$(location @proto3-suite//:compile-proto-file) \
--includeDir """ + google_protobuf_src + """ \
--includeDir """ + google_rpc_src + """ \
--includeDir """ + ledger_api_proto_source_root + """ \
--proto com/daml/ledger/api/v1/testing/time_service.proto \
--out $$(dirname $$(dirname $$(dirname $$(dirname $$(dirname $$(dirname $(@D)))))))
#6x dirname because @D works differently for a single output
""",
tools = [
"@proto3-suite//:compile-proto-file",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ ledgerIdMismatch:
changeExplanation: "The ledger id from the request does match the participant's ledger id."
selfServiceErrorCodeId: LEDGER_ID_MISMATCH
services:
SandboxResetService:
- reset
TimeService:
- getTimeSource
- setTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,3 @@ SandboxClassicRejections.#invalidLedgerTime:
services:
SandboxClassic.CommandCompletionService:
- CompletionStream

SandboxClassic.resetService:
change:
- FAILED_PRECONDITION
- UNAVAILABLE
changeExplanation: "UNAVAILABLE is now returned when trying to reset the Sandbox server during an ongoing re-initialization."
selfServiceErrorCodeId: SERVICE_NOT_RUNNING
services:
SandboxClassic:
- Reset
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ trait ServiceCallAuthTests
protected def expectInvalidArgument(f: Future[Any]): Future[Assertion] =
expectFailure(f, Status.Code.INVALID_ARGUMENT)

protected def expectUnimplemented(f: Future[Any]): Future[Assertion] =
expectFailure(f, Status.Code.UNIMPLEMENTED)

protected def expectFailure(f: Future[Any], code: Status.Code): Future[Assertion] =
f.failed.collect {
case GrpcException(GrpcStatus(`code`, _), _) => succeed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import com.daml.ledger.api.v1.ledger_identity_service.{
LedgerIdentityServiceGrpc,
}
import com.daml.ledger.api.v1.package_service.{ListPackagesRequest, PackageServiceGrpc}
import com.daml.ledger.api.v1.testing.reset_service.{ResetRequest, ResetServiceGrpc}
import com.daml.ledger.api.v1.testing.time_service.{GetTimeRequest, TimeServiceGrpc}
import com.daml.ledger.api.v1.transaction_service.{GetLedgerEndRequest, TransactionServiceGrpc}
import io.grpc
Expand Down Expand Up @@ -85,15 +84,6 @@ class LegacyServiceIT
}
}

private def expectUnimplemented[A](block: => A): Assertion = {
inside(Try(block)) {
case Success(_) => fail()
case Failure(exc: StatusRuntimeException) =>
exc.getStatus.getCode shouldBe Status.Code.UNIMPLEMENTED
case Failure(otherwise) => fail(otherwise)
}
}

"Ledger API Server" should {
"offer com.digitalasset.ledger.api.v1.ActiveContractsService" in {
expectNotUnimplemented {
Expand Down Expand Up @@ -159,14 +149,6 @@ class LegacyServiceIT
}
}

"offer com.digitalasset.ledger.api.v1.testing.ResetService" in {
expectUnimplemented {
val testingReset =
ResetServiceGrpc.blockingStub(channel).withInterceptors(legacyCallInterceptor)
testingReset.reset(ResetRequest(randomLedgerId))
}
}

"offer com.digitalasset.ledger.api.v1.testing.TimeService" in {
expectNotUnimplemented {
val testingTime =
Expand Down

0 comments on commit ca897c1

Please sign in to comment.