All Downloads are FREE. Search and download functionalities are using the official Maven repository.

state.blockstream.block_stream_info.proto Maven / Gradle / Ivy

There is a newer version: 0.57.1
Show newest version
/**
 * # Block Stream Info
 * Information stored in consensus state at the beginning of each block to
 * record the status of the immediately prior block.
 *
 * ### 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.node.state.blockstream;

/*
 * 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 "timestamp.proto";
import "basic_types.proto";

option java_package = "com.hederahashgraph.api.proto.java";
// <<>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
 * A message stored in state to maintain block stream parameters.
* Nodes use this information for three purposes. * 1. To maintain hash chain continuity at restart and reconnect boundaries. * 1. To store historical hashes for implementation of the EVM `BLOCKHASH` * and `PREVRANDAO` opcodes. * 1. To track the amount of consensus time that has passed between blocks. * * This value MUST be updated for every block.
* This value MUST be transmitted in the "state changes" section of * _each_ block, but MUST be updated at the beginning of the _next_ block.
* This value SHALL contain the block hash up to, and including, the * immediately prior completed block.
* The state change to update this singleton MUST be the last * block item in this block. */ message BlockStreamInfo { /** * A block number.
* This is the current block number. */ uint64 block_number = 1; /** * A consensus time for the current block.
* This is the consensus time of the first round in the current block, * and is used to determine if this block was the first across an * important boundary in consensus time, such as UTC midnight. * This may also be used to purge entities expiring between the last * block time and this time. */ proto.Timestamp block_time = 2; /** * A concatenation of hash values.
* This combines several trailing output block item hashes and * is used as a seed value for a pseudo-random number generator.
* This is also required to implement the EVM `PREVRANDAO` opcode.
* This MUST contain at least 256 bits of entropy. */ bytes trailing_output_hashes = 3; /** * A concatenation of hash values.
* This field combines up to 256 trailing block hashes. *

* If this message is for block number N, then the earliest available * hash SHALL be for block number N-256.
* The latest available hash SHALL be for block N-1.
* This is REQUIRED to implement the EVM `BLOCKHASH` opcode. *

* ### Field Length * Each hash value SHALL be the trailing 265 bits of a SHA2-384 hash.
* The length of this field SHALL be an integer multiple of 32 bytes.
* This field SHALL be at least 32 bytes.
* The maximum length of this field SHALL be 8192 bytes. */ bytes trailing_block_hashes = 4; /** * A SHA2-384 hash value.
* This is the hash of the "input" subtree for this block. */ bytes input_tree_root_hash = 5; /** * A SHA2-384 hash value.
* This is the hash of consensus state at the _start_ of this block. */ bytes start_of_block_state_hash = 6; /** * A count of "output" block items in this block. *

* This SHALL count the number of output block items that _precede_ * the state change that updates this singleton. */ uint32 num_preceding_output_items = 7; /** * A concatenation of SHA2-384 hash values.
* This is the "rightmost" values of the "output" subtree. *

* The subtree containing these hashes SHALL be constructed from all "output" * `BlockItem`s in this block that _precede_ the update to this singleton. */ repeated bytes rightmost_preceding_output_tree_hashes = 8; /** * A block-end consensus time stamp. *

* This field SHALL hold the last-used consensus time for * the current block. */ proto.Timestamp block_end_time = 9; /** * Whether the post-upgrade work has been done. *

* This MUST be false if and only if the network just restarted * after an upgrade and has not yet done the post-upgrade work. */ bool post_upgrade_work_done = 10; /** * A version describing the version of application software. *

* This SHALL be the software version that created this block. */ proto.SemanticVersion creation_software_version = 11; /** * The time stamp at which the last interval process was done. *

* This field SHALL hold the consensus time for the last time * at which an interval of time-dependent events were processed. */ proto.Timestamp last_interval_process_time = 12; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy