Skip to content

Commit 9693d90

Browse files
authored
Merge pull request #208 from exploreriii/proto-prompt
feat: proto prompt
2 parents 7c1b220 + 62bc0f1 commit 9693d90

306 files changed

Lines changed: 51206 additions & 11 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coderabbit.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ reviews:
1818
in_progress_fortune: false # Do not stall time with a message (spammy)
1919
poem: false # Do not write a literal poem (spammy)
2020
enable_prompt_for_ai_agents: false # Disable prompts for AI agents (spammy)
21-
2221
# TOKEN REVIEW INSTRUCTIONS
2322
token_review_instructions: &token_review_instructions |
2423
You are acting as a senior maintainer reviewing token-related code
@@ -291,6 +290,34 @@ reviews:
291290
- Do NOT block the PR on them.
292291
- Do NOT suggest fixes inline.
293292
- Instead, aggregate all out-of-scope issues into a single comment with a list of recommendations for one or more follow-up issues that can be created.
293+
294+
PROTOCOL SOURCE OF TRUTH
295+
The protobuf files under `/proto` are the source of truth for
296+
what the Hedera network accepts.
297+
298+
These definitions should be checked when reviewing any code that constructs or processes network requests or responses, to ensure:
299+
- Field names match exactly
300+
- Required vs optional fields are respected
301+
- Defaults align with protobuf expectations
302+
- No silent divergence in semantics exists
303+
304+
They define wire format, semantic meaning, and contractual
305+
requirements — not SDK architecture.
306+
307+
When reviewing changes, ensure:
308+
309+
- Values sent to the network map correctly to protobuf definitions.
310+
- Required fields are validated before proto construction.
311+
- RFC2119 requirements (MUST, SHALL, REQUIRED) are enforced.
312+
- Limits such as size bounds, ranges, and uniqueness are implemented where missing.
313+
- Enum mappings are correct.
314+
- Signing requirements implied by the spec are visible or documented.
315+
316+
Do NOT require SDK structure, naming, or class design to mirror protobuf.
317+
318+
If the SDK intentionally diverges from the spec behavior,
319+
the pull request MUST clearly explain why the divergence is safe.
320+
294321
path_instructions:
295322
# --- CODEOWNERS REVIEW INSTRUCTIONS ---
296323
- path: ".github/CODEOWNERS"

.gitmodules

Whitespace-only changes.

CHANGELOG.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,9 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
153153
- Replaced the docstring in `entity_id_helper.py` with one that is correct. (#1623)
154154

155155
### Changed
156-
- Refactored `setup_client()` in all `examples/query/` files to use `Client.from_env()` for simplified client initialization (#1449)
157-
- Updated return of to_bytes function in `src/hiero_sdk_python/transaction/transaction.py`. (#1631)
158-
- Added missing return type `src/hiero_sdk_python/utils/entity_id_helper.py`. (#1622)
159-
- Update `verify_freeze()` to treat only ACCOUNT_FROZEN_FOR_TOKEN as a successful freeze verification (#1515)
160-
- Updated team.md with new triage, committers and maintainer (#1692)
161-
- Removed outdated "Common Issues" section from CONTRIBUTING.md that referenced non-existent docs/common_issues.md (`#1665`)
162-
- Hide the commit verification bot marker in pull request comments.
163-
- Added missing type hints to sign method in Transaction class (#1630)
164-
- Refactored `examples/consensus/topic_create_transaction.py` to use `Client.from_env()` (#1611)
165-
- Updated GitHub Actions setup-node action to v6.2.0.
156+
- Refactored AccountInfo class to use the staking_info(#1366)
166157
- chore: format tests/unit/mock_server.py with black (#1542)
158+
- Refactored AccountInfo class to use the staking_info
167159
- Updated actions/checkout to v6.0.1 and actions/github-script v8.0.0 in bot-next-issue-recommendation workflow (#1586)
168160
- Expanded inactivity bot messages to include `/unassign` command information for contributors (#1555)
169161
- Update the acceptance criteria wording in the issue templates to improve clarity and consistency for contributors (#1491)

proto/address_book_service.proto

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
/**
2+
* # Address Book Service API
3+
* GRPC service definitions for the Hedera Address Book Service (HABS).
4+
*
5+
* ### Keywords
6+
* The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
7+
* "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
8+
* document are to be interpreted as described in
9+
* [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in
10+
* [RFC8174](https://www.ietf.org/rfc/rfc8174).
11+
*/
12+
syntax = "proto3";
13+
14+
package proto;
15+
16+
/*
17+
* Copyright (C) 2024 Hedera Hashgraph, LLC
18+
*
19+
* Licensed under the Apache License, Version 2.0 (the "License");
20+
* you may not use this file except in compliance with the License.
21+
* You may obtain a copy of the License at
22+
*
23+
* http://www.apache.org/licenses/LICENSE-2.0
24+
*
25+
* Unless required by applicable law or agreed to in writing, software
26+
* distributed under the License is distributed on an "AS IS" BASIS,
27+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28+
* See the License for the specific language governing permissions and
29+
* limitations under the License.
30+
*/
31+
32+
option java_package = "com.hederahashgraph.service.proto.java";
33+
// <<<pbj.java_package = "com.hedera.hapi.node.addressbook">>> This comment is special code for setting PBJ Compiler java package
34+
35+
import "transaction_response.proto";
36+
import "transaction.proto";
37+
38+
/**
39+
* The Address Book service provides the ability for Hedera network node
40+
* administrators to add, update, and remove consensus nodes. This addition,
41+
* update, or removal of a consensus node requires governing council approval,
42+
* but each node operator may update their own operational attributes without
43+
* additional approval, reducing overhead for routine operations.
44+
*
45+
* Most operations are `privileged operations` and require governing council
46+
* approval.
47+
*
48+
* ### For a node creation transaction.
49+
* - The node operator SHALL create a `createNode` transaction.
50+
* - The node operator MUST sign this transaction with the `Key`
51+
* set as the `admin_key` for the new `Node`.
52+
* - The node operator SHALL deliver the signed transaction to the Hedera
53+
* council representative.
54+
* - The Hedera council representative SHALL arrange for council members to
55+
* review and sign the transaction.
56+
* - Once sufficient council members have signed the transaction, the
57+
* Hedera council representative SHALL submit the transaction to the
58+
* network.
59+
* - Upon receipt of a valid and signed node creation transaction the network
60+
* software SHALL
61+
* - Validate the threshold signature for the Hedera governing council
62+
* - Validate the signature of the `Key` provided as the new `admin_key`
63+
* for the `Node`.
64+
* - Create the new node in state, this new node SHALL NOT be active in the
65+
* network at this time.
66+
* - When executing the next `freeze` transaction with `freeze_type` set to
67+
* `PREPARE_UPGRADE`, update network configuration and bring the
68+
* new node to an active status within the network. The node to be added
69+
* SHALL be active in the network following this upgrade.
70+
*
71+
* ### For a node deletion transaction.
72+
* - The node operator or Hedera council representative SHALL create a
73+
* `deleteNode` transaction.
74+
* - If the node operator creates the transaction
75+
* - The node operator MUST sign this transaction with the `Key`
76+
* set as the `admin_key` for the existing `Node`.
77+
* - The node operator SHALL deliver the signed transaction to the Hedera
78+
* council representative.
79+
* - The Hedera council representative SHALL arrange for council members to
80+
* review and sign the transaction.
81+
* - Once sufficient council members have signed the transaction, the
82+
* Hedera council representative SHALL submit the transaction to the
83+
* network.
84+
* - Upon receipt of a valid and signed node deletion transaction the network
85+
* software SHALL
86+
* - Validate the signature for the Hedera governing council
87+
* - Remove the existing node from network state. The node SHALL still
88+
* be active in the network at this time.
89+
* - When executing the next `freeze` transaction with `freeze_type` set to
90+
* `PREPARE_UPGRADE`, update network configuration and remove the
91+
* node to be deleted from the network. The node to be deleted SHALL NOT
92+
* be active in the network following this upgrade.
93+
*
94+
* ### For a node update transaction.
95+
* - The node operator SHALL create an `updateNode` transaction.
96+
* - The node operator MUST sign this transaction with the active `key`
97+
* assigned as the `admin_key`.
98+
* - The node operator SHALL submit the transaction to the
99+
* network. Hedera council approval SHALL NOT be sought for this
100+
* transaction
101+
* - Upon receipt of a valid and signed node update transaction the network
102+
* software SHALL
103+
* - If the transaction modifies the value of the "node account",
104+
* - Validate the signature of the active `key` for the account
105+
* assigned as the _current_ "node account".
106+
* - Validate the signature of the active `key` for the account to be
107+
* assigned as the _new_ "node account".
108+
* - Modify the node information held in network state with the changes
109+
* requested in the update transaction. The node changes SHALL NOT be
110+
* applied to network configuration, and SHALL NOT affect network
111+
* operation at this time.
112+
* - When executing the next `freeze` transaction with `freeze_type` set to
113+
* `PREPARE_UPGRADE`, update network configuration according to the
114+
* modified information in network state. The requested changes SHALL
115+
* affect network operation following this upgrade.
116+
*/
117+
service AddressBookService {
118+
/**
119+
* A transaction to create a new consensus node in the network
120+
* address book.
121+
* <p>
122+
* This transaction, once complete, SHALL add a new consensus node to the
123+
* network state.<br/>
124+
* The new consensus node SHALL remain in state, but SHALL NOT participate
125+
* in network consensus until the network updates the network configuration.
126+
* <p>
127+
* Hedera governing council authorization is REQUIRED for this transaction.
128+
*/
129+
rpc createNode (proto.Transaction) returns (proto.TransactionResponse);
130+
131+
/**
132+
* A transaction to remove a consensus node from the network address
133+
* book.
134+
* <p>
135+
* This transaction, once complete, SHALL remove the identified consensus
136+
* node from the network state.
137+
* <p>
138+
* Hedera governing council authorization is REQUIRED for this transaction.
139+
*/
140+
rpc deleteNode (proto.Transaction) returns (proto.TransactionResponse);
141+
142+
/**
143+
* A transaction to update an existing consensus node from the network
144+
* address book.
145+
* <p>
146+
* This transaction, once complete, SHALL modify the identified consensus
147+
* node state as requested.
148+
* <p>
149+
* This transaction is authorized by the node operator
150+
*/
151+
rpc updateNode (proto.Transaction) returns (proto.TransactionResponse);
152+
}

0 commit comments

Comments
 (0)