Skip to content

Commit

Permalink
Prepare for 0.13.0 tag (#28)
Browse files Browse the repository at this point in the history
* Reference node properties controlling HTS behavior

Signed-off-by: tinker-michaelj <[email protected]>

* Again clarify use of master

Signed-off-by: tinker-michaelj <[email protected]>

* Update from head of schedule-develop in hashgraph/hedera-services (#2)

Signed-off-by: tinker-michaelj <[email protected]>

* Standardize memos for non-schedule entities (#3)

* Standardize memos for non-schedule entities

Signed-off-by: tinker-michaelj <[email protected]>

* Fix typo in field number

Signed-off-by: tinker-michaelj <[email protected]>

* Use google.protobuf.StringValue for new memo fields

Signed-off-by: tinker-michaelj <[email protected]>

* Comment on deprecated memoField choice

Signed-off-by: tinker-michaelj <[email protected]>

* Port schedule txn comments (#5)

* Port schedule txn comments

Signed-off-by: tinker-michaelj <[email protected]>

* Add further comments

Signed-off-by: tinker-michaelj <[email protected]>

* Apply the same changes to hedera-protobufs repo. (#4)

Signed-off-by: ljianghedera <[email protected]>

Co-authored-by: ljianghedera <[email protected]>

* Separate messages used for balances proto under hedera/streams (#6)

* Separate messages used for balances proto under hedera/streams

Signed-off-by: tinker-michaelj <[email protected]>

* Restructure proto directories

Signed-off-by: tinker-michaelj <[email protected]>

* Change java_package for AccountBalanceFile.proto messages

Signed-off-by: tinker-michaelj <[email protected]>

* Extract TokenBalance(s) to BasicTypes

Signed-off-by: tinker-michaelj <[email protected]>

* Include decimals in queries of token/account balances and relationships (#8)

Signed-off-by: tinker-michaelj <[email protected]>

* Include Leemon's edits from Services issue #974 (#10)

Signed-off-by: tinker-michaelj <[email protected]>

* Add scheduled transaction id to TransactionReceipt + ScheduleGetInfo types (#12)

* Prepare to tag 0.12.0 release (#11)

* Reference node properties controlling HTS behavior

Signed-off-by: tinker-michaelj <[email protected]>

* Again clarify use of master

Signed-off-by: tinker-michaelj <[email protected]>

* Update from head of schedule-develop in hashgraph/hedera-services (#2)

Signed-off-by: tinker-michaelj <[email protected]>

* Standardize memos for non-schedule entities (#3)

* Standardize memos for non-schedule entities

Signed-off-by: tinker-michaelj <[email protected]>

* Fix typo in field number

Signed-off-by: tinker-michaelj <[email protected]>

* Use google.protobuf.StringValue for new memo fields

Signed-off-by: tinker-michaelj <[email protected]>

* Comment on deprecated memoField choice

Signed-off-by: tinker-michaelj <[email protected]>

* Port schedule txn comments (#5)

* Port schedule txn comments

Signed-off-by: tinker-michaelj <[email protected]>

* Add further comments

Signed-off-by: tinker-michaelj <[email protected]>

* Apply the same changes to hedera-protobufs repo. (#4)

Signed-off-by: ljianghedera <[email protected]>

Co-authored-by: ljianghedera <[email protected]>

* Separate messages used for balances proto under hedera/streams (#6)

* Separate messages used for balances proto under hedera/streams

Signed-off-by: tinker-michaelj <[email protected]>

* Restructure proto directories

Signed-off-by: tinker-michaelj <[email protected]>

* Change java_package for AccountBalanceFile.proto messages

Signed-off-by: tinker-michaelj <[email protected]>

* Extract TokenBalance(s) to BasicTypes

Signed-off-by: tinker-michaelj <[email protected]>

* Include decimals in queries of token/account balances and relationships (#8)

Signed-off-by: tinker-michaelj <[email protected]>

* Include Leemon's edits from Services issue #974 (#10)

Signed-off-by: tinker-michaelj <[email protected]>

Co-authored-by: ljianghedera <[email protected]>

* Update README.md

* Add scheduledTransactionID fields to TransactionReceipt and ScheduleGetInfo

Signed-off-by: tinker-michaelj <[email protected]>

* Update README

Signed-off-by: tinker-michaelj <[email protected]>

Co-authored-by: ljianghedera <[email protected]>

* 00017 d hcs message size (#19)

* Add response code for Hcs message size limit.

Signed-off-by: ljianghedera <[email protected]>

* Add the response code for HCS message too large.

Signed-off-by: ljianghedera <[email protected]>

* Update protobufs to satisfy revised scheduled txns spec (#15)

* Update protobufs to satisfy revised scheduled txns spec

Signed-off-by: tinker-michaelj <[email protected]>

* Improve comment readability

Signed-off-by: tinker-michaelj <[email protected]>

* Make explicit mention of scheduling.whitelist

Signed-off-by: tinker-michaelj <[email protected]>

* Incorporate reviewer feedback

Signed-off-by: tinker-michaelj <[email protected]>

* Standardize on payerAccountID

Signed-off-by: tinker-michaelj <[email protected]>

* Add scheduledTransactionID to ScheduleInfo

Signed-off-by: tinker-michaelj <[email protected]>

* Clarify effects of schedule deletion

Signed-off-by: tinker-michaelj <[email protected]>

* Include expiration time in getScheduleInfo response

Signed-off-by: tinker-michaelj <[email protected]>

* Change now-obsolete UNPARSEABLE_SCHEDULED_TRANSACTION response code to SCHEDULED_TRANSACTION_NOT_IN_WHITELIST; remove UNSCHEDULABLE_TRANSACTION

Signed-off-by: tinker-michaelj <[email protected]>

* Remove unneeded imports

Signed-off-by: tinker-michaelj <[email protected]>

* Replace deleted/executed flags with consensus timestamps

Signed-off-by: tinker-michaelj <[email protected]>

* Update info on ScheduleCreate receipt on duplicate creation

Signed-off-by: tinker-michaelj <[email protected]>

* Incorporate reviewer feedback

Signed-off-by: tinker-michaelj <[email protected]>

* Use oneof to enforce mutual exclusion of schedule deletion and execution

Signed-off-by: tinker-michaelj <[email protected]>

* Use lower_snake_case for field names in oneof to ease transition to standard naming convention

Signed-off-by: tinker-michaelj <[email protected]>

* Redirect to ResponseCode doc section from Schedule* ops

Signed-off-by: tinker-michaelj <[email protected]>

* Add ThrottleDefinitions types (#23)

* Create ThrottleDefinitions message

Signed-off-by: tinker-michaelj <[email protected]>

* Add throttle-specific response codes

Signed-off-by: tinker-michaelj <[email protected]>

* Add more general response codes for throttle defs

Signed-off-by: tinker-michaelj <[email protected]>

* Add comments to the throttle types

Signed-off-by: tinker-michaelj <[email protected]>

* Clarify some comments

Signed-off-by: tinker-michaelj <[email protected]>

* Update to milliOpsPerSec/burstPeriodMs

Signed-off-by: tinker-michaelj <[email protected]>

* Fix typo

Signed-off-by: tinker-michaelj <[email protected]>

* Be more concise

Signed-off-by: tinker-michaelj <[email protected]>

* Be explicit about milli-ops

Signed-off-by: tinker-michaelj <[email protected]>

* Emphasize only ed25519 keys are supported (#26)

Signed-off-by: tinker-michaelj <[email protected]>

* Revise address book types to 0.13.0 standard (#27)

* Update to final version of address book messages

Signed-off-by: tinker-michaelj <[email protected]>

* Align with issue 750 consensus format

Signed-off-by: tinker-michaelj <[email protected]>

* Change ServiceEndpoint types

Signed-off-by: tinker-michaelj <[email protected]>

* Match comments from issue

Signed-off-by: tinker-michaelj <[email protected]>

* Update comment

Signed-off-by: tinker-michaelj <[email protected]>

* Add details

Signed-off-by: tinker-michaelj <[email protected]>

* Specify fallback use of deprecated fields

Signed-off-by: tinker-michaelj <[email protected]>

* Minor revision

Signed-off-by: tinker-michaelj <[email protected]>

Co-authored-by: ljianghedera <[email protected]>
Co-authored-by: ljianghedera <[email protected]>
  • Loading branch information
3 people authored Apr 15, 2021
1 parent e438df2 commit f770bbb
Show file tree
Hide file tree
Showing 10 changed files with 295 additions and 98 deletions.
68 changes: 30 additions & 38 deletions services/BasicTypes.proto
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,11 @@ Applicable to Scheduled Transactions:
- The ID of a Scheduled Transaction has transactionValidStart and accountIDs inherited from the ScheduleCreate transaction that created it. That is to say that they are equal
- The scheduled property is true for Scheduled Transactions
- transactionValidStart, accountID and scheduled properties should be omitted
- Scheduled Transactions should be submitted with only nonce populated (if desired). Nonce is an additional option presented to users so that they can create multiple sequential Scheduled Transactions that have the same transaction body.
*/
message TransactionID {
Timestamp transactionValidStart = 1; // The transaction is invalid if consensusTimestamp < transactionID.transactionStartValid
AccountID accountID = 2; // The Account ID that paid for this transaction
bool scheduled = 3; // Whether the Transaction is of type Scheduled or no
bytes nonce = 4; // Used to manipulate the uniqueness check for idempotent schedule transaction creation
}

/* An account, and the amount that it sends or receives during a cryptocurrency or token transfer. */
Expand Down Expand Up @@ -138,7 +136,7 @@ enum TokenKycStatus {
*
* A Key can contain a ThresholdKey or KeyList, which in turn contain a Key, so this mutual recursion would allow nesting arbitrarily deep. A ThresholdKey which contains a list of primitive keys (e.g., ed25519) has 3 levels: ThresholdKey -> KeyList -> Key. A KeyList which contains several primitive keys (e.g., ed25519) has 2 levels: KeyList -> Key. A Key with 2 levels of nested ThresholdKeys has 7 levels: Key -> ThresholdKey -> KeyList -> Key -> ThresholdKey -> KeyList -> Key.
*
* Each Key should not have more than 46 levels, which implies 15 levels of nested ThresholdKeys.
* Each Key should not have more than 46 levels, which implies 15 levels of nested ThresholdKeys. Only ed25519 primitive keys are currently supported.
*/
message Key {
oneof key {
Expand Down Expand Up @@ -198,8 +196,8 @@ message SignatureList {

/*
The client may use any number of bytes from 0 to the whole length of the public key for pubKeyPrefix.
If 0 bytes is used, then it is assumed that only one public key is used to sign.
*/
If 0 bytes is used, then it is assumed that only one public key is used to sign. Only ed25519
keys and hence signatures are currently supported. */
message SignaturePair {
bytes pubKeyPrefix = 1; // First few bytes of the public key
oneof signature {
Expand Down Expand Up @@ -340,49 +338,43 @@ message CurrentAndNextFeeSchedule {
FeeSchedule nextFeeSchedule = 2; // Contains next Fee Schedule
}

/* This contains the IP Address and the port representing an endpoint of a Node in a network */
message NodeEndpoint {
string ipAddress = 1; // The IP address of the node
string port = 2; // The port of the node
/*
Contains the IP address and the port representing a service endpoint of a Node in a network. Used to reach the Hedera API and submit transactions to the network.
*/
message ServiceEndpoint {
bytes ipAddressV4 = 1; // The 32-bit IPv4 address of the node encoded in left to right order (e.g. 127.0.0.1 has 127 as its first byte)
int32 port = 2; // The port of the node
}

/*
The metadata for a Node – including IP Address, and the crypto account associated with the Node.
/*
The data about a node, including its service endpoints and the Hedera account to be paid for services
provided by the node (that is, queries answered and transactions submitted.)
Note : This structure is intended to be used to parse 0.0.102, use NodeAddressForClients to parse 0.0.101.
Usage of NodeAddress to parse 0.0.101 is deprecated.
If the <tt>serviceEndpoint</tt> list is not set, or empty, then the endpoint given by the (deprecated)
<tt>ipAddress</tt> and <tt>portno</tt> fields should be used.
All fields are populated in the 0.0.102 address book file while only fields that start with # are populated in the 0.0.101 address book file.
*/
message NodeAddress {
bytes ipAddress = 1 [deprecated=true]; // The ip address of the Node with separator & octets. Usage is deprecated, NodeEndPoint is preferred to retrieve a node's list of IP addresses and ports
int32 portno = 2 [deprecated=true]; // The port number of the grpc server for the node. Usage is deprecated, NodeEndPoint is preferred to retrieve a node's list of IP addresses and ports
bytes ipAddress = 1 [deprecated=true]; // The IP address of the Node with separator & octets encoded in UTF-8. Usage is deprecated, ServiceEndpoint is preferred to retrieve a node's list of IP addresses and ports
int32 portno = 2 [deprecated=true]; // The port number of the grpc server for the node. Usage is deprecated, ServiceEndpoint is preferred to retrieve a node's list of IP addresses and ports
bytes memo = 3 [deprecated=true]; // Usage is deprecated, nodeAccountId is preferred to retrieve a node's account ID
string RSA_PubKey = 4; // The RSA public key of the node
int64 nodeId = 5; // A non-sequential identifier for the node
AccountID nodeAccountId = 6; // The account to be paid for queries and transactions sent to this node
bytes nodeCertHash = 7; // A hash of the X509 cert used for gRPC traffic to this node
repeated NodeEndpoint nodeEndpoint = 8; // A node's IP address and port
string description = 9; // A description of the node. Max 100 bytes.
int64 stake = 10; // The amount of tinybars staked to this node
string RSA_PubKey = 4; // The node's hex-encoded X509 RSA public key
int64 nodeId = 5; // # A non-sequential identifier for the node
AccountID nodeAccountId = 6; // # The account to be paid for queries and transactions sent to this node
bytes nodeCertHash = 7; // # The hex-encoded SHA-384 hash of the X509 cert used to encrypt gRPC traffic to the node
repeated ServiceEndpoint serviceEndpoint = 8; // # A node's service IP addresses and ports
string description = 9; // A description of the node, with UTF-8 encoding up to 100 bytes
int64 stake = 10; // The amount of tinybars staked to the node
}

/*
A list of nodes and their metadata that contains all details of the nodes for the network
*/
message AddressBook {
repeated NodeAddress nodeAddress = 1; // Metadata of nodes on the network
}

/* All the information required to connect to the network.*/
message NodeAddressForClients {
int64 nodeId = 5; // A non-sequential identifier for the node. This value is the key between the full and abbreviated address books
AccountID nodeAccountId = 6; // The account to be paid for queries and transactions sent to this node
bytes nodeCertHash = 7; // A hash of the X509 cert used for gRPC traffic to this node
repeated NodeEndpoint nodeEndpoint = 8; // A node's IP address and port
}
A list of nodes and their metadata that contains all details of the nodes for the network.
/* A List of all nodes and just their information needed to connect to the network.*/
message AddressBookForClients {
repeated NodeAddressForClients nodeAddressForClients = 1; // Contains minimal node details for the network
Used to parse the contents of system files <tt>0.0.101</tt> and <tt>0.0.102</tt>.
*/
message NodeAddressBook {
repeated NodeAddress nodeAddress = 1; // Metadata of all nodes in the network
}

message SemanticVersion {
Expand Down
21 changes: 16 additions & 5 deletions services/ResponseCode.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ option java_package = "com.hederahashgraph.api.proto.java";
option java_multiple_files = true;

enum ResponseCodeEnum {

OK = 0; // The transaction passed the precheck validations.
INVALID_TRANSACTION = 1; // For any error not handled by specific error codes listed below.
PAYER_ACCOUNT_NOT_FOUND = 2; //Payer account does not exist.
Expand Down Expand Up @@ -215,8 +214,20 @@ enum ResponseCodeEnum {
INVALID_SCHEDULE_ACCOUNT_ID = 204; // The Schedule Create Transaction TransactionID account does not exist
NO_NEW_VALID_SIGNATURES = 205; // The provided sig map did not contain any new valid signatures from required signers of the scheduled transaction
UNRESOLVABLE_REQUIRED_SIGNERS = 206; // The required signers for a scheduled transaction cannot be resolved, for example because they do not exist or have been deleted
UNPARSEABLE_SCHEDULED_TRANSACTION = 207; // The bytes allegedly representing a transaction to be scheduled could not be parsed
UNSCHEDULABLE_TRANSACTION = 208; // ScheduleCreate and ScheduleSign transactions cannot be scheduled
SOME_SIGNATURES_WERE_INVALID = 209; // At least one of the signatures in the provided sig map did not represent a valid signature for any required signer
TRANSACTION_ID_FIELD_NOT_ALLOWED = 210; // The <tt>scheduled</tt> and <tt>nonce</tt> fields in the <tt>TransactionID</tt> may not be set in a top-level transaction
SCHEDULED_TRANSACTION_NOT_IN_WHITELIST = 207; // Only whitelisted transaction types may be scheduled
SOME_SIGNATURES_WERE_INVALID = 208; // At least one of the signatures in the provided sig map did not represent a valid signature for any required signer
TRANSACTION_ID_FIELD_NOT_ALLOWED = 209; // The scheduled field in the TransactionID may not be set to true
IDENTICAL_SCHEDULE_ALREADY_CREATED = 210; // A schedule already exists with the same identifying fields of an attempted ScheduleCreate (that is, all fields other than scheduledPayerAccountID)
INVALID_ZERO_BYTE_IN_STRING = 211; // A string field in the transaction has a UTF-8 encoding with the prohibited zero byte
SCHEDULE_ALREADY_DELETED = 212; // A schedule being signed or deleted has already been deleted
SCHEDULE_ALREADY_EXECUTED = 213; // A schedule being signed or deleted has already been executed
MESSAGE_SIZE_TOO_LARGE = 214; // ConsensusSubmitMessage request's message size is larger than allowed.
OPERATION_REPEATED_IN_BUCKET_GROUPS = 215; // An operation was assigned to more than one throttle group in a given bucket
BUCKET_CAPACITY_OVERFLOW = 216; // The capacity needed to satisfy all opsPerSec groups in a bucket overflowed a signed 8-byte integral type
NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION = 217; // Given the network size in the address book, the node-level capacity for an operation would never be enough to accept a single request; usually means a bucket burstPeriod should be increased
BUCKET_HAS_NO_THROTTLE_GROUPS = 218; // A bucket was defined without any throttle groups
THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC = 219; // A throttle group was granted zero opsPerSec
SUCCESS_BUT_MISSING_EXPECTED_OPERATION = 220; // The throttle definitions file was updated, but some supported operations were not assigned a bucket
UNPARSEABLE_THROTTLE_DEFINITIONS = 221; // The new contents for the throttle definitions system file were not valid protobuf
INVALID_THROTTLE_DEFINITIONS = 222; // The new throttle definitions system file were invalid, and no more specific error could be divined
}
114 changes: 114 additions & 0 deletions services/SchedulableTransactionBody.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
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 "SystemDelete.proto";
import "SystemUndelete.proto";
import "Freeze.proto";

import "ContractCall.proto";
import "ContractCreate.proto";
import "ContractUpdate.proto";

import "CryptoCreate.proto";
import "CryptoDelete.proto";
import "CryptoTransfer.proto";
import "CryptoUpdate.proto";

import "FileAppend.proto";
import "FileCreate.proto";
import "FileDelete.proto";
import "FileUpdate.proto";

import "ContractDelete.proto";

import "ConsensusCreateTopic.proto";
import "ConsensusUpdateTopic.proto";
import "ConsensusDeleteTopic.proto";
import "ConsensusSubmitMessage.proto";

import "TokenCreate.proto";
import "TokenFreezeAccount.proto";
import "TokenUnfreezeAccount.proto";
import "TokenGrantKyc.proto";
import "TokenRevokeKyc.proto";
import "TokenDelete.proto";
import "TokenUpdate.proto";
import "TokenMint.proto";
import "TokenBurn.proto";
import "TokenWipeAccount.proto";
import "TokenAssociate.proto";
import "TokenDissociate.proto";

import "ScheduleDelete.proto";

/* A schedulable transaction. Note that the global/dynamic system property
<tt>scheduling.whitelist</tt> controls which transaction types may be scheduled.
In Hedera Services 0.13.0, it will include only <tt>CryptoTransfer</tt> and
<tt>ConsensusSubmitMessage</tt> functions. */
message SchedulableTransactionBody {
uint64 transactionFee = 1; // The maximum transaction fee the client is willing to pay
string memo = 2; // A memo to include the execution record; the UTF-8 encoding may be up to 100 bytes and must not include the zero byte
oneof data {
ContractCallTransactionBody contractCall = 3; // Calls a function of a contract instance
ContractCreateTransactionBody contractCreateInstance = 4; // Creates a contract instance
ContractUpdateTransactionBody contractUpdateInstance = 5; // Updates a contract
ContractDeleteTransactionBody contractDeleteInstance = 6; //Delete contract and transfer remaining balance into specified account

CryptoCreateTransactionBody cryptoCreateAccount = 7; // Create a new cryptocurrency account
CryptoDeleteTransactionBody cryptoDelete = 8; // Delete a cryptocurrency account (mark as deleted, and transfer hbars out)
CryptoTransferTransactionBody cryptoTransfer = 9; // Transfer amount between accounts
CryptoUpdateTransactionBody cryptoUpdateAccount = 10; // Modify information such as the expiration date for an account

FileAppendTransactionBody fileAppend = 11; // Add bytes to the end of the contents of a file
FileCreateTransactionBody fileCreate = 12; // Create a new file
FileDeleteTransactionBody fileDelete = 13; // Delete a file (remove contents and mark as deleted until it expires)
FileUpdateTransactionBody fileUpdate = 14; // Modify information such as the expiration date for a file
SystemDeleteTransactionBody systemDelete = 15; // Hedera administrative deletion of a file or smart contract
SystemUndeleteTransactionBody systemUndelete = 16; //To undelete an entity deleted by SystemDelete
FreezeTransactionBody freeze = 17; // Freeze the nodes

ConsensusCreateTopicTransactionBody consensusCreateTopic = 18; // Creates a topic
ConsensusUpdateTopicTransactionBody consensusUpdateTopic = 19; // Updates a topic
ConsensusDeleteTopicTransactionBody consensusDeleteTopic = 20; // Deletes a topic
ConsensusSubmitMessageTransactionBody consensusSubmitMessage = 21; // Submits message to a topic

TokenCreateTransactionBody tokenCreation = 22; // Creates a token instance
TokenFreezeAccountTransactionBody tokenFreeze = 23; // Freezes account not to be able to transact with a token
TokenUnfreezeAccountTransactionBody tokenUnfreeze = 24; // Unfreezes account for a token
TokenGrantKycTransactionBody tokenGrantKyc = 25; // Grants KYC to an account for a token
TokenRevokeKycTransactionBody tokenRevokeKyc = 26; // Revokes KYC of an account for a token
TokenDeleteTransactionBody tokenDeletion = 27; // Deletes a token instance
TokenUpdateTransactionBody tokenUpdate = 28; // Updates a token instance
TokenMintTransactionBody tokenMint = 29; // Mints new tokens to a token's treasury account
TokenBurnTransactionBody tokenBurn = 30; // Burns tokens from a token's treasury account
TokenWipeAccountTransactionBody tokenWipe = 31; // Wipes amount of tokens from an account
TokenAssociateTransactionBody tokenAssociate = 32; // Associate tokens to an account
TokenDissociateTransactionBody tokenDissociate = 33; // Dissociate tokens from an account

ScheduleDeleteTransactionBody scheduleDelete = 34; // Marks a schedule in the network's action queue as deleted, preventing it from executing
}
}
Loading

0 comments on commit f770bbb

Please sign in to comment.