mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 23:04:53 +00:00
Merge branch 'deneb-free-blobs' of https://github.com/sigp/lighthouse into partial-processing
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use super::*;
|
||||
use ethereum_types::{H160, H256, U128, U256};
|
||||
use std::sync::Arc;
|
||||
|
||||
fn int_to_hash256(int: u64) -> Hash256 {
|
||||
let mut bytes = [0; HASHSIZE];
|
||||
@@ -186,6 +187,24 @@ impl TreeHash for H256 {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: TreeHash> TreeHash for Arc<T> {
|
||||
fn tree_hash_type() -> TreeHashType {
|
||||
T::tree_hash_type()
|
||||
}
|
||||
|
||||
fn tree_hash_packed_encoding(&self) -> PackedEncoding {
|
||||
self.as_ref().tree_hash_packed_encoding()
|
||||
}
|
||||
|
||||
fn tree_hash_packing_factor() -> usize {
|
||||
T::tree_hash_packing_factor()
|
||||
}
|
||||
|
||||
fn tree_hash_root(&self) -> Hash256 {
|
||||
self.as_ref().tree_hash_root()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
@@ -47,8 +47,6 @@ pub struct BlobSidecar<T: EthSpec> {
|
||||
pub kzg_proof: KzgProof,
|
||||
}
|
||||
|
||||
pub type BlobSidecarList<T> = VariableList<BlobSidecar<T>, <T as EthSpec>::MaxBlobsPerBlock>;
|
||||
//TODO(sean) is there any other way around this? need it arc blobs for caching in multiple places
|
||||
pub type BlobSidecarList<T> =
|
||||
VariableList<Arc<BlobSidecar<T>>, <T as EthSpec>::MaxBlobsPerBlock>;
|
||||
pub type Blobs<T> = VariableList<Blob<T>, <T as EthSpec>::MaxExtraDataBytes>;
|
||||
|
||||
@@ -7,6 +7,7 @@ use derivative::Derivative;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use ssz_derive::{Decode, Encode};
|
||||
use ssz_types::VariableList;
|
||||
use std::sync::Arc;
|
||||
use test_random_derive::TestRandom;
|
||||
use tree_hash::TreeHash;
|
||||
use tree_hash_derive::TreeHash;
|
||||
@@ -28,7 +29,7 @@ use tree_hash_derive::TreeHash;
|
||||
#[arbitrary(bound = "T: EthSpec")]
|
||||
#[derivative(Hash(bound = "T: EthSpec"))]
|
||||
pub struct SignedBlobSidecar<T: EthSpec> {
|
||||
pub message: BlobSidecar<T>,
|
||||
pub message: Arc<BlobSidecar<T>>,
|
||||
pub signature: Signature,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user