Skip to content

Commit

Permalink
feat: add admin_key to node_create.proto, node_update.proto and node.…
Browse files Browse the repository at this point in the history
…proto (#380)

* Add admin_key to node_create.proto, node_update.proto and node.proto

Signed-off-by: Iris Simon <[email protected]>

* Updated changes.

Signed-off-by: Iris Simon <[email protected]>

* Updated changes.

Signed-off-by: Iris Simon <[email protected]>

* Updated with review comments.

Signed-off-by: Iris Simon <[email protected]>

* Updated with review comments.

Signed-off-by: Iris Simon <[email protected]>

* Removed getNodeInfo from address_book_service.proto

Signed-off-by: Iris Simon <[email protected]>

* Updated with review comments.

Signed-off-by: Iris Simon <[email protected]>

* Updated with review comments.

Signed-off-by: Iris Simon <[email protected]>

* Added UPDATE_NODE_ACCOUNT_NOT_ALLOWED

Signed-off-by: Iris Simon <[email protected]>

* updated

Signed-off-by: Iris Simon <[email protected]>

* fixed indentation

Signed-off-by: Iris Simon <[email protected]>

---------

Signed-off-by: Iris Simon <[email protected]>
  • Loading branch information
iwsimon authored Jun 27, 2024
1 parent 58f5711 commit 0df9df1
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 11 deletions.
8 changes: 0 additions & 8 deletions services/address_book_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,4 @@ service AddressBookService {
* Hedera governing council.
*/
rpc updateNode (proto.Transaction) returns (proto.TransactionResponse);

/**
* A transaction to query the current state of a consensus node in the
* network address book state.
* <p>
* Hedera governing council authorization is REQUIRED for this transaction.
*/
rpc getNodeInfo (proto.Query) returns (proto.Response);
}
12 changes: 12 additions & 0 deletions services/node_create.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import "basic_types.proto";
* to join the network, and requires governing council authorization.
*
* - A `NodeCreateTransactionBody` MUST be signed by the governing council.
* - A `NodeCreateTransactionBody` MUST be signed by the `Key` assigned to the
* `admin_key` field.
* - The newly created node information SHALL be added to the network address
* book information in the network state.
* - The new entry SHALL be created in "state" but SHALL NOT participate in
Expand Down Expand Up @@ -125,4 +127,14 @@ message NodeCreateTransactionBody {
* This field is OPTIONAL.
*/
bytes grpc_certificate_hash = 6;

/**
* An administrative key controlled by the node operator.
* <p>
* This key MUST sign this transaction.<br/>
* This key MUST sign each transaction to update this node.<br/>
* This field MUST contain a valid `Key` value.<br/>
* This field is REQUIRED and MUST NOT be set to an empty `KeyList`.
*/
proto.Key admin_key = 7;
}
19 changes: 16 additions & 3 deletions services/node_update.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ import "basic_types.proto";
* Transaction body to modify address book node attributes.
*
* - This transaction SHALL enable the node operator, as identified by the
* node account, to modify operational attributes of the node.
* - This transaction MUST be signed by the active `key` for the current node
* account or by the Hedera governing council.
* `admin_key`, to modify operational attributes of the node.
* - This transaction MUST be signed by the active `admin_key` for the node.
* - If this transaction sets a new value for the `admin_key`, then both the
* current `admin_key`, and the new `admin_key` MUST sign this transaction.
* - This transaction SHALL NOT change any field that is not set (is null) in
* this transaction body.
* - This SHALL create a pending update to the node, but the change SHALL NOT
Expand Down Expand Up @@ -148,4 +149,16 @@ message NodeUpdateTransactionBody {
* If set, the new value SHALL replace the existing hash value.
*/
google.protobuf.BytesValue grpc_certificate_hash = 7;

/**
* An administrative key controlled by the node operator.
* <p>
* This field is OPTIONAL.<br/>
* If set, this key MUST sign this transaction.<br/>
* If set, this key MUST sign each subsequent transaction to
* update this node.<br/>
* If set, this field MUST contain a valid `Key` value.<br/>
* If set, this field MUST NOT be set to an empty `KeyList`.
*/
proto.Key admin_key = 8;
}
5 changes: 5 additions & 0 deletions services/response_code.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1524,4 +1524,9 @@ enum ResponseCodeEnum {
* The transaction attempted to use empty `TokenReference` list.
*/
EMPTY_TOKEN_REFERENCE_LIST = 358;

/*
* The node account is not allowed to be updated
*/
UPDATE_NODE_ACCOUNT_NOT_ALLOWED = 359;
}
9 changes: 9 additions & 0 deletions services/state/addressbook/node.proto
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,13 @@ message Node {
* node SHALL fail.
*/
bool deleted = 9;

/**
* An administrative key controlled by the node operator.
* <p>
* This key MUST sign each transaction to update this node.<br/>
* This field MUST contain a valid `Key` value.<br/>
* This field is REQUIRED and MUST NOT be set to an empty `KeyList`.
*/
proto.Key admin_key = 10;
}

0 comments on commit 0df9df1

Please sign in to comment.