Skip to content

Commit

Permalink
release: proto v2.16.0-beta.1 (#2689)
Browse files Browse the repository at this point in the history
* chore: Bumped package version

Signed-off-by: ivaylogarnev-limechain <[email protected]>

* chore: Updated protos

Signed-off-by: ivaylogarnev-limechain <[email protected]>

* refactor: Linter fixes

Signed-off-by: ivaylogarnev-limechain <[email protected]>

* fix: Added new request type

Signed-off-by: ivaylogarnev-limechain <[email protected]>

---------

Signed-off-by: ivaylogarnev-limechain <[email protected]>
  • Loading branch information
ivaylogarnev-limechain authored Dec 3, 2024
1 parent 476c09e commit df25908
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/proto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hashgraph/proto",
"version": "2.15.0-beta.4",
"version": "2.16.0-beta.1",
"description": "Protobufs for the Hedera™ Hashgraph SDK",
"main": "lib/index.js",
"browser": "src/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* # Tss Encryption Key Transaction
*
* ### Keywords
* The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
* "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
* document are to be interpreted as described in
* [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in
* [RFC8174](https://www.ietf.org/rfc/rfc8174).
*/
syntax = "proto3";

package com.hedera.hapi.services.auxiliary.tss;

/*
* Copyright (C) 2024 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

option java_package = "com.hedera.hapi.services.auxiliary.tss.legacy";
// <<<pbj.java_package = "com.hedera.hapi.services.auxiliary.tss">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
* A transaction body for sending the public TSS encryption key.
*/
message TssEncryptionKeyTransactionBody {
/**
* The raw bytes of the public TSS encryption key of the node sending the transaction.
* <p>
* This value MUST be set.<br/>
* This value MUST NOT be empty.<br/>
*/
bytes publicTssEncryptionKey = 1;
}
5 changes: 5 additions & 0 deletions packages/proto/src/proto/services/basic_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,11 @@ enum HederaFunctionality {
* Submit a node signature as part of the Threshold Signature Scheme (TSS) processing.
*/
TssShareSignature = 98;

/**
* Submit a node public tss encryption key as part of the Threshold Signature Scheme (TSS).
*/
TssEncryptionKey = 99;
}

/**
Expand Down
117 changes: 117 additions & 0 deletions packages/proto/src/proto/services/state/tss/tss_status.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/**
* # Tss Message Map Key
*
* ### Keywords
* The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
* "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
* document are to be interpreted as described in
* [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in
* [RFC8174](https://www.ietf.org/rfc/rfc8174).
*/
syntax = "proto3";

package com.hedera.hapi.node.state.tss;

/*
* Copyright (C) 2024 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

option java_package = "com.hedera.hapi.node.state.tss.legacy";
// <<<pbj.java_package = "com.hedera.hapi.node.state.tss">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
* A Singleton state object that represents the status of the TSS keying process.
*
* This key SHALL be used to determine the stage of the TSS keying process.
*/
message TssStatus {

/**
* An enum representing the status of the TSS keying process.<br/>
* <p>
* This status SHALL be used to determine the state of the TSS keying process.<br/>
* This value MUST be set when tss is enabled.
*/
TssKeyingStatus tss_keying_status = 1;

/**
* An enum representing the key either active roster or candidate roster.<br/>
* This value will be to key active roster if it is genesis stage
* <p>
* This value MUST be set.
*/
RosterToKey roster_to_key = 2;

/**
* A hash of the ledger_id resulting from the TSS keying process.<br/>
* If this value is empty, the TSS keying process has not yet completed.
* <p>
* This value COULD be empty.<br/>
* This value MUST contain a valid hash after the TSS keying process is complete.<br/>
*/
bytes ledger_id = 3;
}

/**
* An enum representing the status of the TSS keying process.
*
* This status SHALL be used to determine the state of the TSS keying process.
*/
enum TssKeyingStatus {

/**
* The TSS keying process has not yet reached the threshold for encryption
* keys.
*/
WAITING_FOR_ENCRYPTION_KEYS = 0;

/**
* The TSS keying process has not yet reached the threshold for TSS messages.
*/
WAITING_FOR_THRESHOLD_TSS_MESSAGES = 1;

/**
* The TSS keying process has not yet reached the threshold for TSS votes.
*/
WAITING_FOR_THRESHOLD_TSS_VOTES = 2;

/**
* The TSS keying process has completed and the ledger id is set.
*/
KEYING_COMPLETE = 3;
}

/**
* An enum representing the key either active roster or candidate roster.
* This value will be to key active roster if it is genesis stage.
*/
enum RosterToKey {

/**
* Key the active roster. This is true when we are keying roster on genesis stage.
*/
ACTIVE_ROSTER = 0;

/**
* Key the candidate roster. This is true when we are keying roster on non-genesis stage.
*/
CANDIDATE_ROSTER = 1;

/**
* Key none of the roster. This is true when we are not keying any roster.
*/
NONE = 2;
}
6 changes: 6 additions & 0 deletions packages/proto/src/proto/services/transaction_body.proto
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ import "node_delete.proto";
import "auxiliary/tss/tss_message.proto";
import "auxiliary/tss/tss_vote.proto";
import "auxiliary/tss/tss_share_signature.proto";
import "auxiliary/tss/tss_encryption_key.proto";

/**
* A single transaction. All transaction types are possible here.
Expand Down Expand Up @@ -437,5 +438,10 @@ message TransactionBody {
* A transaction body for a 'tssShareSignature` request
*/
com.hedera.hapi.services.auxiliary.tss.TssShareSignatureTransactionBody tssShareSignature = 63;

/**
* A transaction body for a 'tssEncryptionKey` request
*/
com.hedera.hapi.services.auxiliary.tss.TssEncryptionKeyTransactionBody tssEncryptionKey = 64;
}
}
11 changes: 10 additions & 1 deletion src/RequestType.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ export default class RequestType {
return "TssVote";
case RequestType.TssShareSignature:
return "TssShareSignature";
case RequestType.TssEncryptionKey:
return "TssEncryptionKey";
default:
return `UNKNOWN (${this._code})`;
}
Expand Down Expand Up @@ -393,6 +395,8 @@ export default class RequestType {
return RequestType.TssVote;
case 98:
return RequestType.TssShareSignature;
case 99:
return RequestType.TssEncryptionKey;
}

throw new Error(
Expand Down Expand Up @@ -830,4 +834,9 @@ RequestType.TssVote = new RequestType(97);
* Communicates a node's signature of a block hash
* using its private share within the TSS process
*/
RequestType.TssShareSignature = new RequestType(98);
RequestType.TssShareSignature = new RequestType(98);

/**
* Submit a node public tss encryption key as part of the Threshold Signature Scheme (TSS).
*/
RequestType.TssEncryptionKey = new RequestType(99);
8 changes: 4 additions & 4 deletions test/unit/MaxAttemptsOrTimeoutError.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ describe("MaxAttemptsOrTimeoutError", function () {
error = new MaxAttemptsOrTimeoutError(message, nodeAccountId);
});

it("should create an instance with correct properties", function() {
it("should create an instance with correct properties", function () {
expect(error).to.be.instanceOf(MaxAttemptsOrTimeoutError);
expect(error.message).to.be.equal(message);
expect(error.nodeAccountId).to.be.equal(nodeAccountId);
});

it("toJSON should return correct JSON representation", function() {
it("toJSON should return correct JSON representation", function () {
const expectedJson = {
message,
nodeAccountId,
Expand All @@ -33,7 +33,7 @@ describe("MaxAttemptsOrTimeoutError", function () {
expect(error.toJSON()).to.be.deep.equal(expectedJson);
});

it("toString should return a JSON string", function() {
it("toString should return a JSON string", function () {
const expectedString = JSON.stringify({
message,
nodeAccountId,
Expand All @@ -42,7 +42,7 @@ describe("MaxAttemptsOrTimeoutError", function () {
expect(error.toString()).to.be.equal(expectedString);
});

it("valueOf should return the same result as toJSON", function() {
it("valueOf should return the same result as toJSON", function () {
expect(error.valueOf()).to.be.deep.equal(error.toJSON());
});

Expand Down

0 comments on commit df25908

Please sign in to comment.