Block processing eip4844 (#3673)

* add eip4844 block processing

* fix blob processing code

* consensus logic fixes and cleanup

* use safe arith
This commit is contained in:
realbigsean
2022-11-01 13:15:11 -04:00
committed by GitHub
parent 29f2ec46d3
commit 5ad834280b
9 changed files with 200 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
use super::signature_sets::Error as SignatureSetError;
use merkle_proof::MerkleTreeError;
use safe_arith::ArithError;
use ssz::DecodeError;
use types::*;
/// The error returned from the `per_block_processing` function. Indicates that a block is either
@@ -53,6 +54,7 @@ pub enum BlockProcessingError {
BeaconStateError(BeaconStateError),
SignatureSetError(SignatureSetError),
SszTypesError(ssz_types::Error),
SszDecodeError(DecodeError),
MerkleTreeError(MerkleTreeError),
ArithError(ArithError),
InconsistentBlockFork(InconsistentFork),
@@ -70,6 +72,18 @@ pub enum BlockProcessingError {
found: u64,
},
ExecutionInvalid,
BlobVersionHashMismatch,
/// The number of commitments in blob transactions in the payload does not match the number
/// of commitments in the block.
BlobNumCommitmentsMismatch {
commitments_processed_in_block: usize,
/// This number depic
commitments_processed_in_transactions: usize,
},
BlobVersionHashIndexOutOfBounds {
index: usize,
length: usize,
},
}
impl From<BeaconStateError> for BlockProcessingError {
@@ -90,6 +104,12 @@ impl From<ssz_types::Error> for BlockProcessingError {
}
}
impl From<DecodeError> for BlockProcessingError {
fn from(error: DecodeError) -> Self {
BlockProcessingError::SszDecodeError(error)
}
}
impl From<ArithError> for BlockProcessingError {
fn from(e: ArithError) -> Self {
BlockProcessingError::ArithError(e)