Skip to content

Commit

Permalink
Draft of config management service (digital-asset#3656)
Browse files Browse the repository at this point in the history
* Add draft of config management service

* Add submission id to SetTimeModelRequest
Jussi Mäki authored Dec 5, 2019
1 parent 1684b22 commit f998887
Showing 1 changed file with 80 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Copyright (c) 2019 The DAML Authors. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

syntax = "proto3";

package com.digitalasset.ledger.api.v1.admin;

option java_outer_classname = "ConfigManagementServiceOuterClass";
option java_package = "com.digitalasset.ledger.api.v1.admin";
option csharp_namespace = "Com.DigitalAsset.Ledger.Api.V1.Admin";

import "google/protobuf/duration.proto";

// Status: experimental interface, will change before it is deemed production
// ready

// Ledger configuration management service provides methods for the ledger administrator
// to change the current ledger configuration. The services provides methods to modify
// different aspects of the configuration.
service ConfigManagementService {
// Return the currently active time model and the current configuration generation.
rpc GetTimeModel (GetTimeModelRequest) returns (GetTimeModelResponse);

// Set the ledger time model.
// In case of failure this method responds with:
// - INVALID_ARGUMENT if arguments are invalid, or the provided configuration generation
// does not match the current active configuration generation. The caller is expected
// to retry by again fetching current time model using 'GetTimeModel', applying changes
// and resubmitting.
// - UNIMPLEMENTED if this method is not supported by the backing ledger.
rpc SetTimeModel (SetTimeModelRequest) returns (SetTimeModelResponse);
}

message GetTimeModelRequest {
}

message GetTimeModelResponse {
// The current configuration generation. The generation is a monotonically increasing
// integer that is incremented on each change. Used when setting the time model.
int64 configuration_generation = 1;

// The current ledger time model.
TimeModel time_model = 2;
}

message SetTimeModelRequest {
// Submission identifier used for tracking the request and to reject
// duplicate submissions.
// Required.
string submission_id = 1;

// The current configuration generation which we're submitting the change against.
// This is used to perform a compare-and-swap of the configuration to
// safeguard against concurrent modifications.
// Required.
int64 configuration_generation = 2;

// The new time model that replaces the current one.
// Required.
TimeModel new_time_model = 3;
}

message SetTimeModelResponse {
}

message TimeModel {
// The expected minimum latency of a transaction.
// Required.
google.protobuf.Duration min_transaction_latency = 1;

// The maximum allowed clock skew between the ledger and clients.
// Required.
google.protobuf.Duration max_clock_skew = 2;

// The maximum allowed time to live for a transaction.
// Must be greater than the derived minimum time to live.
// Required.
google.protobuf.Duration max_ttl = 3;
}

0 comments on commit f998887

Please sign in to comment.