diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 771d1611..9dbad525 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,28 @@ -* @hashgraph/hedera-services @hashgraph/mirror-node -/platform/ @hashgraph/platform-hashgraph -/.github/ @hashgraph/release-engineering -.gitignore @hashgraph/release-engineering -LICENSE @hashgraph/release-engineering +* @hashgraph/hedera-services @hashgraph/mirror-node +/platform/ @hashgraph/platform-hashgraph +/mirror/ @hashgraph/mirror-node + + +######################### +##### Core Files ###### +######################### + +# NOTE: Must be placed last to ensure enforcement over all other rules + +# Protection Rules for Github Configuration Files and Actions Workflows +/.github/ @hashgraph/release-engineering-managers @hashgraph/devops-ci +/.github/workflows/ @hashgraph/devops-ci + +# Self-protection for root CODEOWNERS files (this file should not exist and should definitely require approval) +/CODEOWNERS @hashgraph/release-engineering-managers + +# Protect the repository root files +/README.md @hashgraph/release-engineering-managers @hashgraph/devops-ci +**/LICENSE @hashgraph/release-engineering-managers + +# CodeCov configuration +**/codecov.yml @hashgraph/release-engineering-managers @hashgraph/devops-ci + +# Git Ignore definitions +**/.gitignore @hashgraph/release-engineering-managers @hashgraph/devops-ci +**/.gitignore.* @hashgraph/release-engineering-managers @hashgraph/devops-ci diff --git a/services/address_book_service.proto b/services/address_book_service.proto index 10c66c73..12b94cfa 100644 --- a/services/address_book_service.proto +++ b/services/address_book_service.proto @@ -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. - *

- * Hedera governing council authorization is REQUIRED for this transaction. - */ - rpc getNodeInfo (proto.Query) returns (proto.Response); } diff --git a/services/basic_types.proto b/services/basic_types.proto index 837a8bda..dced9027 100644 --- a/services/basic_types.proto +++ b/services/basic_types.proto @@ -1208,9 +1208,9 @@ enum HederaFunctionality { NodeDelete = 91; /** - * Get Node information + * Transfer one or more token balances held by the requesting account to the treasury for each token type. */ - NodeGetInfo = 92; + TokenReject = 92; /** * Transfer one or more token balances held by the requesting account to the treasury for each token type. diff --git a/services/node_create.proto b/services/node_create.proto index 4423d177..24d06f8a 100644 --- a/services/node_create.proto +++ b/services/node_create.proto @@ -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 @@ -125,4 +127,14 @@ message NodeCreateTransactionBody { * This field is OPTIONAL. */ bytes grpc_certificate_hash = 6; + + /** + * An administrative key controlled by the node operator. + *

+ * This key MUST sign this transaction.
+ * This key MUST sign each transaction to update this node.
+ * This field MUST contain a valid `Key` value.
+ * This field is REQUIRED and MUST NOT be set to an empty `KeyList`. + */ + proto.Key admin_key = 7; } diff --git a/services/node_get_info.proto b/services/node_get_info.proto deleted file mode 100644 index a6c5217f..00000000 --- a/services/node_get_info.proto +++ /dev/null @@ -1,214 +0,0 @@ -syntax = "proto3"; - -package com.hedera.hapi.node.addressbook; - -/* - * Copyright (C) 2024 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"; -// <<>> This comment is special code for setting PBJ Compiler java package -option java_multiple_files = true; - -import "basic_types.proto"; -import "query_header.proto"; -import "response_header.proto"; - -/** - * A transaction body for a `getNodeInfo ` node information query request. - * - * This transaction body SHALL be considered a "privileged transaction". - * - * - A `NodeGetInfoQuery` MUST be signed by the governing council. - * - This query requests details for a single consensus node entry in the - * network state. - * - The node identifier `node_id` is REQUIRED, and identifies the node for - * which details are requested. - * - * > Note - * >> Requiring governing council signature for a query like this seems quite - * >> unusual. Further detail for _why_ only the governing council is permitted - * >> to query this information would be helpful (particularly as the block - * >> stream and mirror node make it trivial to obtain the same information). - */ -message NodeGetInfoQuery { - /** - * Standard information sent with every query operation. - *

- * This includes the signed payment and what kind of response is requested - * (cost, state proof, both, or neither). - */ - proto.QueryHeader header = 1; - - /** - * A consensus node identifier for which information is requested. - *

- * If the identified node is not valid, this request SHALL fail with - * a response code `INVALID_NODE_ID`.
- * If the identified node is not present in the network state, - * this request SHALL fail with a response code `INVALID_NODE_ID`. - */ - uint64 node_id = 2; -} - -/** - * A query response describing the current state of a consensus node entry in - * the network state. - */ -message NodeInfo { - /** - * A consensus node identifier in the network state. - *

- * This value identifies this node within the network address book.
- * This value is REQUIRED. - */ - uint64 node_id = 1; - - /** - * An account identifier. - *

- * This account MUST be owned by the entity responsible for the node.
- * This account SHALL be charged transaction fees for any transactions that - * are submitted to the network by this node and fail due diligence checks.
- * This value is REQUIRED. - */ - proto.AccountID account_id = 2; - - /** - * A short description of the consensus node. - *

- * This value, if present, MUST NOT exceed 100 bytes when encoded as UTF-8. - */ - string description = 3; - - /** - * A list of service endpoints for gossip. - *

- * These endpoints SHALL represent the published endpoints to which other - * consensus nodes may _gossip_ transactions.
- * These endpoints SHOULD NOT specify both address and DNS name.
- * This list SHALL NOT be empty.
- * This list SHALL NOT contain more than `10` entries.
- * The first two entries in this list SHALL be the endpoints published to - * all consensus nodes.
- * All other entries SHALL be reserved for future use. - *

- * Each network may have additional requirements for these endpoints. - * A client MUST check network-specific documentation for those - * details.
- *

Example
- * Hedera Mainnet _requires_ that address be specified, and does not - * permit DNS name (FQDN) to be specified.
- * Mainnet also requires that the first entry be an "internal" IP - * address and the second entry be an "external" IP address. - *
- *
- * Solo, however, _requires_ DNS name (FQDN) but also permits - * address. - *
- */ - repeated proto.ServiceEndpoint gossip_endpoint = 4; - - /** - * A list of service endpoints for gRPC calls. - *

- * These endpoints SHALL represent the published endpoints to which clients - * may submit transactions.
- * These endpoints SHOULD specify address and port.
- * These endpoints MAY specify a DNS name.
- * These endpoints SHOULD NOT specify both address and DNS name.
- * This list SHALL NOT be empty.
- * This list SHALL NOT contain more than `8` entries. - *

- * Each network may have additional requirements for these endpoints. - * A client MUST check network-specific documentation for those - * details. - */ - repeated proto.ServiceEndpoint service_endpoint = 5; - - /** - * A certificate used to sign gossip events. - *

- * This value SHALL be a certificate of a type permitted for gossip - * signatures.
- * This value SHALL be the DER encoding of the certificate presented.
- * This field is REQUIRED and MUST NOT be empty. - */ - bytes gossip_ca_certificate = 6; - - /** - * A hash of the node gRPC TLS certificate. - *

- * This value MAY be used to verify the certificate presented by the node - * during TLS negotiation for gRPC.
- * This value MUST be a SHA-384 hash.
- * The TLS certificate to be hashed SHALL first be in PEM format and SHALL - * be encoded with UTF-8 NFKD encoding to a stream of bytes provided to - * the hash algorithm.
- * This field is OPTIONAL. - */ - bytes grpc_certificate_hash = 7; - - /** - * A consensus weight. - *

- * Each node SHALL have a weight in consensus calculations.
- * The consensus weight of a node SHALL be calculated based on the amount - * of HBAR staked to that node.
- * Consensus SHALL be calculated based on agreement of greater than `2/3` - * of the total `weight` value of all nodes on the network. - */ - uint64 weight = 8; - - /** - * A flag indicating this node was removed from the network. - *

- * This flag SHALL NOT be set unless a `deleteNode` transaction previously - * succeeded identifying that node.
- * If this flag is set, the associated node SHALL NOT participate in the - * network. - */ - bool deleted = 10; - - /** - * A ledger ID. - *

- * This identifies the network that responded to this query. - * The specific values are documented in [HIP-198] - * (https://hips.hedera.com/hip/hip-198). - */ - bytes ledger_id = 9; -} - -/** - * Response body for a `getNodeInfo` node information query. - */ -message NodeGetInfoResponse { - /** - * The standard response information for queries. - *

- * This includes the values requested in the `QueryHeader` - * (cost, state proof, both, or neither). - */ - proto.ResponseHeader header = 1; - - /** - * The requested detail information. - *

- * This message SHALL contain the full detail for the node identified in the - * query request. - */ - NodeInfo nodeInfo = 2; -} diff --git a/services/node_update.proto b/services/node_update.proto index 9eb18828..f899f9cc 100644 --- a/services/node_update.proto +++ b/services/node_update.proto @@ -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 @@ -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. + *

+ * This field is OPTIONAL.
+ * If set, this key MUST sign this transaction.
+ * If set, this key MUST sign each subsequent transaction to + * update this node.
+ * If set, this field MUST contain a valid `Key` value.
+ * If set, this field MUST NOT be set to an empty `KeyList`. + */ + proto.Key admin_key = 8; } diff --git a/services/query.proto b/services/query.proto index b3634fd3..b7521425 100644 --- a/services/query.proto +++ b/services/query.proto @@ -56,7 +56,6 @@ import "token_get_nft_info.proto"; import "token_get_nft_infos.proto"; import "get_account_details.proto"; -import "node_get_info.proto"; /** * A single query, which is sent from the client to a node. This includes all possible queries. Each @@ -191,19 +190,5 @@ message Query { * Gets all information about an account including allowances granted by the account */ GetAccountDetailsQuery accountDetails = 58; - - /** - * Request detail information for a consensus node within the network - * address book. - *

- * This query is a privileged action that requires signature from the - * Hedera governing council.
- * The response, when successful, SHALL contain the full information - * currently available, including current status, for the single - * consensus node identifier provided.
- * The node queried MAY be active, inactive, deleted, or pending a - * change at the next network upgrade. - */ - com.hedera.hapi.node.addressbook.NodeGetInfoQuery nodeGetInfo = 59; } } diff --git a/services/response.proto b/services/response.proto index 34e44405..ee1d769c 100644 --- a/services/response.proto +++ b/services/response.proto @@ -60,7 +60,6 @@ import "token_get_nft_infos.proto"; import "schedule_get_info.proto"; import "get_account_details.proto"; -import "node_get_info.proto"; /** * A single response, which is returned from the node to the client, after the client sent the node @@ -192,14 +191,5 @@ message Response { * Gets all information about an account including allowances granted by the account */ GetAccountDetailsResponse accountDetails = 158; - - /** - * A response to a query of the current state of a consensus node - * in the network address book state. - *

- * Hedera governing council authorization is REQUIRED for - * this transaction. - */ - com.hedera.hapi.node.addressbook.NodeGetInfoResponse nodeGetInfo = 159; } } diff --git a/services/response_code.proto b/services/response_code.proto index c1ad3e20..26be8c3a 100644 --- a/services/response_code.proto +++ b/services/response_code.proto @@ -1458,41 +1458,41 @@ enum ResponseCodeEnum { */ INVALID_GRPC_CERTIFICATE = 345; - /** - * The maximum automatic associations value is not valid.
- * The most common cause for this error is a value less than `-1`. - */ - INVALID_MAX_AUTO_ASSOCIATIONS = 346; + /** + * The maximum automatic associations value is not valid.
+ * The most common cause for this error is a value less than `-1`. + */ + INVALID_MAX_AUTO_ASSOCIATIONS = 346; - /** - * The maximum number of nodes allowed in the address book have been created. - */ - MAX_NODES_CREATED = 347; + /** + * The maximum number of nodes allowed in the address book have been created. + */ + MAX_NODES_CREATED = 347; - /** - * In ServiceEndpoint, domain_name and ipAddressV4 are mutually exclusive - */ - IP_FQDN_CANNOT_BE_SET_FOR_SAME_ENDPOINT = 348; + /** + * In ServiceEndpoint, domain_name and ipAddressV4 are mutually exclusive + */ + IP_FQDN_CANNOT_BE_SET_FOR_SAME_ENDPOINT = 348; - /** - * Fully qualified domain name is not allowed in gossip_endpoint - */ - GOSSIP_ENDPOINT_CANNOT_HAVE_FQDN = 349; + /** + * Fully qualified domain name is not allowed in gossip_endpoint + */ + GOSSIP_ENDPOINT_CANNOT_HAVE_FQDN = 349; - /** - * In ServiceEndpoint, domain_name size too large - */ - FQDN_SIZE_TOO_LARGE = 350; + /** + * In ServiceEndpoint, domain_name size too large + */ + FQDN_SIZE_TOO_LARGE = 350; - /** - * ServiceEndpoint is invalid - */ - INVALID_ENDPOINT = 351; + /** + * ServiceEndpoint is invalid + */ + INVALID_ENDPOINT = 351; - /** - * The number of gossip endpoints exceeds the limit - */ - GOSSIP_ENDPOINTS_EXCEEDED_LIMIT = 352; + /** + * The number of gossip endpoints exceeds the limit + */ + GOSSIP_ENDPOINTS_EXCEEDED_LIMIT = 352; /** * The transaction attempted to use duplicate `TokenReference`.
* This affects `TokenReject` attempting to reject same token reference more than once. @@ -1509,13 +1509,39 @@ enum ResponseCodeEnum { */ TOKEN_REFERENCE_LIST_SIZE_LIMIT_EXCEEDED = 355; - /** - * The number of service endpoints exceeds the limit - */ - SERVICE_ENDPOINTS_EXCEEDED_LIMIT = 356; + /** + * The transaction attempted to use duplicate `TokenReference`.
+ * This affects `TokenReject` attempting to reject same token reference more than once. + */ + TOKEN_REFERENCE_REPEATED = 353; - /* - * The IPv4 address is invalid - */ - INVALID_IPV4_ADDRESS = 357; + /** + * The account id specified as the owner in `TokenReject` is invalid or does not exist. + */ + INVALID_OWNER_ID = 354; + + /** + * The transaction attempted to use more than the allowed number of `TokenReference`. + */ + TOKEN_REFERENCE_LIST_SIZE_LIMIT_EXCEEDED = 355; + + /** + * The number of service endpoints exceeds the limit + */ + SERVICE_ENDPOINTS_EXCEEDED_LIMIT = 356; + + /* + * The IPv4 address is invalid + */ + INVALID_IPV4_ADDRESS = 357; + + /** + * 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; } diff --git a/services/schedulable_transaction_body.proto b/services/schedulable_transaction_body.proto index 7617f7c3..c02a3c3a 100644 --- a/services/schedulable_transaction_body.proto +++ b/services/schedulable_transaction_body.proto @@ -305,6 +305,7 @@ message SchedulableTransactionBody { * Transaction body for a scheduled transaction to remove a node. */ com.hedera.hapi.node.addressbook.NodeDeleteTransactionBody nodeDelete = 44; + /** * A transaction body to "reject" undesired tokens.
* This transaction will transfer one or more tokens or token diff --git a/services/state/addressbook/node.proto b/services/state/addressbook/node.proto index 2622047a..e00b5f38 100644 --- a/services/state/addressbook/node.proto +++ b/services/state/addressbook/node.proto @@ -137,4 +137,13 @@ message Node { * node SHALL fail. */ bool deleted = 9; + + /** + * An administrative key controlled by the node operator. + *

+ * This key MUST sign each transaction to update this node.
+ * This field MUST contain a valid `Key` value.
+ * This field is REQUIRED and MUST NOT be set to an empty `KeyList`. + */ + proto.Key admin_key = 10; } diff --git a/services/transaction_body.proto b/services/transaction_body.proto index 07d15b2b..7dc6c0af 100644 --- a/services/transaction_body.proto +++ b/services/transaction_body.proto @@ -383,28 +383,28 @@ message TransactionBody { */ com.hedera.hapi.node.addressbook.NodeDeleteTransactionBody nodeDelete = 56; - /** - * A transaction body to "reject" undesired tokens.
- * This transaction will transfer one or more tokens or token - * balances held by the requesting account to the treasury - * for each token type. - *

- * Each transfer MUST be one of the following: - *

- * When complete, the requesting account SHALL NOT hold the - * rejected tokens.
- * Custom fees and royalties defined for the tokens rejected - * SHALL NOT be charged for this transaction. - */ - TokenRejectTransactionBody tokenReject = 57; + /** + * A transaction body to "reject" undesired tokens.
+ * This transaction will transfer one or more tokens or token + * balances held by the requesting account to the treasury + * for each token type. + *

+ * Each transfer MUST be one of the following: + *

+ * When complete, the requesting account SHALL NOT hold the + * rejected tokens.
+ * Custom fees and royalties defined for the tokens rejected + * SHALL NOT be charged for this transaction. + */ + TokenRejectTransactionBody tokenReject = 57; - /** - * A transaction body for a `tokenAirdrop` request. - */ - TokenAirdropTransactionBody tokenAirdrop = 58; - } + /** + * A transaction body for a `tokenAirdrop` request. + */ + TokenAirdropTransactionBody tokenAirdrop = 58; + } }