stream.record_file_item.proto Maven / Gradle / Ivy
/**
* # Record File Block
* This block carries the data from "record stream" and "sidecar"
* files that preceded the block stream. Record blocks are full blocks,
* not block items, but do not have a block header or block proof.
*
* ### 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;
/*
* 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.protoc";
// <<>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;
import "basic_types.proto";
import "timestamp.proto";
/**
* A Block Item for record files.
*
* A `RecordFileItem` contains data produced before the innovation of the
* Block Stream, when data was stored in files and validated by individual
* signature files rather than a block proof.
* This item enables a single format, the Block Stream, to carry both
* historical and current data; eliminating the need to search two sources for
* block and block chain data.
* Any block containing this item requires special handling.
* - The block SHALL NOT have a `BlockHeader`.
* - The block SHALL NOT have a `BlockProof`.
* - The block SHALL contain _exactly one_ `RecordFileItem`.
* - The block SHALL NOT contain any item other than a `RecordFileItem`.
* - The content of the `RecordFileItem` MUST be validated using the
* signature data and content provided herein according to the
* process used for Record Files prior to the creation of Block Stream.
* - This block item only replaces the requirement to read several
* individual files from cloud storage services.
*/
message RecordFileItem {
/**
* The block number of this block.
*
* This value MUST be exactly `1` more than the previous block.
* Client systems SHOULD optimistically reject any block with a gap or
* reverse in `number` sequence, and MAY assume the block stream has
* encountered data loss, data corruption, or unauthorized modification.
*/
uint64 number = 1;
/**
* The consensus time the record file was produced for.
* This comes from the record file name.
*/
proto.Timestamp creation_time = 2;
/**
* The contents of a record file.
* The first 4 bytes are a 32bit int little endian version number.
* The versions that existed are 2,3,5 and 6.
*/
bytes record_file_contents = 3;
/**
* The contents of sidecar files for this block.
* Each block can have zero or more sidecar files.
*/
repeated bytes sidecar_file_contents = 4;
/**
* A hash algorithm.
* This is the algorithm used to hash the block.
*
* This SHOULD always be `SHA2_384`.
*/
proto.BlockHashAlgorithm hash_algorithm = 5;
/**
* A collection of RSA signatures from consensus nodes.
* These signatures validate the hash of the record_file_contents field.
*/
repeated bytes record_file_hash_signatures = 6;
}