diff --git a/services/basic_types.proto b/services/basic_types.proto index 4ff58e03..51f32458 100644 --- a/services/basic_types.proto +++ b/services/basic_types.proto @@ -426,6 +426,27 @@ enum TokenKycStatus { Revoked = 2; } +/** + * Possible Pause statuses returned on TokenGetInfoQuery + */ +enum TokenPauseStatus { + /** + * Indicates that a Token has no pauseKey + */ + PauseNotApplicable = 0; + + /** + * Indicates that a Token is Paused + */ + Paused = 1; + + /** + * Indicates that a Token is Unpaused. + */ + Unpaused = 2; +} + + /** * A Key can be a public key from one of the three supported systems (ed25519, RSA-3072, ECDSA with * p384). Or, it can be the ID of a smart contract instance, which is authorized to act as if it had @@ -986,6 +1007,16 @@ enum HederaFunctionality { * Get execution time(s) by TransactionID, if available */ NetworkGetExecutionTime = 78; + + /** + * Pause the Token + */ + TokenPause = 79; + + /** + * Unpause the Token + */ + TokenUnpause = 80; } /** @@ -1179,7 +1210,9 @@ message NodeAddress { bytes memo = 3 [deprecated=true]; /** - * The node's hex-encoded X509 RSA public key + * The node's X509 RSA public key used to sign stream files (e.g., record stream + * files). Precisely, this field is a string of hexadecimal characters which, + * translated to binary, are the public key's DER encoding. */ string RSA_PubKey = 4; @@ -1194,7 +1227,10 @@ message NodeAddress { AccountID nodeAccountId = 6; /** - * # The hex-encoded SHA-384 hash of the X509 cert used to encrypt gRPC traffic to the node + * # Hash of the node's TLS certificate. Precisely, this field is a string of + * hexadecimal characters which, translated to binary, are the SHA-384 hash of + * the UTF-8 NFKD encoding of the node's TLS cert in PEM format. Its value can be + * used to verify the node's certificate it presents during TLS negotiations. */ bytes nodeCertHash = 7; diff --git a/services/contract_call_local.proto b/services/contract_call_local.proto index bedce5f0..12ff7742 100644 --- a/services/contract_call_local.proto +++ b/services/contract_call_local.proto @@ -133,7 +133,7 @@ message ContractCallLocalQuery { /** * max number of bytes that the result might include. The run will fail if it would have returned more than this number of bytes. */ - int64 maxResultSize = 5; + int64 maxResultSize = 5 [deprecated=true]; } /** diff --git a/services/contract_update.proto b/services/contract_update.proto index 914c24ea..dfc6f265 100644 --- a/services/contract_update.proto +++ b/services/contract_update.proto @@ -79,7 +79,7 @@ message ContractUpdateTransactionBody { * The new id of the file asserted to contain the bytecode of the Solidity transaction that * created this contract */ - FileID fileID = 8; + FileID fileID = 8 [deprecated = true]; /** * The new contract memo, assumed to be Unicode encoded with UTF-8 (at most 100 bytes) diff --git a/services/freeze.proto b/services/freeze.proto index e6c741c0..8b6b0733 100644 --- a/services/freeze.proto +++ b/services/freeze.proto @@ -28,6 +28,7 @@ option java_multiple_files = true; import "duration.proto"; import "timestamp.proto"; import "basic_types.proto"; +import "freeze_type.proto"; /** * At consensus, sets the consensus time at which the platform should stop creating events and @@ -35,38 +36,47 @@ import "basic_types.proto"; */ message FreezeTransactionBody { /** + * !! DEPRECATED and REJECTED by nodes * The start hour (in UTC time), a value between 0 and 23 */ int32 startHour = 1 [deprecated=true]; /** + * !! DEPRECATED and REJECTED by nodes * The start minute (in UTC time), a value between 0 and 59 */ int32 startMin = 2 [deprecated=true]; /** + * !! DEPRECATED and REJECTED by nodes * The end hour (in UTC time), a value between 0 and 23 */ int32 endHour = 3 [deprecated=true]; /** + * !! DEPRECATED and REJECTED by nodes * The end minute (in UTC time), a value between 0 and 59 */ int32 endMin = 4 [deprecated=true]; /** * If set, the file whose contents should be used for a network software update during the - * maintenance window + * maintenance window. */ FileID update_file = 5; /** - * If set, the expected hash of the contents of the update file (used to verify the update) + * If set, the expected hash of the contents of the update file (used to verify the update). */ bytes file_hash = 6; /** - * The consensus time at which the maintenance window should begin + * The consensus time at which the maintenance window should begin. */ Timestamp start_time = 7; + + /** + * The type of network freeze or upgrade operation to perform. + */ + FreezeType freeze_type = 8; } diff --git a/services/freeze_type.proto b/services/freeze_type.proto new file mode 100644 index 00000000..6f124444 --- /dev/null +++ b/services/freeze_type.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 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.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +/** +* The type of network freeze or upgrade operation to be performed. This type dictates which +* fields are required. +*/ +enum FreezeType { + /** + * An (invalid) default value for this enum, to ensure the client explicitly sets + * the intended type of freeze transaction. + */ + UNKNOWN_FREEZE_TYPE = 0; + + /** + * Freezes the network at the specified time. The start_time field must be provided and + * must reference a future time. Any values specified for the update_file and file_hash + * fields will be ignored. This transaction does not perform any network changes or + * upgrades and requires manual intervention to restart the network. + */ + FREEZE_ONLY = 1; + + /** + * A non-freezing operation that initiates network wide preparation in advance of a + * scheduled freeze upgrade. The update_file and file_hash fields must be provided and + * valid. The start_time field may be omitted and any value present will be ignored. + */ + PREPARE_UPGRADE = 2; + + /** + * Freezes the network at the specified time and performs the previously prepared + * automatic upgrade across the entire network. + */ + FREEZE_UPGRADE = 3; + + /** + * Aborts a pending network freeze operation. + */ + FREEZE_ABORT = 4; + + /** + * Performs an immediate upgrade on auxilary services and containers providing + * telemetry/metrics. Does not impact network operations. + */ + TELEMETRY_UPGRADE = 5; +} diff --git a/services/response_code.proto b/services/response_code.proto index b38775cb..b96196d2 100644 --- a/services/response_code.proto +++ b/services/response_code.proto @@ -62,7 +62,9 @@ enum ResponseCodeEnum { INVALID_TRANSACTION_START = 5; /** - * valid transaction duration is a positive non zero number that does not exceed 120 seconds + * The given transactionValidDuration was either non-positive, or greater than the maximum + * valid duration of 180 secs. + * */ INVALID_TRANSACTION_DURATION = 6; @@ -1005,7 +1007,90 @@ enum ResponseCodeEnum { EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT = 263; /** - * Cannot set the number of automatic associations for an account more than the maximum allowed token associations tokens.maxPerAccount + * Cannot set the number of automatic associations for an account more than the maximum allowed + * token associations tokens.maxPerAccount. */ REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT = 264; + + /** + * Token is paused. This Token cannot be a part of any kind of Transaction until unpaused. + */ + TOKEN_IS_PAUSED = 265; + + /** + * Pause key is not set on token + */ + TOKEN_HAS_NO_PAUSE_KEY = 266; + + /** + * The provided pause key was invalid + */ + INVALID_PAUSE_KEY = 267; + + /** + * The update file in a freeze transaction body must exist. + */ + FREEZE_UPDATE_FILE_DOES_NOT_EXIST = 268; + + /** + * The hash of the update file in a freeze transaction body must match the in-memory hash. + */ + FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH = 269; + + /** + * A FREEZE_UPGRADE transaction was handled with no previous update prepared. + */ + NO_UPGRADE_HAS_BEEN_PREPARED = 270; + + /** + * A FREEZE_ABORT transaction was handled with no scheduled freeze. + */ + NO_FREEZE_IS_SCHEDULED = 271; + + /** + * The update file hash when handling a FREEZE_UPGRADE transaction differs from the file + * hash at the time of handling the PREPARE_UPGRADE transaction. + */ + UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE = 272; + + /** + * The given freeze start time was in the (consensus) past. + */ + FREEZE_START_TIME_MUST_BE_FUTURE = 273; + + /** + * The prepared update file cannot be updated or appended until either the upgrade has + * been completed, or a FREEZE_ABORT has been handled. + */ + PREPARED_UPDATE_FILE_IS_IMMUTABLE = 274; + + /** + * Once a freeze is scheduled, it must be aborted before any other type of freeze can + * can be performed. + */ + FREEZE_ALREADY_SCHEDULED = 275; + + /** + * If an NMT upgrade has been prepared, the following operation must be a FREEZE_UPGRADE. + * (To issue a FREEZE_ONLY, submit a FREEZE_ABORT first.) + */ + FREEZE_UPGRADE_IN_PROGRESS = 276; + + /** + * If an NMT upgrade has been prepared, the subsequent FREEZE_UPGRADE transaction must + * confirm the id of the file to be used in the upgrade. + */ + UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED = 277; + + /** + * If an NMT upgrade has been prepared, the subsequent FREEZE_UPGRADE transaction must + * confirm the hash of the file to be used in the upgrade. + */ + UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED = 278; + + /** + * Consensus throttle did not allow execution of this transaction. System is throttled at + * consensus level. + */ + CONSENSUS_GAS_EXHAUSTED = 279; } diff --git a/services/schedulable_transaction_body.proto b/services/schedulable_transaction_body.proto index bdb8a829..44a8b0cd 100644 --- a/services/schedulable_transaction_body.proto +++ b/services/schedulable_transaction_body.proto @@ -62,6 +62,8 @@ import "token_burn.proto"; import "token_wipe_account.proto"; import "token_associate.proto"; import "token_dissociate.proto"; +import "token_pause.proto"; +import "token_unpause.proto"; import "schedule_delete.proto"; @@ -239,6 +241,16 @@ message SchedulableTransactionBody { */ TokenDissociateTransactionBody tokenDissociate = 33; + /** + * Pauses the Token + */ + TokenPauseTransactionBody token_pause = 35; + + /** + * Unpauses the Token + */ + TokenUnpauseTransactionBody token_unpause = 36; + /** * Marks a schedule in the network's action queue as deleted, preventing it from executing */ diff --git a/services/token_create.proto b/services/token_create.proto index 42bb2dd6..5d9599ea 100644 --- a/services/token_create.proto +++ b/services/token_create.proto @@ -191,4 +191,10 @@ message TokenCreateTransactionBody { * The custom fees to be assessed during a CryptoTransfer that transfers units of this token */ repeated CustomFee custom_fees = 21; + + /** + * The Key which can pause and unpause the Token. + * If Empty the token pause status defaults to PauseNotApplicable, otherwise Unpaused. + */ + Key pause_key = 22; } diff --git a/services/token_get_info.proto b/services/token_get_info.proto index cc855d96..df6c5eda 100644 --- a/services/token_get_info.proto +++ b/services/token_get_info.proto @@ -182,6 +182,16 @@ message TokenInfo { * The custom fees to be assessed during a CryptoTransfer that transfers units of this token */ repeated CustomFee custom_fees = 23; + + /** + * The Key which can pause and unpause the Token. + */ + Key pause_key = 24; + + /** + * Specifies whether the token is paused or not. PauseNotApplicable is returned if pauseKey is not set. + */ + TokenPauseStatus pause_status = 25; } /** diff --git a/services/token_pause.proto b/services/token_pause.proto new file mode 100644 index 00000000..ca661f8d --- /dev/null +++ b/services/token_pause.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 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.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Pauses the Token from being involved in any kind of Transaction until it is unpaused. + * Must be signed with the Token's pause key. + * If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. + * If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + * If no Pause Key is defined, the transaction will resolve to TOKEN_HAS_NO_PAUSE_KEY. + * Once executed the Token is marked as paused and will be not able to be a part of any transaction. + * The operation is idempotent - becomes a no-op if the Token is already Paused. + */ +message TokenPauseTransactionBody { + /** + * The token to be paused. + */ + TokenID token = 1; +} \ No newline at end of file diff --git a/services/token_service.proto b/services/token_service.proto index 58699a12..c9652d25 100644 --- a/services/token_service.proto +++ b/services/token_service.proto @@ -121,4 +121,10 @@ service TokenService { rpc getTokenNftInfos (Query) returns (Response) { option deprecated = true; }; + + // Pause the token + rpc pauseToken (Transaction) returns (TransactionResponse); + + // Unpause the token + rpc unpauseToken (Transaction) returns (TransactionResponse); } diff --git a/services/token_unpause.proto b/services/token_unpause.proto new file mode 100644 index 00000000..183d5b30 --- /dev/null +++ b/services/token_unpause.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 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.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Unpauses the Token. Must be signed with the Token's pause key. + * If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. + * If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + * If no Pause Key is defined, the transaction will resolve to TOKEN_HAS_NO_PAUSE_KEY. + * Once executed the Token is marked as Unpaused and can be used in Transactions. + * The operation is idempotent - becomes a no-op if the Token is already unpaused. + */ +message TokenUnpauseTransactionBody { + /** + * The token to be unpaused. + */ + TokenID token = 1; +} \ No newline at end of file diff --git a/services/token_update.proto b/services/token_update.proto index 6cfc75ca..e7d7c97e 100644 --- a/services/token_update.proto +++ b/services/token_update.proto @@ -135,4 +135,10 @@ message TokenUpdateTransactionBody { * currently have this key, transaction will resolve to TOKEN_HAS_NO_FEE_SCHEDULE_KEY */ Key fee_schedule_key = 14; + + /** + * The Key which can pause and unpause the Token. If the Token does not currently have a pause key, + * transaction will resolve to TOKEN_HAS_NO_PAUSE_KEY + */ + Key pause_key = 15; } diff --git a/services/transaction_body.proto b/services/transaction_body.proto index 8fde2e60..87597f6c 100644 --- a/services/transaction_body.proto +++ b/services/transaction_body.proto @@ -69,6 +69,8 @@ import "token_wipe_account.proto"; import "token_associate.proto"; import "token_dissociate.proto"; import "token_fee_schedule_update.proto"; +import "token_pause.proto"; +import "token_unpause.proto"; import "schedule_create.proto"; import "schedule_delete.proto"; @@ -288,6 +290,16 @@ message TransactionBody { */ TokenFeeScheduleUpdateTransactionBody token_fee_schedule_update = 45; + /** + * Pauses the Token + */ + TokenPauseTransactionBody token_pause = 46; + + /** + * Unpauses the Token + */ + TokenUnpauseTransactionBody token_unpause = 47; + /** * Creates a schedule in the network's action queue */