Skip to content

Commit

Permalink
Merge branch 'main' into tmp-hip796-protos
Browse files Browse the repository at this point in the history
* main: (21 commits)
  feat: 13135 Added PlatformState protobuf representation (#349)
  feat: Change AddressBookService package to proto (#386)
  feat: add admin_key to node_create.proto, node_update.proto and node.proto (#380)
  HIP 904 proto updates for token reject (#367)
  chore: Updated codeowners to include devops-ci (#384)
  feat: remove node_get_info.proto (#378)
  fixed INVALID_GOSSIP_CA_CERTIFICATE (#375)
  fix: Fixing single-letter mismatch to expectations (#373)
  feat: Update specification text for address book service (#346)
  feat: Add more response codes for Dynamic Address Book Phase 2 (#370)
  feat: maxAutoAssociations updates for contract transactions (#359)
  Added more response codes for Dynamic Address Book Phase 2 (#364)
  feat: Add back Dynamic Address Book Phase 2 protobufs change (#361)
  feat: Back out protobuf-changes to dynamic address book for release 0.51 (#358)
  feat: added NodeGetInfoResponse to response.proto (#355)
  feat: HIP-904 maxAutoAssociations updates (#348)
  chore: added consensus data protobuf (#350)
  Added NodeGetInfo (#347)
  feat: Dynamic Address Book Phase 2 protobufs changes (#344)
  feat: define event protobufs (#338)
  ...
  • Loading branch information
netopyr committed Jul 18, 2024
2 parents 4fbfc6b + 54b258d commit 1e2cea0
Show file tree
Hide file tree
Showing 27 changed files with 3,393 additions and 1,853 deletions.
33 changes: 28 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,5 @@ secring.*
### Custom items
.idea
*.sw*
*.iml

69 changes: 69 additions & 0 deletions platform/event/event_consensus_data.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* # Event Consensus Data
* A message that describes the consensus data for an event.
*
* The `EventConsensusData` contains two fields that are determined once an
* event reaches consensus, the `consensus_timestamp` and `consensus_order`.
*
* ### Keywords
* The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
* "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
* document are to be interpreted as described in [RFC2119](https://www.ietf.org/rfc/rfc2119).
*/
syntax = "proto3";

package com.hedera.hapi.platform.event;

/*
* Hedera Network Services Protobuf
*
* 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.
*/

import "basic_types.proto";
import "event/event_descriptor.proto";
import "timestamp.proto";

option java_package = "com.hedera.hapi.platform.event.legacy";
// <<<pbj.java_package = "com.hedera.hapi.platform.event">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
* Event Consensus Data.<br/>
* This message records the critical values produced by consensus for an event.
*/
message EventConsensusData {
/**
* A consensus timestamp.<br/>
* The network's consensus agreement on a timestamp for this event.
* <p>
* This timestamp MUST be strictly greater than the `consensus_timestamp` of
* the previous consensus event.<br/>
* This is a consensus value and MAY NOT match real-world "wall clock" time.
*/
proto.Timestamp consensus_timestamp = 1;

/**
* A consensus order sequence number.<br/>
* A non-negative sequence number that identifies an event's consensus order
* since genesis.
* <p>
* This SHALL be the unique for each consensus event.<br/>
* This SHALL always increase, and SHALL NOT decrease.<br/>
* This SHALL increment by one for each consensus event.
*/
uint64 consensus_order = 2;
}

83 changes: 83 additions & 0 deletions platform/event/event_core.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/**
* # Core Event Data
* A message that describes the metadata for an event.
*
* The `EventCore` contains a list of the event's parents, as well as the software
* version, an identifier for the node that created this event, the birth round, and
* the creation timestamp for the event.
*
* ### Keywords
* The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
* "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
* document are to be interpreted as described in [RFC2119](https://www.ietf.org/rfc/rfc2119).
*/
syntax = "proto3";

package com.hedera.hapi.platform.event;

/*
* Hedera Network Services Protobuf
*
* 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.
*/

import "basic_types.proto";
import "event/event_descriptor.proto";
import "timestamp.proto";

option java_package = "com.hedera.hapi.platform.event.legacy";
// <<<pbj.java_package = "com.hedera.hapi.platform.event">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
* Contains information about an event and its parents.
*/
message EventCore {
/**
* The creator node identifier.<br/>
* This SHALL be the unique identifier for the node that created the event.<br/>
* This SHALL match the ID of the node as it appears in the address book.
*/
int64 creator_node_id = 1;

/**
* The birth round of the event.<br/>
* The birth round SHALL be the pending consensus round at the time the event is created.<br/>
* The pending consensus round SHALL be **one greater** than the latest round to reach consensus.
*/
int64 birth_round = 2;

/**
* The wall clock time at which the event was created, according to the node creating the event.<br/>
* If the event has a self parent, this timestamp MUST be strictly greater than the `time_created` of the self parent.
*/
proto.Timestamp time_created = 3;

/**
* A list of EventDescriptors representing the parents of this event.<br/>
* The list of parents SHALL include zero or one self parents, and zero or more other parents.<br/>
* The first element of the list SHALL be the self parent, if one exists.<br/>
* The list of parents SHALL NOT include more than one parent from the same creator.
*/
repeated EventDescriptor parents = 4;

/**
* The event specification version.<br/>
* The specification described by this version SHALL encompass the format of the `GossipEvent` message, and also the
* format of all contained messages.<br/>
* This SHALL exactly match the specification version passed into the platform at construction.
*/
proto.SemanticVersion version = 17; // This field is temporary until birth_round migration is complete. Field number 17 chosen to avoid polluting cheaper 1 byte field numbers 1-16
}
80 changes: 80 additions & 0 deletions platform/event/event_descriptor.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/**
* # Event Descriptor
* Unique identifier for an event.
*
* Contains the hash of the event, the creator identifier, the birth round, and the generation.
*
* An event's descriptor is constructed individually by each node that receives a `GossipEvent`,
* to uniquely identify that event. An event's descriptor isn't part of the `GossipEvent` itself,
* since the descriptor contains the fields `hash` and `generation`, which can be computed locally.
* Nodes receiving a `GossipEvent` have the required information to construct the event descriptor
* immediately upon receiving the event, without needing to wait for the event to reach consensus.
*
* Aside from being a unique identifier for events that have been received through gossip,
* the event descriptor contains the necessary information to describe an event's parents,
* in the `parents` field of `GossipEvent`.
*
* ### Keywords
* The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
* "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
* document are to be interpreted as described in [RFC2119](https://www.ietf.org/rfc/rfc2119).
*/
syntax = "proto3";

package com.hedera.hapi.platform.event;

/*
* Hedera Network Services Protobuf
*
* 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.hedera.hapi.platform.event.legacy";
// <<<pbj.java_package = "com.hedera.hapi.platform.event">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
* Unique identifier for an event.
*/
message EventDescriptor {
/**
* The hash of the event.<br/>
* The hash SHALL be a SHA-384 hash.<br/>
* The hash SHALL have the following inputs, in the specified order:<br/>
* 1. The bytes of the `EventCore` protobuf<br/>
* 2. The SHA-384 hash of each individual `EventPayload`, in the order the payloads appear in the `event_payloads` field of the `GossipEvent` protobuf
*/
bytes hash = 1;

/**
* The creator node identifier.<br/>
* This SHALL be the unique identifier for the node that created the event.<br/>
* This SHALL match the ID of the node as it appears in the address book.
*/
int64 creator_node_id = 2;

/**
* The birth round of the event.<br/>
* The birth round SHALL be the pending consensus round at the time the event is created.<br/>
* The pending consensus round SHALL be **one greater** than the latest round to reach consensus.
*/
int64 birth_round = 3;

/**
* The generation of the event.<br/>
* This value SHALL be **one greater** than the _maximum_ generation of all parents.<br/>
*/
int64 generation = 17; // This field is temporary until birth_round migration is complete. Field number 17 chosen to avoid polluting cheaper 1 byte field numbers 1-16
}
6 changes: 3 additions & 3 deletions platform/event/event_payload.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
syntax = "proto3";

package proto;
package com.hedera.hapi.platform.event;

/*
* Hedera Network Services Protobuf
Expand All @@ -31,8 +31,8 @@ package proto;

import "event/state_signature_payload.proto";

option java_package = "com.swirlds.proto.legacy.event";
// <<<pbj.java_package = "com.swirlds.proto.event">>> This comment is special code for setting PBJ Compiler java package
option java_package = "com.hedera.hapi.platform.event.legacy";
// <<<pbj.java_package = "com.hedera.hapi.platform.event">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
Expand Down
67 changes: 67 additions & 0 deletions platform/event/gossip_event.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* # Gossip Event
* An event that is sent and received via gossip
*
* ### Keywords
* The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
* "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
* document are to be interpreted as described in [RFC2119](https://www.ietf.org/rfc/rfc2119).
*/
syntax = "proto3";

package com.hedera.hapi.platform.event;

/*
* Hedera Network Services Protobuf
*
* 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.
*/

import "event/event_payload.proto";
import "event/event_core.proto";

option java_package = "com.hedera.hapi.platform.event.legacy";
// <<<pbj.java_package = "com.hedera.hapi.platform.event">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
* An event that is sent and received via gossip
*/
message GossipEvent {
/**
* The core event data
*/
EventCore event_core = 1;

/**
* A node signature on the event hash.<br/>
* The signature SHALL be created with the SHA384withRSA algorithm.<br/>
* The signature MUST verify using the public key belonging to the `event_creator`.<br/>
* The `event_creator` public key SHALL be read from the address book that corresponds to the event's birth round.<br/>
* The signed event hash SHALL be a SHA-384 hash.<br/>
* The signed event hash SHALL have the following inputs, in the specified order:<br/>
* 1. The bytes of the `event_core` field<br/>
* 2. The SHA-384 hash of each individual `EventPayload`, in the order the payloads appear in the `event_payloads` field
*/
bytes signature = 2;

/**
* The event payloads.<br/>
* This field MAY contain zero payloads.<br/>
* This field MUST NOT exceed `maxTransactionCountPerEvent` entries, initially `245760`.<br/>
* This total size of this field MUST NOT exceed `maxTransactionBytesPerEvent`, initially `245760` bytes.
*/
repeated EventPayload event_payloads = 3;
}
12 changes: 3 additions & 9 deletions platform/event/state_signature_payload.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
syntax = "proto3";

package proto;
package com.hedera.hapi.platform.event;

/*
* Hedera Network Services Protobuf
Expand All @@ -29,8 +29,8 @@ package proto;
* limitations under the License.
*/

option java_package = "com.swirlds.proto.legacy.event";
// <<<pbj.java_package = "com.swirlds.proto.event">>> This comment is special code for setting PBJ Compiler java package
option java_package = "com.hedera.hapi.platform.event.legacy";
// <<<pbj.java_package = "com.hedera.hapi.platform.event">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
Expand Down Expand Up @@ -61,10 +61,4 @@ message StateSignaturePayload {
* This hash MUST be a SHA-384 hash.
*/
bytes hash = 3;

/**
* The hash of the epoch to which this signature corresponds to.<br/>
* This hash MUST be a SHA-384 hash.
*/
bytes epoch_hash = 4;
}
Loading

0 comments on commit 1e2cea0

Please sign in to comment.