Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protobuf cleanup #298

Merged
merged 10 commits into from
Aug 16, 2023
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_seconds = 3;
jsync-swirlds marked this conversation as resolved.
Show resolved Hide resolved
/**
* The number of seconds for which the topic will be automatically renewed
* upon expiring (if it has a valid auto-renew account).
Expand Down
4 changes: 2 additions & 2 deletions services/state/contract/storage_slot.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,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
6 changes: 3 additions & 3 deletions services/state/file/file.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 +43,7 @@ message File {
/**
* The file's consensus expiration time in seconds since the epoch.
*/
int64 expiration_time = 2;
int64 expiration_seconds = 2;
jsync-swirlds marked this conversation as resolved.
Show resolved Hide resolved
/**
* All keys at the top level of a key list must sign to create, modify and delete the file.
*/
Expand Down
4 changes: 2 additions & 2 deletions services/state/primitives.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ package proto;
* type instead.
*/

option java_package = "com.hederahashgraph.api.proto.java.primitive";
// <<<pbj.java_package = "com.hedera.hapi.node.state.primitive">>> This comment is special code for setting PBJ Compiler java package
option java_package = "com.hederahashgraph.api.proto.java";
// <<<pbj.java_package = "com.hedera.hapi.node.state.primitives">>> This comment is special code for setting PBJ Compiler java package
jsync-swirlds marked this conversation as resolved.
Show resolved Hide resolved
option java_multiple_files = true;

/**
Expand Down
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;
jsync-swirlds marked this conversation as resolved.
Show resolved Hide resolved

/**
* 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_seconds = 10;
jsync-swirlds marked this conversation as resolved.
Show resolved Hide resolved

/**
* 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_seconds = 11;
jsync-swirlds marked this conversation as resolved.
Show resolved Hide resolved

/**
* 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;
}
22 changes: 10 additions & 12 deletions services/state/token/account.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -45,7 +44,7 @@ message Account {
/**
* The alias to use for this account, if any.
*/
bytes alias = 2;
bytes alias = 22;
/**
* (Optional) The key to be used to sign transactions from the account, if any.
* This key will not be set for hollow accounts until the account is finalized.
Expand All @@ -55,7 +54,7 @@ message Account {
/**
* The expiration time of the account, in seconds since the epoch.
*/
int64 expiry = 4;
int64 expiration_seconds = 4;
jsync-swirlds marked this conversation as resolved.
Show resolved Hide resolved
/**
* The balance of the account, in tiny-bars.
*/
Expand All @@ -82,18 +81,17 @@ message Account {
* ID of the account or node to which this account is staking.
*/
oneof staked_id {
/**
* ID of the new node this account is staked to. If set to the sentinel <tt>-1</tt>, this field
* removes this account's staked node ID.
*/
int64 staked_node_id = 10;

/**
* ID of the new account to which this account is staking. If set to the sentinel <tt>0.0.0</tt> 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 <tt>-1</tt>, this field
* removes this account's staked node ID.
*/
int64 staked_node_id = 11;
AccountID staked_account_id = 11;
}
/**
* A boolean marking if the account declines rewards.
Expand Down
6 changes: 3 additions & 3 deletions services/state/token/network_staking_rewards.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
4 changes: 2 additions & 2 deletions services/state/token/nft.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions services/state/token/staking_node_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
10 changes: 5 additions & 5 deletions services/state/token/token.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
/**
Expand All @@ -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;
Expand Down Expand Up @@ -136,7 +136,7 @@ message Token {
/**
* The expiration time of the token, in seconds since the epoch.
*/
int64 expiry = 20;
int64 expiration_seconds = 20;
jsync-swirlds marked this conversation as resolved.
Show resolved Hide resolved
/**
* An optional description of the token with UTF-8 encoding up to 100 bytes.
*/
Expand All @@ -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;
/**
Expand Down
2 changes: 1 addition & 1 deletion services/state/token/token_relation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ option java_package = "com.hederahashgraph.api.proto.java";
// <<<pbj.java_package = "com.hedera.hapi.node.state.token">>> 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.
Expand Down