Skip to content

Commit

Permalink
Merge branch 'add-first-cons-of-current-block-to-info' into use-Contr…
Browse files Browse the repository at this point in the history
…actID-in-SlotKey
  • Loading branch information
kimbor committed Jan 21, 2024
2 parents 98b8333 + 80c0c9c commit b087f00
Show file tree
Hide file tree
Showing 22 changed files with 211 additions and 67 deletions.
12 changes: 9 additions & 3 deletions services/basic_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1165,6 +1166,11 @@ enum HederaFunctionality {
* Generates a pseudorandom number.
*/
UtilPrng = 86;

/**
* Get a record for a transaction.
*/
TransactionGetFastRecord = 87;
}

/**
Expand Down Expand Up @@ -1251,7 +1257,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.
Expand Down
4 changes: 2 additions & 2 deletions services/contract_call.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion services/crypto_get_account_balance.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion services/crypto_get_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion services/freeze.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";
// <<<pbj.java_package = "com.hedera.hapi.node.freeze">>> 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";
Expand Down
41 changes: 38 additions & 3 deletions services/node_stake_update.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

/**
Expand Down
1 change: 0 additions & 1 deletion services/response_header.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";
// <<<pbj.java_package = "com.hedera.hapi.node.base">>> 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";

Expand Down
2 changes: 1 addition & 1 deletion services/schedule_create.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down
19 changes: 18 additions & 1 deletion services/state/blockrecords/block_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand All @@ -47,4 +47,21 @@ 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;
/**
* 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;
}
41 changes: 41 additions & 0 deletions services/state/congestion/congestion_level_starts.proto
Original file line number Diff line number Diff line change
@@ -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";
// <<<pbj.java_package = "com.hedera.hapi.node.state.congestion">>> 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;
}
8 changes: 4 additions & 4 deletions services/state/consensus/topic.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -51,17 +51,17 @@ 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.
*/
int64 sequence_number = 2;
/**
* 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).
Expand Down
6 changes: 2 additions & 4 deletions services/state/contract/storage_slot.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ package proto;
* ‍
*/

import "state/common.proto";

option java_package = "com.hederahashgraph.api.proto.java";
// <<<pbj.java_package = "com.hedera.hapi.node.state.contract">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;
Expand All @@ -50,8 +48,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 {
Expand Down
12 changes: 8 additions & 4 deletions services/state/file/file.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@ package proto;
*/

import "basic_types.proto";
import "timestamp.proto";

option java_package = "com.hederahashgraph.api.proto.java";
// <<<pbj.java_package = "com.hedera.hapi.node.state.file">>> 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 {
Expand All @@ -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.
*/
Expand All @@ -60,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;

}
27 changes: 13 additions & 14 deletions services/state/schedule/schedule.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -145,5 +144,5 @@ message ScheduleList {
/**
* a list of schedules, in no particular order.
*/
repeated Schedule schedules = 2;
repeated Schedule schedules = 1;
}
Loading

0 comments on commit b087f00

Please sign in to comment.