/**
 * # 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 "services_basic_types.proto";
import "services_event_descriptor.proto";
import "services_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;
}

