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

Add reserved_staking_rewards field to NodeStakeUpdateTransactionBody #300

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8f63739
Initial draft of PBJ types for token state (#263)
Neeharika-Sompalli Apr 12, 2023
618854f
file proto (#267)
povolev15 Apr 14, 2023
7bbf1d5
Change allowance maps on `Account` PBJ Object (#269)
Neeharika-Sompalli Apr 18, 2023
f6aadf0
fix some comments on file proto (#268)
povolev15 May 1, 2023
d336767
Add missing fields in Account (#270)
Neeharika-Sompalli May 8, 2023
ad7d2c0
Add the TransactionRecordEntry type for the record cache.
rbair23 May 23, 2023
4a6c9ff
Add payer account ID
rbair23 May 24, 2023
f471f22
Merge branch 'main' into add-pbj-types-for-state
Neeharika-Sompalli May 31, 2023
c858be6
Include `ContractService` state types (#273)
tinker-michaelj Jun 1, 2023
96774e9
Added state for blocks and running hashes (#276)
jasperpotts Jun 1, 2023
2bbbee4
Add `StakingNodeInfo` for MerkleStakingInfo (#277)
Neeharika-Sompalli Jun 8, 2023
5bcd7e8
add schedule proto (#280)
povolev15 Jun 16, 2023
0adaa8b
Fixing incorrect case for Timestamp. (#282)
jsync-swirlds Jun 16, 2023
413f7cd
Adding missed import statement. (#283)
jsync-swirlds Jun 16, 2023
faee2f6
Fix package name for state/schedule (#284)
jsync-swirlds Jun 20, 2023
3568673
change topic number to topicID (#286)
povolev15 Jun 21, 2023
70ca376
Update file.proto to use FileID type instead of long for file identif…
kimbor Jun 22, 2023
c524a89
Adjusting the state Schedule message to improve implementation. (#288)
jsync-swirlds Jun 27, 2023
280f440
Change nft owner and spender identifier from long to AccountID (#289)
kimbor Jun 28, 2023
89b75cb
Update common.proto, token.proto, token-relation.protp and classes th…
iwsimon Jun 30, 2023
e1b59db
Use NftID instead of UniqueTokenId (#292)
kimbor Jul 8, 2023
095591b
changed auto_renew_account_number to auto_renew_account_id in topic.p…
iwsimon Jul 10, 2023
2554e80
Add Staking Reward related fields from `MerkleNetworkContext` (#295)
Neeharika-Sompalli Jul 14, 2023
7051729
use snake case throughout protobufs (#294)
iwsimon Jul 17, 2023
003ff39
Update Schedule state protobuf to add a wait_for_expiry flag. (#297)
jsync-swirlds Jul 17, 2023
0bb5c4b
update account ids (#291)
kimbor Jul 20, 2023
91a53b3
Add Protobuf messages for primitive values and a list of Schedules. (…
jsync-swirlds Aug 3, 2023
e55d721
Add reserved_staking_rewards field
tinker-michaelj Aug 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ must be paid in ℏ from a cryptocurrency account. The payer authorizes a
fee by signing an appropriate transaction with a sufficient subset of the
Ed25519 key(s) associated to their account.

## Overview of state
State directory and its subdirectories contain the protobuf files that define the state of the network.
The state is divided into the following subdirectories, based on the service modules:
1. [Token](services/state/token) - The state of the Token service.
2. [Consensus](services/state/consensus) - The state of the Consensus service.

The state directory and its subdirectories are in preview and are subject to change.

# For Developers

## Branching
Expand Down
15 changes: 15 additions & 0 deletions services/basic_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ message AccountID {
}
}

/**
* Identifier for a unique token (or "NFT"), used by both contract and token services.
*/
message NftID {
/**
* The (non-fungible) token of which this NFT is an instance
*/
TokenID token_id = 1;

/**
* The serial number of this NFT within its token type
*/
int64 serial_number = 2;
}

/**
* The ID for a file
*/
Expand Down
6 changes: 6 additions & 0 deletions services/node_stake_update.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ message NodeStakeUpdateTransactionBody {
* The total number of tinybars to be distributed as staking rewards each period.
*/
int64 staking_reward_rate = 9;

/**
* 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;
}

/**
Expand Down
50 changes: 50 additions & 0 deletions services/state/blockrecords/block_info.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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.blockrecords">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
* Information about the most recently completed and last 256 blocks.
*/
message BlockInfo {
/**
* The last block number, this is the last completed immutable block.
*/
int64 last_block_number = 1;
/**
* The consensus time of the first transaction of the last block, this is the last completed immutable block.
*/
Timestamp first_cons_time_of_last_block = 2;
/**
* SHA384 48 byte hashes of the last 256 blocks in single byte array.
* First 48 bytes is the oldest block.
* Last 48 bytes is the newest block, which is the last fully completed immutable block.
* 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;
}
50 changes: 50 additions & 0 deletions services/state/blockrecords/running_hashes.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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.
* ‍
*/

option java_package = "com.hederahashgraph.api.proto.java";
// <<<pbj.java_package = "com.hedera.hapi.node.state.blockrecords">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
* The running hash of a transaction records and the previous 3 running hashes. All hashes are 48 bytes SHA384 hashes. If the
* running hashes do not exist yet then they will be default values witch is empty bytes object or zero length byte array.
*/
message RunningHashes {
/**
* A running hash of all record stream items
*/
bytes running_hash = 1;
/**
* The previous running hash of all record stream items
*/
bytes n_minus_1_running_hash = 2;
/**
* The previous, previous running hash of all record stream items
*/
bytes n_minus_2_running_hash = 3;
/**
* The previous, previous, previous running hash of all record stream items
*/
bytes n_minus_3_running_hash = 4;
}
43 changes: 43 additions & 0 deletions services/state/common.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
syntax = "proto3";
import "basic_types.proto";

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.
* ‍
*/

option java_package = "com.hederahashgraph.api.proto.java";
// <<<pbj.java_package = "com.hedera.hapi.node.state.common">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
* A single 64-bit number identifying a Hedera native entity.
*/
message EntityNumber {
int64 number = 1;
}

/**
* Pair of AccountID and TokenID to represent TokenRelation
*/
message EntityIDPair {
AccountID account_id = 1;
TokenID token_id = 2;
}
8 changes: 4 additions & 4 deletions services/state/consensus/topic.proto
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ option java_multiple_files = true;
*/
message Topic {
/**
* The topic's unique entity number in the Merkle state.
* The topic's unique id number in the Merkle state.
*/
int64 topic_number = 1;
TopicID id = 1;
/**
* The number of messages sent to the topic.
*/
Expand All @@ -68,10 +68,10 @@ message Topic {
*/
int64 auto_renew_period = 4;
/**
* The number of the account (if any) that the network will attempt to charge for the
* The id of the account (if any) that the network will attempt to charge for the
* topic's auto-renewal upon expiration.
*/
int64 auto_renew_account_number = 5;
AccountID auto_renew_account_id = 5;
/**
* Whether this topic is deleted.
*/
Expand Down
37 changes: 37 additions & 0 deletions services/state/contract/bytecode.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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.
* ‍
*/

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;

/**
* The bytecode for a contract id.
*/
message Bytecode {
/**
* The raw bytes (not hex-encoded) of a contract's bytecode.
*/
bytes code = 1;
}
70 changes: 70 additions & 0 deletions services/state/contract/storage_slot.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
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 "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;

/**
* The key of a storage slot. A slot is scoped to a specific contract number.
*
* For each contract, its EVM storage is a mapping of 256-bit keys (or "words") to 256-bit values.
*/
message SlotKey {
/**
* The number of the contract whose storage this slot belongs to.
*/
int64 contract_number = 1;

/**
* The EVM key of this slot, when left-padded with zeros to form a 256-bit word.
*/
bytes key = 2;
}

/**
* 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
* of the previous and next keys in this contract's storage "list".
*/
message SlotValue {
/**
* The EVM value in this slot, when left-padded with zeros to form a 256-bit word.
*/
bytes value = 1;

/**
* The word of the previous key in this contract's storage list (if any).
*/
bytes previous_key = 2;

/**
* The word of the next key in this contract's storage list (if any).
*/
bytes next_key = 3;
}
63 changes: 63 additions & 0 deletions services/state/file/file.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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 "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.
*
* As with all network entities, a file 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.
*/
message File {
/**
* The file's unique file identifier in the Merkle state.
*/
FileID file_id = 1;
/**
* The file's consensus expiration time in seconds since the epoch.
*/
int64 expiration_time = 2;
/**
* All keys at the top level of a key list must sign to create, modify and delete the file.
*/
KeyList keys = 3;
/**
* The bytes that are the contents of the file
*/
bytes contents = 4;
/**
* The memo associated with the file (UTF-8 encoding max 100 bytes)
*/
string memo = 5;
/**
* Whether this file is deleted.
*/
bool deleted = 6;
}
Loading