From baaaa9eefb7a6cd48e504d436556cd150f8b84be Mon Sep 17 00:00:00 2001 From: Anirudh Date: Mon, 25 Nov 2024 10:05:01 -0800 Subject: [PATCH 1/3] chore: add license file --- crates/flat-files-decoder/LICENSE => LICENSE | 2 +- crates/firehose-client/examples/fetch_beacon.rs | 3 +++ crates/firehose-client/examples/fetch_ethereum.rs | 3 +++ crates/firehose-client/examples/stream_beacon.rs | 3 +++ crates/firehose-client/examples/stream_ethereum.rs | 3 +++ crates/firehose-client/src/client.rs | 3 +++ crates/firehose-client/src/error.rs | 3 +++ crates/firehose-client/src/lib.rs | 3 +++ crates/firehose-client/src/tls.rs | 3 +++ crates/firehose-protos-examples/examples/receipt_root.rs | 3 +++ crates/firehose-protos-examples/src/lib.rs | 3 +++ crates/firehose-protos/build.rs | 3 +++ crates/firehose-protos/src/error.rs | 3 +++ crates/firehose-protos/src/ethereum_v2/access.rs | 3 +++ crates/firehose-protos/src/ethereum_v2/eth_block.rs | 3 +++ crates/firehose-protos/src/ethereum_v2/log.rs | 3 +++ crates/firehose-protos/src/ethereum_v2/mod.rs | 3 +++ crates/firehose-protos/src/ethereum_v2/transaction.rs | 3 +++ crates/firehose-protos/src/firehose_v2/mod.rs | 3 +++ crates/firehose-protos/src/firehose_v2/request.rs | 3 +++ crates/firehose-protos/src/lib.rs | 3 +++ crates/flat-files-decoder/benches/decoder.rs | 3 +++ crates/flat-files-decoder/benches/stream_blocks.rs | 3 +++ crates/flat-files-decoder/examples/cli.rs | 3 +++ crates/flat-files-decoder/examples/compression.rs | 3 +++ crates/flat-files-decoder/examples/read_blocks.rs | 3 +++ crates/flat-files-decoder/src/dbin.rs | 5 ++++- crates/flat-files-decoder/src/decoder.rs | 5 ++++- crates/flat-files-decoder/src/error.rs | 3 +++ crates/flat-files-decoder/src/lib.rs | 3 +++ .../forrestrie-examples/examples/block_roots_only_proof.rs | 5 ++++- crates/forrestrie-examples/examples/block_roots_proofs.rs | 5 ++++- crates/forrestrie-examples/examples/empty_slot_hashes.rs | 3 +++ .../forrestrie-examples/examples/fetch_and_verify_block.rs | 3 +++ .../examples/historical_state_roots_proof.rs | 3 +++ .../forrestrie-examples/examples/historical_summary_proof.rs | 3 +++ .../forrestrie-examples/examples/match_ethereum_to_beacon.rs | 3 +++ crates/forrestrie-examples/examples/receipts_proof.rs | 3 +++ .../examples/single_block_post_merge_pre_capella_proof.rs | 3 +++ .../forrestrie-examples/examples/single_execution_block.rs | 3 +++ crates/forrestrie-examples/examples/verify-era.rs | 3 +++ .../examples/verify_block_inclusion_proof.rs | 5 ++++- crates/forrestrie-examples/src/lib.rs | 3 ++- crates/forrestrie/build.rs | 3 +++ crates/forrestrie/src/beacon_block.rs | 3 +++ crates/forrestrie/src/beacon_state.rs | 3 +++ crates/forrestrie/src/beacon_v1.rs | 3 +++ crates/forrestrie/src/execution_layer.rs | 3 +++ crates/forrestrie/src/lib.rs | 3 +++ crates/header-accumulator/examples/era_validator.rs | 3 +++ crates/header-accumulator/examples/inclusion_proof.rs | 3 +++ crates/header-accumulator/src/epoch.rs | 3 +++ crates/header-accumulator/src/era_validator.rs | 5 ++++- crates/header-accumulator/src/errors.rs | 3 +++ crates/header-accumulator/src/inclusion_proof.rs | 3 +++ crates/header-accumulator/src/lib.rs | 3 +++ crates/header-accumulator/src/types.rs | 3 +++ 57 files changed, 174 insertions(+), 8 deletions(-) rename crates/flat-files-decoder/LICENSE => LICENSE (99%) diff --git a/crates/flat-files-decoder/LICENSE b/LICENSE similarity index 99% rename from crates/flat-files-decoder/LICENSE rename to LICENSE index f49a4e16..f12c1db8 100644 --- a/crates/flat-files-decoder/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2024- Semiotic AI Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/crates/firehose-client/examples/fetch_beacon.rs b/crates/firehose-client/examples/fetch_beacon.rs index 73ce43cb..41585298 100644 --- a/crates/firehose-client/examples/fetch_beacon.rs +++ b/crates/firehose-client/examples/fetch_beacon.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Fetch Beacon Block //! //! Demonstrates how to fetch a single block from Beacon Firehose, using the `Fetch` API. diff --git a/crates/firehose-client/examples/fetch_ethereum.rs b/crates/firehose-client/examples/fetch_ethereum.rs index 5575f08b..09a7fd33 100644 --- a/crates/firehose-client/examples/fetch_ethereum.rs +++ b/crates/firehose-client/examples/fetch_ethereum.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Fetch Ethereum Block //! //! Demonstrates how to fetch a single block from Ethereum firehose. diff --git a/crates/firehose-client/examples/stream_beacon.rs b/crates/firehose-client/examples/stream_beacon.rs index da53428d..1d03b7f3 100644 --- a/crates/firehose-client/examples/stream_beacon.rs +++ b/crates/firehose-client/examples/stream_beacon.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Example: Stream Beacon Blocks //! //! Demonstrates how to stream a range of blocks from Firehose Beacon diff --git a/crates/firehose-client/examples/stream_ethereum.rs b/crates/firehose-client/examples/stream_ethereum.rs index 7962e90b..03c09f94 100644 --- a/crates/firehose-client/examples/stream_ethereum.rs +++ b/crates/firehose-client/examples/stream_ethereum.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Example: Stream Ethereum Blocks //! //! This example demonstrates how to stream Ethereum blocks using the Firehose client. diff --git a/crates/firehose-client/src/client.rs b/crates/firehose-client/src/client.rs index 097e07ce..5a3ea566 100644 --- a/crates/firehose-client/src/client.rs +++ b/crates/firehose-client/src/client.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use std::str::FromStr; use crate::error::ClientError; diff --git a/crates/firehose-client/src/error.rs b/crates/firehose-client/src/error.rs index e1a9feae..a1a8221f 100644 --- a/crates/firehose-client/src/error.rs +++ b/crates/firehose-client/src/error.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use http::uri::InvalidUri; use thiserror::Error; diff --git a/crates/firehose-client/src/lib.rs b/crates/firehose-client/src/lib.rs index 19d5d9fe..81710709 100644 --- a/crates/firehose-client/src/lib.rs +++ b/crates/firehose-client/src/lib.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Rust Firehose Client //! //! Rust implementation of a client for the [StreamingFast Firehose](https://firehose.streamingfast.io/) diff --git a/crates/firehose-client/src/tls.rs b/crates/firehose-client/src/tls.rs index c96a28f1..3faa2f66 100644 --- a/crates/firehose-client/src/tls.rs +++ b/crates/firehose-client/src/tls.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use once_cell::sync::Lazy; use tonic::transport::ClientTlsConfig; diff --git a/crates/firehose-protos-examples/examples/receipt_root.rs b/crates/firehose-protos-examples/examples/receipt_root.rs index e5ba4a65..c68c805d 100644 --- a/crates/firehose-protos-examples/examples/receipt_root.rs +++ b/crates/firehose-protos-examples/examples/receipt_root.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use alloy_primitives::FixedBytes; use firehose_client::{Chain, FirehoseClient}; use firehose_protos::EthBlock as Block; diff --git a/crates/firehose-protos-examples/src/lib.rs b/crates/firehose-protos-examples/src/lib.rs index b477fc51..2ab561c3 100644 --- a/crates/firehose-protos-examples/src/lib.rs +++ b/crates/firehose-protos-examples/src/lib.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Firehose Protos Examples //! //! Examples that use methods implemented on the Rust-compiled Firehose diff --git a/crates/firehose-protos/build.rs b/crates/firehose-protos/build.rs index c94ae683..2c7ce5bd 100644 --- a/crates/firehose-protos/build.rs +++ b/crates/firehose-protos/build.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use prost_build::Config; use std::{env, path::PathBuf}; diff --git a/crates/firehose-protos/src/error.rs b/crates/firehose-protos/src/error.rs index fd36b857..4dd87bf9 100644 --- a/crates/firehose-protos/src/error.rs +++ b/crates/firehose-protos/src/error.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use thiserror::Error; /// Custom error variants for Verifiable Extraction protobuffer types. diff --git a/crates/firehose-protos/src/ethereum_v2/access.rs b/crates/firehose-protos/src/ethereum_v2/access.rs index b4b2ded4..9dd2672c 100644 --- a/crates/firehose-protos/src/ethereum_v2/access.rs +++ b/crates/firehose-protos/src/ethereum_v2/access.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use crate::error::ProtosError; use super::AccessTuple; diff --git a/crates/firehose-protos/src/ethereum_v2/eth_block.rs b/crates/firehose-protos/src/ethereum_v2/eth_block.rs index 49f7f46f..39135f78 100644 --- a/crates/firehose-protos/src/ethereum_v2/eth_block.rs +++ b/crates/firehose-protos/src/ethereum_v2/eth_block.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use super::{Block, BlockHeader, TransactionReceipt, TransactionTrace}; use alloy_primitives::{hex, Address, Bloom, FixedBytes, Uint, B256}; use alloy_rlp::{Encodable, Header as RlpHeader}; diff --git a/crates/firehose-protos/src/ethereum_v2/log.rs b/crates/firehose-protos/src/ethereum_v2/log.rs index b06cf249..3e7d582d 100644 --- a/crates/firehose-protos/src/ethereum_v2/log.rs +++ b/crates/firehose-protos/src/ethereum_v2/log.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use alloy_primitives::{hex, Address, Bytes, B256}; use reth_primitives::LogData; diff --git a/crates/firehose-protos/src/ethereum_v2/mod.rs b/crates/firehose-protos/src/ethereum_v2/mod.rs index 6da3f05d..016db03d 100644 --- a/crates/firehose-protos/src/ethereum_v2/mod.rs +++ b/crates/firehose-protos/src/ethereum_v2/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! Firehose Ethereum-related data structures and operations. //! See the protobuffer definitions section of the README for more information. //! diff --git a/crates/firehose-protos/src/ethereum_v2/transaction.rs b/crates/firehose-protos/src/ethereum_v2/transaction.rs index f75d9a7b..781cec05 100644 --- a/crates/firehose-protos/src/ethereum_v2/transaction.rs +++ b/crates/firehose-protos/src/ethereum_v2/transaction.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use std::fmt::Display; use alloy_consensus::{TxEip1559, TxEip2930, TxLegacy}; diff --git a/crates/firehose-protos/src/firehose_v2/mod.rs b/crates/firehose-protos/src/firehose_v2/mod.rs index c90bfe8b..03ab512a 100644 --- a/crates/firehose-protos/src/firehose_v2/mod.rs +++ b/crates/firehose-protos/src/firehose_v2/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + pub mod request; tonic::include_proto!("sf.firehose.v2"); diff --git a/crates/firehose-protos/src/firehose_v2/request.rs b/crates/firehose-protos/src/firehose_v2/request.rs index 036f03d4..e84e086d 100644 --- a/crates/firehose-protos/src/firehose_v2/request.rs +++ b/crates/firehose-protos/src/firehose_v2/request.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use crate::BlockNumber; use super::{single_block_request::Reference, SingleBlockRequest}; diff --git a/crates/firehose-protos/src/lib.rs b/crates/firehose-protos/src/lib.rs index b111f2f8..35a96b4c 100644 --- a/crates/firehose-protos/src/lib.rs +++ b/crates/firehose-protos/src/lib.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Verifiable Extraction Protocol Buffers in Rust //! //! This module provides Rust implementations of StreamingFast's protocol buffer definitions, diff --git a/crates/flat-files-decoder/benches/decoder.rs b/crates/flat-files-decoder/benches/decoder.rs index 39259e7e..81ed6613 100644 --- a/crates/flat-files-decoder/benches/decoder.rs +++ b/crates/flat-files-decoder/benches/decoder.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + extern crate rand; use criterion::{black_box, criterion_group, criterion_main, Criterion}; diff --git a/crates/flat-files-decoder/benches/stream_blocks.rs b/crates/flat-files-decoder/benches/stream_blocks.rs index fa4e3073..71771bad 100644 --- a/crates/flat-files-decoder/benches/stream_blocks.rs +++ b/crates/flat-files-decoder/benches/stream_blocks.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use std::{ fs::{self, File}, io::BufReader, diff --git a/crates/flat-files-decoder/examples/cli.rs b/crates/flat-files-decoder/examples/cli.rs index 048daedb..0b74c0bf 100644 --- a/crates/flat-files-decoder/examples/cli.rs +++ b/crates/flat-files-decoder/examples/cli.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use std::{ fs::{self, DirEntry, File}, io::{self, BufReader, BufWriter, Write}, diff --git a/crates/flat-files-decoder/examples/compression.rs b/crates/flat-files-decoder/examples/compression.rs index d5be2a7e..201383fc 100644 --- a/crates/flat-files-decoder/examples/compression.rs +++ b/crates/flat-files-decoder/examples/compression.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! Example of reading blocks from compressed and uncompressed files. //! //! This example demonstrates how to read blocks from compressed and uncompressed files. diff --git a/crates/flat-files-decoder/examples/read_blocks.rs b/crates/flat-files-decoder/examples/read_blocks.rs index 5c837b74..9444146d 100644 --- a/crates/flat-files-decoder/examples/read_blocks.rs +++ b/crates/flat-files-decoder/examples/read_blocks.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use std::{ fs::File, io::{BufReader, BufWriter, Cursor, Write}, diff --git a/crates/flat-files-decoder/src/dbin.rs b/crates/flat-files-decoder/src/dbin.rs index 724e866c..ede72707 100644 --- a/crates/flat-files-decoder/src/dbin.rs +++ b/crates/flat-files-decoder/src/dbin.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use std::io::{self, Read}; use crate::error::DecoderError; @@ -31,7 +34,7 @@ const SUPPORTED_DBIN_VERSION: u8 = 0; /// Work with a `.dbin` flat file. /// -/// Developed by StreamingFast, dbin is a simple file storage format to pack a stream of protobuffer messages. +/// Developed by StreamingFast, dbin is a simple file storage format to pack a stream of protobuffer messages. /// For more information, see [the dbin format documentation](https://github.com/streamingfast/dbin?tab=readme-ov-file). #[derive(Debug)] pub struct DbinFile { diff --git a/crates/flat-files-decoder/src/decoder.rs b/crates/flat-files-decoder/src/decoder.rs index aec093a7..a1fe1b97 100644 --- a/crates/flat-files-decoder/src/decoder.rs +++ b/crates/flat-files-decoder/src/decoder.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use std::io::{BufReader, Cursor, Read}; use firehose_protos::{BstreamBlock, EthBlock as Block}; @@ -139,7 +142,7 @@ impl TryFrom for Box { /// Set the end block for the range of blocks to read, decode, and verify. /// -/// Enum to handle the end block of the stream. +/// Enum to handle the end block of the stream. /// It can be the merge block, i.e. the last pre-merge block, or a specific block number. pub enum EndBlock { /// The last pre-merge block. diff --git a/crates/flat-files-decoder/src/error.rs b/crates/flat-files-decoder/src/error.rs index 5bda10c9..5a7273d3 100644 --- a/crates/flat-files-decoder/src/error.rs +++ b/crates/flat-files-decoder/src/error.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use thiserror::Error; /// Get custom error variants for issues with reading, decoding, and verifying flat files. diff --git a/crates/flat-files-decoder/src/lib.rs b/crates/flat-files-decoder/src/lib.rs index 20ed430b..458ff0b9 100644 --- a/crates/flat-files-decoder/src/lib.rs +++ b/crates/flat-files-decoder/src/lib.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Flat Files Decoder //! //! Read, decode, and verify blockchain block flat files. diff --git a/crates/forrestrie-examples/examples/block_roots_only_proof.rs b/crates/forrestrie-examples/examples/block_roots_only_proof.rs index 303cbde2..48af6f3c 100644 --- a/crates/forrestrie-examples/examples/block_roots_only_proof.rs +++ b/crates/forrestrie-examples/examples/block_roots_only_proof.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Inclusion Proofs for Block Roots Only //! //! For this test, we want to prove that a block_root is included in the `block_summary_root` @@ -5,7 +8,7 @@ //! A [`HistoricalSummary`] contains the roots of two Merkle trees, `block_summary_root` and //! `state_summary_root`. //! We are interested in the `block_summary_root` tree, whose leaves consists of the -//! [`BeaconBlockHeader`] roots for one era (8192 consecutive slots). +//! [`BeaconBlockHeader`] roots for one era (8192 consecutive slots). //! For this test, we are using the state at the first [`Slot`] of an era to build the proof. //! We chose this [`Slot`] because it is the first [`Slot`] of an era, and all of the //! [`BeaconBlockHeader`] roots needed to construct the [`HistoricalSummary`] for this era are diff --git a/crates/forrestrie-examples/examples/block_roots_proofs.rs b/crates/forrestrie-examples/examples/block_roots_proofs.rs index e0c7a18a..16bde5fa 100644 --- a/crates/forrestrie-examples/examples/block_roots_proofs.rs +++ b/crates/forrestrie-examples/examples/block_roots_proofs.rs @@ -1,8 +1,11 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Block Roots Proofs //! //! We want to prove that a block_root is included in a [`HistoricalSummary`] from the [`BeaconState`] historical_summaries List. //! A [`HistoricalSummary`] contains the roots of two Merkle trees, block_summary_root and state_summary root. -//! We are interested in the block_summary tree, whose leaves consists of the [`BeaconBlockHeader`] roots for one era (8192 consecutive slots). +//! We are interested in the block_summary tree, whose leaves consists of the [`BeaconBlockHeader`] roots for one era (8192 consecutive slots). //! For example, we could have used the state at [`Slot`] 8790016, which is the first [`Slot`] of era 1073, to build the proof. //! Because it is the first [`Slot`] of an era, all of the [`BeaconBlockHeader`] roots needed to construct the //! [`HistoricalSummary`] for this era are available in state.block_roots. diff --git a/crates/forrestrie-examples/examples/empty_slot_hashes.rs b/crates/forrestrie-examples/examples/empty_slot_hashes.rs index 5f3de492..3a4cb2f1 100644 --- a/crates/forrestrie-examples/examples/empty_slot_hashes.rs +++ b/crates/forrestrie-examples/examples/empty_slot_hashes.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Empty Slot Block Hashes //! //! This example demonstrates that empty Beacon slots - slots with no execution block - diff --git a/crates/forrestrie-examples/examples/fetch_and_verify_block.rs b/crates/forrestrie-examples/examples/fetch_and_verify_block.rs index 0037500d..7b2ca56d 100644 --- a/crates/forrestrie-examples/examples/fetch_and_verify_block.rs +++ b/crates/forrestrie-examples/examples/fetch_and_verify_block.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Beacon Block and Header Root Consistency //! //! In Ethereum's Beacon chain, the beacon block root and the block header root should match diff --git a/crates/forrestrie-examples/examples/historical_state_roots_proof.rs b/crates/forrestrie-examples/examples/historical_state_roots_proof.rs index fa5dbdb2..b151f727 100644 --- a/crates/forrestrie-examples/examples/historical_state_roots_proof.rs +++ b/crates/forrestrie-examples/examples/historical_state_roots_proof.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Historical and state roots proof //! //! This example demonstrates how to prove the inclusion of historical state roots in the beacon state. diff --git a/crates/forrestrie-examples/examples/historical_summary_proof.rs b/crates/forrestrie-examples/examples/historical_summary_proof.rs index 51208850..3314b998 100644 --- a/crates/forrestrie-examples/examples/historical_summary_proof.rs +++ b/crates/forrestrie-examples/examples/historical_summary_proof.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Historical Summary Proof Given Historical Summaries Root //! //! This example demonstrates how to prove the inclusion of historical summaries in the beacon state. diff --git a/crates/forrestrie-examples/examples/match_ethereum_to_beacon.rs b/crates/forrestrie-examples/examples/match_ethereum_to_beacon.rs index 2090307e..7fba4d71 100644 --- a/crates/forrestrie-examples/examples/match_ethereum_to_beacon.rs +++ b/crates/forrestrie-examples/examples/match_ethereum_to_beacon.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Ethereum Block to Beacon Slot Lookup Example //! //! This example performs a binary search to find the corresponding Beacon chain diff --git a/crates/forrestrie-examples/examples/receipts_proof.rs b/crates/forrestrie-examples/examples/receipts_proof.rs index e78caeb3..e8c7181e 100644 --- a/crates/forrestrie-examples/examples/receipts_proof.rs +++ b/crates/forrestrie-examples/examples/receipts_proof.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Receipts proof given an EL block's `receipt_root` //! //! This example shows how to generate an inclusion proof for a set of receipts of an EL block. diff --git a/crates/forrestrie-examples/examples/single_block_post_merge_pre_capella_proof.rs b/crates/forrestrie-examples/examples/single_block_post_merge_pre_capella_proof.rs index 4c1939f9..0a87c88b 100644 --- a/crates/forrestrie-examples/examples/single_block_post_merge_pre_capella_proof.rs +++ b/crates/forrestrie-examples/examples/single_block_post_merge_pre_capella_proof.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! Proof for single block to be part of an era of beacon blocks using the [`HistoricalBatch`]. //! //! Notice that A [`HistoricalBatch`]` isn't an accumulator, it is a list of block_roots and state_roots diff --git a/crates/forrestrie-examples/examples/single_execution_block.rs b/crates/forrestrie-examples/examples/single_execution_block.rs index 46adc1b6..62843842 100644 --- a/crates/forrestrie-examples/examples/single_execution_block.rs +++ b/crates/forrestrie-examples/examples/single_execution_block.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Prove Inclusion of a Single Execution Layer Block in the Canonical History of the Blockchain //! //! This example demonstrates how to prove the inclusion of a single execution layer block in the canonical diff --git a/crates/forrestrie-examples/examples/verify-era.rs b/crates/forrestrie-examples/examples/verify-era.rs index 9018e2ab..76d3b57b 100644 --- a/crates/forrestrie-examples/examples/verify-era.rs +++ b/crates/forrestrie-examples/examples/verify-era.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! In this example, we verify a complete era of both beacon blocks and execution blocks. //! We first fetch a complete era of beacon blocks (8192 beacon blocks), compute the associated historical summary and //! compare it against the historical summary from a current consensus stated. We also extract the diff --git a/crates/forrestrie-examples/examples/verify_block_inclusion_proof.rs b/crates/forrestrie-examples/examples/verify_block_inclusion_proof.rs index 0060bcfc..791e3bfe 100644 --- a/crates/forrestrie-examples/examples/verify_block_inclusion_proof.rs +++ b/crates/forrestrie-examples/examples/verify_block_inclusion_proof.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Verify Block Inclusion Proof //! //! In Ethereum's Beacon Chain, execution layer payloads are included in the block body. @@ -13,7 +16,7 @@ //! ``` //! //! Similarly, the block body root is derived as follows: -//! +//! //! ```rust //! let block_body_hash = block_body.tree_hash_root(); //! ``` diff --git a/crates/forrestrie-examples/src/lib.rs b/crates/forrestrie-examples/src/lib.rs index 8b137891..3f733a7e 100644 --- a/crates/forrestrie-examples/src/lib.rs +++ b/crates/forrestrie-examples/src/lib.rs @@ -1 +1,2 @@ - +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 diff --git a/crates/forrestrie/build.rs b/crates/forrestrie/build.rs index dff58a58..0bbb1db8 100644 --- a/crates/forrestrie/build.rs +++ b/crates/forrestrie/build.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use prost_build::Config; use std::{env, path::PathBuf}; diff --git a/crates/forrestrie/src/beacon_block.rs b/crates/forrestrie/src/beacon_block.rs index 1143b5ca..b4ef04e3 100644 --- a/crates/forrestrie/src/beacon_block.rs +++ b/crates/forrestrie/src/beacon_block.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use serde::{Deserialize, Serialize}; use tree_hash::TreeHash; use types::{ diff --git a/crates/forrestrie/src/beacon_state.rs b/crates/forrestrie/src/beacon_state.rs index 531fa59a..49342c1b 100644 --- a/crates/forrestrie/src/beacon_state.rs +++ b/crates/forrestrie/src/beacon_state.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use merkle_proof::MerkleTree; use primitive_types::H256; use serde::{Deserialize, Serialize}; diff --git a/crates/forrestrie/src/beacon_v1.rs b/crates/forrestrie/src/beacon_v1.rs index 49a1b684..65c32d0d 100644 --- a/crates/forrestrie/src/beacon_v1.rs +++ b/crates/forrestrie/src/beacon_v1.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! Firehose Beacon-related data structures and operations. //! See the protobuffer definitions section of the README for more information. //! diff --git a/crates/forrestrie/src/execution_layer.rs b/crates/forrestrie/src/execution_layer.rs index 60687d84..245c8a27 100644 --- a/crates/forrestrie/src/execution_layer.rs +++ b/crates/forrestrie/src/execution_layer.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! Execution Layer functionality to build a Merkle Patricia Trie (MPT) from Ethereum receipts //! and generate inclusion proofs for specified receipts within the trie. It includes data structures //! for parsing and handling receipt data, as well as utilities for encoding and decoding as required diff --git a/crates/forrestrie/src/lib.rs b/crates/forrestrie/src/lib.rs index 004216f2..39c9f68e 100644 --- a/crates/forrestrie/src/lib.rs +++ b/crates/forrestrie/src/lib.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + pub mod beacon_block; pub mod beacon_state; pub mod beacon_v1; diff --git a/crates/header-accumulator/examples/era_validator.rs b/crates/header-accumulator/examples/era_validator.rs index d143032d..9878d3a7 100644 --- a/crates/header-accumulator/examples/era_validator.rs +++ b/crates/header-accumulator/examples/era_validator.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use std::{fs::File, io::BufReader}; use flat_files_decoder::{read_blocks_from_reader, Compression}; diff --git a/crates/header-accumulator/examples/inclusion_proof.rs b/crates/header-accumulator/examples/inclusion_proof.rs index 0728f28e..bcfe6683 100644 --- a/crates/header-accumulator/examples/inclusion_proof.rs +++ b/crates/header-accumulator/examples/inclusion_proof.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use std::{fs::File, io::BufReader}; use flat_files_decoder::{read_blocks_from_reader, Compression}; diff --git a/crates/header-accumulator/src/epoch.rs b/crates/header-accumulator/src/epoch.rs index 1f117333..db2968bc 100644 --- a/crates/header-accumulator/src/epoch.rs +++ b/crates/header-accumulator/src/epoch.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use std::array::IntoIter; use alloy_primitives::map::HashSet; diff --git a/crates/header-accumulator/src/era_validator.rs b/crates/header-accumulator/src/era_validator.rs index e4aa385d..cb7496c5 100644 --- a/crates/header-accumulator/src/era_validator.rs +++ b/crates/header-accumulator/src/era_validator.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use ethportal_api::types::execution::accumulator::EpochAccumulator; use tree_hash::{Hash256, TreeHash}; use trin_validation::accumulator::{HistoricalEpochRoots, PreMergeAccumulator}; @@ -42,7 +45,7 @@ impl EraValidator { /// All pre-merge blocks (which are numbered before [`FINAL_EPOCH`]), are validated using /// the [Header Accumulator](https://github.com/ethereum/portal-network-specs/blob/8ad5bc33cb0d4485d2eab73bf2decc43e7566a8f/history-network.md#the-header-accumulator) /// - /// For block post merge, the sync-committee should be used to validate block headers + /// For block post merge, the sync-committee should be used to validate block headers /// in the canonical blockchain. So this function is not useful for those. pub fn validate_era(&self, epoch: &Epoch) -> Result { if epoch.number() > FINAL_EPOCH { diff --git a/crates/header-accumulator/src/errors.rs b/crates/header-accumulator/src/errors.rs index fb7377df..fd34a606 100644 --- a/crates/header-accumulator/src/errors.rs +++ b/crates/header-accumulator/src/errors.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use alloy_primitives::map::HashSet; use firehose_protos::ProtosError; diff --git a/crates/header-accumulator/src/inclusion_proof.rs b/crates/header-accumulator/src/inclusion_proof.rs index 275e3621..b330824b 100644 --- a/crates/header-accumulator/src/inclusion_proof.rs +++ b/crates/header-accumulator/src/inclusion_proof.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use crate::{epoch::MAX_EPOCH_SIZE, errors::EraValidateError, Epoch}; use ethportal_api::{ diff --git a/crates/header-accumulator/src/lib.rs b/crates/header-accumulator/src/lib.rs index 1cc0f68e..bb856b2b 100644 --- a/crates/header-accumulator/src/lib.rs +++ b/crates/header-accumulator/src/lib.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + //! # Header accumulator //! //! This crate is used to accumulate block headers and compare them diff --git a/crates/header-accumulator/src/types.rs b/crates/header-accumulator/src/types.rs index 365ed32a..45eba7b4 100644 --- a/crates/header-accumulator/src/types.rs +++ b/crates/header-accumulator/src/types.rs @@ -1,3 +1,6 @@ +// Copyright 2024-, Semiotic AI, Inc. +// SPDX-License-Identifier: Apache-2.0 + use alloy_primitives::{Uint, B256}; use ethportal_api::{types::execution::accumulator::HeaderRecord, Header}; use firehose_protos::{BlockHeader, EthBlock as Block}; From 58a284e60bad98e73755af696427c7ddfccb9a5f Mon Sep 17 00:00:00 2001 From: Anirudh Date: Tue, 26 Nov 2024 08:22:26 -0800 Subject: [PATCH 2/3] ci: include check to ensure spdx is correct --- .github/workflows/license_headers_check.yml | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/license_headers_check.yml diff --git a/.github/workflows/license_headers_check.yml b/.github/workflows/license_headers_check.yml new file mode 100644 index 00000000..4cea7cfd --- /dev/null +++ b/.github/workflows/license_headers_check.yml @@ -0,0 +1,31 @@ +name: License headers check + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +jobs: + check: + name: License headers check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: Install addlicense + run: | + wget https://github.com/google/addlicense/releases/download/v1.1.1/addlicense_1.1.1_Linux_x86_64.tar.gz + tar -xzf addlicense_1.1.1_Linux_x86_64.tar.gz + sudo mv addlicense /usr/local/bin + - name: Check license headers + run: > + addlicense \ + -check \ + -c "Semiotic AI, Inc." \ + -l "apache" \ + -s=only \ + -ignore '.github/workflows/*.yml' \ + -ignore '.github/*.yml' \ + -ignore '.github/workflows/*.yaml' \ + -ignore '.github/*.yaml' \ + . From 98e1ba48c030db17de54d74265b1fac03be2ebe4 Mon Sep 17 00:00:00 2001 From: Joseph Livesey Date: Tue, 26 Nov 2024 13:39:14 -0500 Subject: [PATCH 3/3] ci: ignore proto files in spdx check --- .github/workflows/license_headers_check.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/license_headers_check.yml b/.github/workflows/license_headers_check.yml index 4cea7cfd..cefe7cc1 100644 --- a/.github/workflows/license_headers_check.yml +++ b/.github/workflows/license_headers_check.yml @@ -28,4 +28,8 @@ jobs: -ignore '.github/*.yml' \ -ignore '.github/workflows/*.yaml' \ -ignore '.github/*.yaml' \ + -ignore 'crates/forrestrie/protos/type.proto' \ + -ignore 'crates/firehose-protos/protos/bstream.proto' \ + -ignore 'crates/firehose-protos/protos/block.proto' \ + -ignore 'crates/firehose-protos/protos/firehose.proto' \ .