From 9e65bc79ce72f1484e080827ac2173b569ad92e4 Mon Sep 17 00:00:00 2001 From: Neeharika Sompalli <52669918+Neeharika-Sompalli@users.noreply.github.com> Date: Tue, 15 Aug 2023 08:46:05 -0500 Subject: [PATCH 1/8] Updated comments to prevent "unmappable character (0xXX) for encoding UTF-8" errors. (#301) * fix - Signed-off-by: Neeharika-Sompalli * Updated comments to prevent "unmappable character (0xXX) for encoding UTF-8" errors. --------- Signed-off-by: Neeharika-Sompalli --- services/basic_types.proto | 2 +- services/contract_call.proto | 4 ++-- services/schedule_create.proto | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/basic_types.proto b/services/basic_types.proto index 449e3d97..5e409f7d 100644 --- a/services/basic_types.proto +++ b/services/basic_types.proto @@ -1236,7 +1236,7 @@ message TransactionFeeSchedule { } /** - * The total fee charged for a transaction. It is composed of three components – a node fee that + * The total fee charged for a transaction. It is composed of three components - a node fee that * compensates the specific node that submitted the transaction, a network fee that compensates the * network for assigning the transaction a consensus timestamp, and a service fee that compensates * the network for the ongoing maintenance of the consequences of the transaction. diff --git a/services/contract_call.proto b/services/contract_call.proto index a6d5d3f7..5d55d3f3 100644 --- a/services/contract_call.proto +++ b/services/contract_call.proto @@ -30,14 +30,14 @@ import "basic_types.proto"; /** * Call a function of the given smart contract instance, giving it functionParameters as its inputs. - * The call can use at maximum the given amount of gas – the paying account will not be charged for + * The call can use at maximum the given amount of gas - the paying account will not be charged for * any unspent gas. * * If this function results in data being stored, an amount of gas is calculated that reflects this * storage burden. * * The amount of gas used, as well as other attributes of the transaction, e.g. size, number of - * signatures to be verified, determine the fee for the transaction – which is charged to the paying + * signatures to be verified, determine the fee for the transaction - which is charged to the paying * account. */ message ContractCallTransactionBody { diff --git a/services/schedule_create.proto b/services/schedule_create.proto index 8ae7f695..49804a21 100644 --- a/services/schedule_create.proto +++ b/services/schedule_create.proto @@ -123,7 +123,7 @@ message ScheduleCreateTransactionBody { * Setting this to false does not necessarily mean that the transaction will never execute at expiration_time. * For Example - If the signature requirements for a Scheduled Transaction change via external means (e.g. CryptoUpdate) * such that the Scheduled Transaction would be allowed to execute, it will do so autonomously at expiration_time, unless a - * ScheduleSign comes in to “poke” it and force it to go through immediately. + * ScheduleSign comes in to "poke" it and force it to go through immediately. * * Note: This field is unused and forced to be unset until Long Term Scheduled Transactions are enabled. Before Long Term * Scheduled Transactions are enabled, Scheduled Transactions will _never_ execute at expiration - they will _only_ From 813199c44740c269b536689e09236c264f78523c Mon Sep 17 00:00:00 2001 From: Kim Rader Date: Wed, 16 Aug 2023 10:26:50 -0700 Subject: [PATCH 2/8] protobuf cleanup (#298) Signed-off-by: Kim Rader --- services/crypto_get_account_balance.proto | 1 - services/crypto_get_info.proto | 1 - services/freeze.proto | 1 - services/response_header.proto | 1 - services/state/consensus/topic.proto | 8 +++--- services/state/contract/storage_slot.proto | 6 ++--- services/state/file/file.proto | 7 +++-- services/state/schedule/schedule.proto | 27 +++++++++---------- services/state/token/account.proto | 20 +++++++------- .../state/token/network_staking_rewards.proto | 6 ++--- services/state/token/nft.proto | 4 +-- services/state/token/staking_node_info.proto | 4 +-- services/state/token/token.proto | 12 ++++----- services/state/token/token_relation.proto | 2 +- services/transaction.proto | 2 -- 15 files changed, 45 insertions(+), 57 deletions(-) diff --git a/services/crypto_get_account_balance.proto b/services/crypto_get_account_balance.proto index 062b44de..fdca3e8f 100644 --- a/services/crypto_get_account_balance.proto +++ b/services/crypto_get_account_balance.proto @@ -29,7 +29,6 @@ option java_multiple_files = true; import "basic_types.proto"; import "query_header.proto"; import "response_header.proto"; -import "timestamp.proto"; /** * Get the balance of a cryptocurrency account. This returns only the balance, so it is a smaller diff --git a/services/crypto_get_info.proto b/services/crypto_get_info.proto index 5fe6804c..f41dc70e 100644 --- a/services/crypto_get_info.proto +++ b/services/crypto_get_info.proto @@ -32,7 +32,6 @@ import "basic_types.proto"; import "query_header.proto"; import "response_header.proto"; import "crypto_add_live_hash.proto"; -import "google/protobuf/wrappers.proto"; /** * Get all the information about an account, including the balance. This does not get the list of diff --git a/services/freeze.proto b/services/freeze.proto index d7aa092b..6b68aca9 100644 --- a/services/freeze.proto +++ b/services/freeze.proto @@ -26,7 +26,6 @@ option java_package = "com.hederahashgraph.api.proto.java"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; -import "duration.proto"; import "timestamp.proto"; import "basic_types.proto"; import "freeze_type.proto"; diff --git a/services/response_header.proto b/services/response_header.proto index 195328ba..026e8f83 100644 --- a/services/response_header.proto +++ b/services/response_header.proto @@ -26,7 +26,6 @@ option java_package = "com.hederahashgraph.api.proto.java"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; -import "transaction_response.proto"; import "query_header.proto"; import "response_code.proto"; diff --git a/services/state/consensus/topic.proto b/services/state/consensus/topic.proto index 553b34c1..09e62cfa 100644 --- a/services/state/consensus/topic.proto +++ b/services/state/consensus/topic.proto @@ -29,7 +29,7 @@ option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; /** - * First-draft representation of a Hedera Consensus Service topic in the network Merkle tree. + * Representation of a Hedera Consensus Service topic in the network Merkle tree. * * As with all network entities, a topic has a unique entity number, which is usually given along * with the network's shard and realm in the form of a shard.realm.number id. @@ -51,9 +51,9 @@ option java_multiple_files = true; */ message Topic { /** - * The topic's unique id number in the Merkle state. + * The topic's unique id in the Merkle state. */ - TopicID id = 1; + TopicID topic_id = 1; /** * The number of messages sent to the topic. */ @@ -61,7 +61,7 @@ message Topic { /** * The topic's consensus expiration time in seconds since the epoch. */ - int64 expiry = 3; + int64 expiration_second = 3; /** * The number of seconds for which the topic will be automatically renewed * upon expiring (if it has a valid auto-renew account). diff --git a/services/state/contract/storage_slot.proto b/services/state/contract/storage_slot.proto index 5511d112..8465cd5a 100644 --- a/services/state/contract/storage_slot.proto +++ b/services/state/contract/storage_slot.proto @@ -22,8 +22,6 @@ package proto; * ‍ */ -import "state/common.proto"; - option java_package = "com.hederahashgraph.api.proto.java"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -48,8 +46,8 @@ message SlotKey { /** * The value of a contract storage slot. For the EVM, this is a single word. * - * But because we need to be able to iterate through all the storage slots for an - * expired contract when purging it from state, our slot values also include the words + * Because we iterate through all the storage slots for an expired contract + * when purging it from state, our slot values also include the words * of the previous and next keys in this contract's storage "list". */ message SlotValue { diff --git a/services/state/file/file.proto b/services/state/file/file.proto index 61769c00..123d17ac 100644 --- a/services/state/file/file.proto +++ b/services/state/file/file.proto @@ -23,16 +23,15 @@ package proto; */ import "basic_types.proto"; -import "timestamp.proto"; option java_package = "com.hederahashgraph.api.proto.java"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; /** - * First-draft representation of a Hedera Token Service file in the network Merkle tree. + * Representation of a Hedera Token Service file in the network Merkle tree. * - * As with all network entities, a file has a unique entity number, which is usually given along + * As with all network entities, a file has a unique entity number, which is given along * with the network's shard and realm in the form of a shard.realm.number id. */ message File { @@ -43,7 +42,7 @@ message File { /** * The file's consensus expiration time in seconds since the epoch. */ - int64 expiration_time = 2; + int64 expiration_second = 2; /** * All keys at the top level of a key list must sign to create, modify and delete the file. */ diff --git a/services/state/schedule/schedule.proto b/services/state/schedule/schedule.proto index dc5d0f49..77ebcff1 100644 --- a/services/state/schedule/schedule.proto +++ b/services/state/schedule/schedule.proto @@ -38,18 +38,22 @@ option java_multiple_files = true; * with the network's shard and realm in the form of a shard.realm.number id. */ message Schedule { + /** + * This schedule's unique ID within the global network state. + */ + ScheduleID schedule_id = 1; /** * The schedule deleted flag * A schedule will either be executed or deleted, but never both. */ - bool deleted = 1; + bool deleted = 2; /** * The schedule executed flag * A schedule will either be executed or deleted, but never both. */ - bool executed = 2; + bool executed = 3; /** * The schedule flag to wait for expiration @@ -61,29 +65,24 @@ message Schedule { * Note that a schedule is always removed from state when it expires, regardless of whether it * was executed or not. */ - bool wait_for_expiry = 3; + bool wait_for_expiry = 4; /** * The memo associated with this schedule. */ - string memo = 4; - - /** - * This schedule's unique ID within the global network state. - */ - ScheduleID id = 5; + string memo = 5; /** * The schedule account for this schedule. This is the account that submitted the original * ScheduleCreate transaction. */ - AccountID scheduler_account = 6; + AccountID scheduler_account_id = 6; /** * The explicit payer account for the scheduled transaction. * This account is added to the accounts that must sign the schedule before it will execute. */ - AccountID payer_account = 7; + AccountID payer_account_id = 7; /** * The admin key for this schedule. @@ -100,7 +99,7 @@ message Schedule { * The requested expiration time of the schedule as provided by the user. * The actual calculated expiration time may be "earlier" than this, but will not be later. */ - Timestamp expiration_time_provided = 10; + int64 provided_expiration_second = 10; /** * The calculated expiration time of the schedule. This is calculated based on the requested @@ -109,7 +108,7 @@ message Schedule { * The schedule will be removed from global network state after the network reaches a consensus * time greater than or equal to this value. */ - Timestamp calculated_expiration_time = 11; + int64 calculated_expiration_second = 11; /** * The consensus timestamp of the transaction that executed or deleted this schedule. @@ -145,5 +144,5 @@ message ScheduleList { /** * a list of schedules, in no particular order. */ - repeated Schedule schedules = 2; + repeated Schedule schedules = 1; } diff --git a/services/state/token/account.proto b/services/state/token/account.proto index 694dc072..c3ada2c2 100644 --- a/services/state/token/account.proto +++ b/services/state/token/account.proto @@ -30,11 +30,10 @@ option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; /** - * First-draft representation of a Hedera Token Service account entity in the network Merkle tree. + * Representation of a Hedera Token Service account entity in the network Merkle tree. * - * As with all network entities, account has an unique entity number represented as shard.realm.X. + * As with all network entities, account has a unique entity number represented as shard.realm.X. * X can be an alias public key or an EVM address or a number. - * */ message Account { @@ -55,7 +54,7 @@ message Account { /** * The expiration time of the account, in seconds since the epoch. */ - int64 expiry = 4; + int64 expiration_second = 4; /** * The balance of the account, in tiny-bars. */ @@ -82,17 +81,16 @@ message Account { * ID of the account or node to which this account is staking. */ oneof staked_id { - /** * ID of the new account to which this account is staking. If set to the sentinel 0.0.0 AccountID, * this field removes this account's staked account ID. */ AccountID staked_account_id = 10; - /** - * ID of the new node this account is staked to. If set to the sentinel -1, this field - * removes this account's staked node ID. - */ + /** + * ID of the new node this account is staked to. If set to the sentinel -1, this field + * removes this account's staked node ID. + */ int64 staked_node_id = 11; } /** @@ -158,10 +156,10 @@ message Account { /** * The number of seconds the network should automatically extend the account's expiration by, if the * account has a valid auto-renew account, and is not deleted upon expiration. - * If this is not provided in a allowed range on account creation, the transaction will fail with INVALID_AUTO_RENEWAL_PERIOD. + * If this is not provided in an allowed range on account creation, the transaction will fail with INVALID_AUTO_RENEWAL_PERIOD. * The default values for the minimum period and maximum period are 30 days and 90 days, respectively. */ - int64 auto_renew_secs = 26; + int64 auto_renew_seconds = 26; /** * If this account is a smart-contract, number of key-value pairs stored on the contract. * This is used to determine the storage rent for the contract. diff --git a/services/state/token/network_staking_rewards.proto b/services/state/token/network_staking_rewards.proto index fead4b5a..8a30dbf0 100644 --- a/services/state/token/network_staking_rewards.proto +++ b/services/state/token/network_staking_rewards.proto @@ -27,12 +27,12 @@ option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; /** - * First-draft representation of a Hedera Token Service staking reward entity in the network Merkle tree. - * This consist of all the information needed to calculate the staking rewards for all nodes in the network. It is + * Representation of a Hedera Token Service staking reward entity in the network Merkle tree. + * This consists of all the information needed to calculate the staking rewards for all nodes in the network. It is * calculated at the beginning of each staking period for all nodes and is needed to have same values * for reconnect. * - * As with all network entities, staking info is per node and has an unique entity number represented as shard.realm.X. + * As with all network entities, staking info is per node and has a unique entity number represented as shard.realm.X. */ message NetworkStakingRewards { diff --git a/services/state/token/nft.proto b/services/state/token/nft.proto index 8807609d..3e85a6e2 100644 --- a/services/state/token/nft.proto +++ b/services/state/token/nft.proto @@ -30,14 +30,14 @@ option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; /** - * First-draft representation of a Hedera Token Service NFT in the network Merkle tree. + * Representation of a Hedera Token Service NFT in the network Merkle tree. */ message Nft { /** * The id of this NFT. */ - NftID id = 1; + NftID nft_id = 1; /** * The account or contract id that owns this NFT. diff --git a/services/state/token/staking_node_info.proto b/services/state/token/staking_node_info.proto index 1be146f5..ad2c66be 100644 --- a/services/state/token/staking_node_info.proto +++ b/services/state/token/staking_node_info.proto @@ -30,9 +30,9 @@ option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; /** - * First-draft representation of a Hedera Token Service staking info entity in the network Merkle tree. + * Representation of a Hedera Token Service staking info entity in the network Merkle tree. * - * As with all network entities, staking info is per node and has an unique entity number represented as shard.realm.X. + * As with all network entities, staking info is per node and has a unique entity number represented as shard.realm.X. */ message StakingNodeInfo { /** diff --git a/services/state/token/token.proto b/services/state/token/token.proto index 0566692c..c90201c1 100644 --- a/services/state/token/token.proto +++ b/services/state/token/token.proto @@ -30,7 +30,7 @@ option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; /** - * First-draft representation of a Hedera Token Service token entity in the network Merkle tree. + * Representation of a Hedera Token Service token entity in the network Merkle tree. * * As with all network entities, a token has a unique entity number, which is usually given along * with the network's shard and realm in the form of a shard.realm.number id. @@ -42,7 +42,7 @@ message Token { */ TokenID token_id = 1; /** - * The human-readable name of this token and its not necessarily unique. Maximum length allowed is 100 bytes. + * The human-readable name of this token. Need not be unique. Maximum length allowed is 100 bytes. */ string name = 2; /** @@ -62,7 +62,7 @@ message Token { int64 total_supply = 5; /** * The treasury account id of this token. This account receives the initial supply of - * tokens as-well as the tokens from the Token Mint operation once executed. The balance + * tokens as well as the tokens from the Token Mint operation once executed. The balance * of the treasury account is decreased when the Token Burn operation is executed. */ AccountID treasury_account_id = 6; @@ -132,11 +132,11 @@ message Token { * If this is not provided in a allowed range on token creation, the transaction will fail with INVALID_AUTO_RENEWAL_PERIOD. * The default values for the minimum period and maximum period are 30 days and 90 days, respectively. */ - int64 auto_renew_secs = 19; + int64 auto_renew_seconds = 19; /** * The expiration time of the token, in seconds since the epoch. */ - int64 expiry = 20; + int64 expiration_second = 20; /** * An optional description of the token with UTF-8 encoding up to 100 bytes. */ @@ -154,7 +154,7 @@ message Token { */ bool accounts_frozen_by_default = 24; /** - * The flag indicating if this token has accounts associated to it that are KYC granted by default. + * The flag indicating if this token has accounts associated with it that are KYC granted by default. */ bool accounts_kyc_granted_by_default = 25; /** diff --git a/services/state/token/token_relation.proto b/services/state/token/token_relation.proto index 44ba191e..09bfc605 100644 --- a/services/state/token/token_relation.proto +++ b/services/state/token/token_relation.proto @@ -28,7 +28,7 @@ option java_package = "com.hederahashgraph.api.proto.java"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; /** - * First-draft representation of a Hedera Token Service token relationship entity in the network Merkle tree. + * Representation of a Hedera Token Service token relationship entity in the network Merkle tree. * * As with all network entities, a token relationship has a unique entity number pair, which is represented * with the account and the token involved in the relationship. diff --git a/services/transaction.proto b/services/transaction.proto index 940a6f54..50945d24 100644 --- a/services/transaction.proto +++ b/services/transaction.proto @@ -26,8 +26,6 @@ option java_package = "com.hederahashgraph.api.proto.java"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; - -import "duration.proto"; import "basic_types.proto"; import "transaction_body.proto"; From f36e05bd6bf3f572707ca9bb338f5ad6421a4241 Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Wed, 6 Sep 2023 11:48:29 -0500 Subject: [PATCH 3/8] Update `NodeStakeUpdateTransactionBody` fields for HIP-786 (#305) Update NodeStakeUpdateTransactionBody fields for HIP-786 Signed-off-by: Michael Tinker --- services/node_stake_update.proto | 41 +++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/services/node_stake_update.proto b/services/node_stake_update.proto index 00f3da62..740132ee 100644 --- a/services/node_stake_update.proto +++ b/services/node_stake_update.proto @@ -44,7 +44,8 @@ message NodeStakeUpdateTransactionBody { repeated NodeStake node_stake = 2; /** - * The maximum reward rate, in tinybars per whole hbar, that any account can receive in a day. + * The maximum reward rate, in tinybars per whole hbar, that any account could receive in this + * staking period. */ int64 max_staking_reward_rate_per_hbar = 3; @@ -77,9 +78,43 @@ message NodeStakeUpdateTransactionBody { int64 staking_start_threshold = 8; /** - * The total number of tinybars to be distributed as staking rewards each period. + * (DEPRECATED) The maximum total number of tinybars to be distributed as staking rewards in the + * ending period. Please consult the max_total_reward field instead. */ - int64 staking_reward_rate = 9; + int64 staking_reward_rate = 9 [deprecated = true]; + + /** + * The amount of the staking reward funds (account 0.0.800) reserved to pay pending rewards that + * have been earned but not collected. + */ + int64 reserved_staking_rewards = 10; + + /** + * The unreserved balance of account 0.0.800 at the close of the just-ending period; this value is + * used to compute the HIP-782 balance ratio. + */ + int64 unreserved_staking_reward_balance = 11; + + /** + * The unreserved tinybar balance of account 0.0.800 required to achieve the maximum per-hbar reward + * rate in any period; please see HIP-782 for details. + */ + int64 reward_balance_threshold = 12; + + /** + * The maximum amount of tinybar that can be staked for reward while still achieving the maximum + * per-hbar reward rate in any period; please see HIP-782 for details. + */ + int64 max_stake_rewarded = 13; + + /** + * The maximum total tinybars that could be paid as staking rewards in the ending period, after + * applying the settings for the 0.0.800 balance threshold and the maximum stake rewarded. This + * field replaces the deprecated field staking_reward_rate. It is only for convenience, since a + * mirror node could also calculate its value by iterating the node_stake list and summing + * stake_rewarded fields; then multiplying this sum by the max_staking_reward_rate_per_hbar. + */ + int64 max_total_reward = 14; } /** From a2130316c6a5535d8f807020f4b775771a8be97e Mon Sep 17 00:00:00 2001 From: Kim Rader Date: Wed, 13 Sep 2023 08:46:26 -0700 Subject: [PATCH 4/8] Add TransactionGetFastRecord to HederaFunctionality (#303) * Add TransactionGetFastRecord to HederaFunctionality Signed-off-by: Kim Rader --------- Signed-off-by: Kim Rader --- services/basic_types.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/basic_types.proto b/services/basic_types.proto index 736c8a24..8b3c3140 100644 --- a/services/basic_types.proto +++ b/services/basic_types.proto @@ -1165,6 +1165,11 @@ enum HederaFunctionality { * Generates a pseudorandom number. */ UtilPrng = 86; + + /** + * Get a record for a transaction. + */ + TransactionGetFastRecord = 87; } /** From fb10d6d39fb9d69f07f7aaf50d9535d1693e5125 Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Thu, 14 Sep 2023 19:58:22 -0500 Subject: [PATCH 5/8] Revert `NftID#tokenId` to `NftID#tokenID` (#306) * Revert NftID#tokenId to NftID#tokenID Signed-off-by: Michael Tinker * add pre_system_delete_expiration_second Signed-off-by: Lev Povolotsky --------- Signed-off-by: Michael Tinker Signed-off-by: Lev Povolotsky Co-authored-by: Lev Povolotsky --- services/basic_types.proto | 5 +++-- services/state/file/file.proto | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/services/basic_types.proto b/services/basic_types.proto index 8b3c3140..0266d20a 100644 --- a/services/basic_types.proto +++ b/services/basic_types.proto @@ -118,9 +118,10 @@ message AccountID { */ message NftID { /** - * The (non-fungible) token of which this NFT is an instance + * The (non-fungible) token of which this NFT is an instance; uppercase for "ID" + * for backward compatibility with original definition of this field. */ - TokenID token_id = 1; + TokenID token_ID = 1; /** * The serial number of this NFT within its token type diff --git a/services/state/file/file.proto b/services/state/file/file.proto index 123d17ac..2d1db68a 100644 --- a/services/state/file/file.proto +++ b/services/state/file/file.proto @@ -59,4 +59,9 @@ message File { * Whether this file is deleted. */ bool deleted = 6; + /** + * The pre system delete expiration time in seconds + */ + int64 pre_system_delete_expiration_second = 7; + } \ No newline at end of file From 2dff32501f81410834c0e6bdd4c4143114a1bc17 Mon Sep 17 00:00:00 2001 From: Miroslav Gatsanoga Date: Tue, 26 Sep 2023 14:25:00 +0300 Subject: [PATCH 6/8] Add throttle and congestion types (#304) * Add ThrottleUsageSnapshots type Signed-off-by: Miroslav Gatsanoga * Add CongestionLevelStarts type Signed-off-by: Miroslav Gatsanoga --------- Signed-off-by: Miroslav Gatsanoga --- .../congestion/congestion_level_starts.proto | 41 +++++++++++++++ .../throttles/throttle_usage_snapshots.proto | 52 +++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 services/state/congestion/congestion_level_starts.proto create mode 100644 services/state/throttles/throttle_usage_snapshots.proto diff --git a/services/state/congestion/congestion_level_starts.proto b/services/state/congestion/congestion_level_starts.proto new file mode 100644 index 00000000..552ccc14 --- /dev/null +++ b/services/state/congestion/congestion_level_starts.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2023 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. + * ‍ + */ + +import "timestamp.proto"; + +option java_package = "com.hederahashgraph.api.proto.java"; +// <<>> This comment is special code for setting PBJ Compiler java package +option java_multiple_files = true; + +message CongestionLevelStarts { + /** + * Timestamps defining generic congestion levels. + */ + repeated Timestamp generic_level_starts = 1; + + /** + * Timestamps defining gas congestion levels. + */ + repeated Timestamp gas_level_starts = 2; +} diff --git a/services/state/throttles/throttle_usage_snapshots.proto b/services/state/throttles/throttle_usage_snapshots.proto new file mode 100644 index 00000000..e162ccf9 --- /dev/null +++ b/services/state/throttles/throttle_usage_snapshots.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2023 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. + * ‍ + */ + +import "timestamp.proto"; + +option java_package = "com.hederahashgraph.api.proto.java"; +// <<>> This comment is special code for setting PBJ Compiler java package +option java_multiple_files = true; + +message ThrottleUsageSnapshots { + /** + * Snapshots for TPS throttles. + */ + repeated ThrottleUsageSnapshot tps_throttles = 1; + + /** + * Snapshots for gas throttle. + */ + ThrottleUsageSnapshot gas_throttle = 2; +} + +message ThrottleUsageSnapshot { + /** + * Used throttle capacity. + */ + int64 used = 1; + /** + * The last time at which the capacity was updated. + */ + Timestamp last_decision_time = 2; +} From 9861f330894d00d47823e00bdfa7376d630c212f Mon Sep 17 00:00:00 2001 From: Matt Hess Date: Tue, 14 Nov 2023 12:55:12 -0600 Subject: [PATCH 7/8] Add migration properties to BlockInfo (#310) Update `BlockInfo` to also include properties needed for migration records Signed-off-by: Matt Hess --- services/state/blockrecords/block_info.proto | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/services/state/blockrecords/block_info.proto b/services/state/blockrecords/block_info.proto index c11a91f7..b7aa59ec 100644 --- a/services/state/blockrecords/block_info.proto +++ b/services/state/blockrecords/block_info.proto @@ -29,7 +29,7 @@ option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; /** - * Information about the most recently completed and last 256 blocks. + * Information about ongoing, most recently completed, and last 256 blocks. */ message BlockInfo { /** @@ -47,4 +47,16 @@ message BlockInfo { * If we are shortly after genesis and there are less than 256 blocks then this could contain less than 256 hashes. */ bytes block_hashes = 3; + /** + * The consensus time of the last transaction that was handled by the node. This property is how we 'advance the + * consensus clock', i.e. continually setting this property to the latest consensus timestamp (and thus transaction) + * handled by the node. + */ + Timestamp cons_time_of_last_handled_txn = 4; + /** + * A flag indicating whether migration records have been published. This property should be marked 'false' + * immediately following a node upgrade, and marked 'true' once the migration records (if any) are published, which + * should happen during the first transaction handled by the node. + */ + bool migration_records_streamed = 5; } From 80c0c9cf452b1f1deb49e5bc11cfaeced6f0363e Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Fri, 8 Dec 2023 15:46:57 -0600 Subject: [PATCH 8/8] Add BlockInfo#first_cons_time_of_current_block Signed-off-by: Michael Tinker --- services/state/blockrecords/block_info.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/state/blockrecords/block_info.proto b/services/state/blockrecords/block_info.proto index b7aa59ec..2369d150 100644 --- a/services/state/blockrecords/block_info.proto +++ b/services/state/blockrecords/block_info.proto @@ -59,4 +59,9 @@ message BlockInfo { * should happen during the first transaction handled by the node. */ bool migration_records_streamed = 5; + /** + * The consensus time of the first transaction in the current block; necessary for reconnecting nodes to detect + * when the current block is finished. + */ + Timestamp first_cons_time_of_current_block = 6; }