stream.output.consensus_service.proto Maven / Gradle / Ivy
/**
* # Consensus Service
* Block stream messages that report the results of transactions handled
* by the `Consensus` service.
*
* ### Topic Running Hash Calculation
* Submitted messages include a topic running hash. This value has changed
* over time, with the known versions detailed in the `RunningHashVersion`
* enumeration.
*
* ### 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) and clarified in
* [RFC8174](https://www.ietf.org/rfc/rfc8174).
*/
syntax = "proto3";
package com.hedera.hapi.block.stream.output;
/*
* 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.block.stream.output.protoc";
// <<>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;
/**
* Block Stream data for a `createTopic` transaction.
*
* This message SHALL NOT duplicate information already contained in the
* original transaction.
*/
message CreateTopicOutput {}
/**
* Block Stream data for a `updateTopic` transaction.
*
* This message SHALL NOT duplicate information already contained in the
* original transaction.
*/
message UpdateTopicOutput {}
/**
* Block Stream data for a `deleteTopic` transaction.
*
* This message SHALL NOT duplicate information already contained in the
* original transaction.
*/
message DeleteTopicOutput {}
/**
* Block Stream data for a `submitMessage` transaction.
*
* This message SHALL NOT duplicate information already contained in the
* original transaction.
* The actual topic running hash SHALL be present in a `StateChanges` block
* item, and is not duplicated here.
*/
message SubmitMessageOutput {}
/**
* A version of the topic running hash.
*
* The inputs to the topic running hash have changed over time.
* This is tracked in earlier record streams as an integer. For the
* block stream we chose to use an enumeration for both efficiency
* and clarity. Placing the most recent, and most common/highest
* volume, version as `0` reduces the serialized size of this message
* by not serializing that default value.
*
*
*
* The topic running hash is a 48-byte value that is the output
* of a hash digest with input data determined by the value of
* the `topic_running_hash_version` field.
* All new transactions SHALL use `topic_running_hash_version`
* `WITH_MESSAGE_DIGEST_AND_PAYER`.
*/
enum RunningHashVersion {
/**
* The most recent version.
*
* This version SHALL include, in order
*
* - The previous running hash of the topic (48 bytes)
* - The `topic_running_hash_version` field (8 bytes)
* - The payer account's shard (8 bytes)
* - The payer account's realm (8 bytes)
* - The payer account's number (8 bytes)
* - The topic's shard (8 bytes)
* - The topic's realm (8 bytes)
* - The topic's number (8 bytes)
* - The number of seconds since the epoch when the
* `ConsensusSubmitMessage` reached consensus (8 bytes)
* - The number of nanoseconds within the second when the
* `ConsensusSubmitMessage` reached consensus (4 bytes)
* - The `topic_sequence_number` field (8 bytes)
* - The output of a SHA-384 digest of the message bytes from the
* `ConsensusSubmitMessage` (48 bytes)
*
*/
WITH_MESSAGE_DIGEST_AND_PAYER = 0;
/**
* An earlier version.
*
* This version SHALL include, in order
*
* - The previous running hash of the topic (48 bytes)
* - The `topic_running_hash_version` field (8 bytes)
* - The topic's shard (8 bytes)
* - The topic's realm (8 bytes)
* - The topic's number (8 bytes)
* - The number of seconds since the epoch when the
* `ConsensusSubmitMessage` reached consensus (8 bytes)
* - The number of nanoseconds within the second when the
* `ConsensusSubmitMessage` reached consensus (4 bytes)
* - The `topic_sequence_number` field (8 bytes)
* - The output of a SHA-384 digest of the message bytes from the
* `ConsensusSubmitMessage` (48 bytes)
*
*/
WITH_MESSAGE_DIGEST = 1;
/**
* The original version, used at genesis.
*
* This version SHALL include, in order
*
* - The previous running hash of the topic (48 bytes)
* - The topic's shard (8 bytes)
* - The topic's realm (8 bytes)
* - The topic's number (8 bytes)
* - The number of seconds since the epoch when the
* `ConsensusSubmitMessage` reached consensus (8 bytes)
* - The number of nanoseconds within the second when the
* `ConsensusSubmitMessage` reached consensus (4 bytes)
* - The `topic_sequence_number` field (8 bytes)
* - The message bytes from the `ConsensusSubmitMessage`
* (variable)
*
*/
WITH_FULL_MESSAGE = 2;
}