Revert "Clean capella (#4019)"

This reverts commit 047c7544e3.
This commit is contained in:
Diva M
2023-03-03 14:13:03 -05:00
parent 047c7544e3
commit a3862e42b1
96 changed files with 2307 additions and 199 deletions

View File

@@ -5,8 +5,8 @@ use std::fs::File;
use std::io::Write;
use std::time::{SystemTime, UNIX_EPOCH};
use types::{
EthSpec, ExecutionPayloadHeader, ExecutionPayloadHeaderCapella, ExecutionPayloadHeaderMerge,
ForkName,
EthSpec, ExecutionPayloadHeader, ExecutionPayloadHeaderCapella, ExecutionPayloadHeaderEip4844,
ExecutionPayloadHeaderMerge, ForkName,
};
pub fn run<T: EthSpec>(matches: &ArgMatches) -> Result<(), String> {
@@ -40,6 +40,14 @@ pub fn run<T: EthSpec>(matches: &ArgMatches) -> Result<(), String> {
prev_randao: eth1_block_hash.into_root(),
..ExecutionPayloadHeaderCapella::default()
}),
ForkName::Eip4844 => ExecutionPayloadHeader::Eip4844(ExecutionPayloadHeaderEip4844 {
gas_limit,
base_fee_per_gas,
timestamp: genesis_time,
block_hash: eth1_block_hash,
prev_randao: eth1_block_hash.into_root(),
..ExecutionPayloadHeaderEip4844::default()
}),
};
let mut file = File::create(file_name).map_err(|_| "Unable to create file".to_string())?;

View File

@@ -425,7 +425,7 @@ fn main() {
.takes_value(true)
.default_value("bellatrix")
.help("The fork for which the execution payload header should be created.")
.possible_values(&["merge", "bellatrix", "capella"])
.possible_values(&["merge", "bellatrix", "capella", "eip4844"])
)
)
.subcommand(

View File

@@ -10,7 +10,8 @@ use std::path::PathBuf;
use std::time::{SystemTime, UNIX_EPOCH};
use types::{
test_utils::generate_deterministic_keypairs, Address, Config, Epoch, EthSpec,
ExecutionPayloadHeader, ExecutionPayloadHeaderCapella, ExecutionPayloadHeaderMerge, ForkName,
ExecutionPayloadHeader, ExecutionPayloadHeaderCapella, ExecutionPayloadHeaderEip4844,
ExecutionPayloadHeaderMerge, ForkName,
};
pub fn run<T: EthSpec>(testnet_dir_path: PathBuf, matches: &ArgMatches) -> Result<(), String> {
@@ -93,6 +94,10 @@ pub fn run<T: EthSpec>(testnet_dir_path: PathBuf, matches: &ArgMatches) -> Resul
ExecutionPayloadHeaderCapella::<T>::from_ssz_bytes(bytes.as_slice())
.map(ExecutionPayloadHeader::Capella)
}
ForkName::Eip4844 => {
ExecutionPayloadHeaderEip4844::<T>::from_ssz_bytes(bytes.as_slice())
.map(ExecutionPayloadHeader::Eip4844)
}
}
.map_err(|e| format!("SSZ decode failed: {:?}", e))
})