Rename eip4844 to deneb (#4129)

* rename 4844 to deneb

* rename 4844 to deneb

* move excess data gas field

* get EF tests working

* fix ef tests lint

* fix the blob identifier ef test

* fix accessed files ef test script

* get beacon chain tests passing
This commit is contained in:
realbigsean
2023-03-26 11:49:16 -04:00
committed by GitHub
parent d84117c0d0
commit a5addf661c
90 changed files with 572 additions and 549 deletions

View File

@@ -13,8 +13,8 @@ use std::collections::HashMap;
use tree_hash::TreeHash;
use tree_hash_derive::TreeHash;
use types::{
EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadCapella,
ExecutionPayloadEip4844, ExecutionPayloadMerge, ForkName, Hash256, Uint256,
EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadCapella, ExecutionPayloadDeneb,
ExecutionPayloadMerge, ForkName, Hash256, Uint256,
};
const GAS_LIMIT: u64 = 16384;
@@ -118,7 +118,7 @@ pub struct ExecutionBlockGenerator<T: EthSpec> {
* Post-merge fork triggers
*/
pub shanghai_time: Option<u64>, // withdrawals
pub eip4844_time: Option<u64>, // 4844
pub deneb_time: Option<u64>, // 4844
}
impl<T: EthSpec> ExecutionBlockGenerator<T> {
@@ -127,7 +127,7 @@ impl<T: EthSpec> ExecutionBlockGenerator<T> {
terminal_block_number: u64,
terminal_block_hash: ExecutionBlockHash,
shanghai_time: Option<u64>,
eip4844_time: Option<u64>,
deneb_time: Option<u64>,
) -> Self {
let mut gen = Self {
head_block: <_>::default(),
@@ -141,7 +141,7 @@ impl<T: EthSpec> ExecutionBlockGenerator<T> {
next_payload_id: 0,
payload_ids: <_>::default(),
shanghai_time,
eip4844_time,
deneb_time,
};
gen.insert_pow_block(0).unwrap();
@@ -174,8 +174,8 @@ impl<T: EthSpec> ExecutionBlockGenerator<T> {
}
pub fn get_fork_at_timestamp(&self, timestamp: u64) -> ForkName {
match self.eip4844_time {
Some(fork_time) if timestamp >= fork_time => ForkName::Eip4844,
match self.deneb_time {
Some(fork_time) if timestamp >= fork_time => ForkName::Deneb,
_ => match self.shanghai_time {
Some(fork_time) if timestamp >= fork_time => ForkName::Capella,
_ => ForkName::Merge,
@@ -535,8 +535,8 @@ impl<T: EthSpec> ExecutionBlockGenerator<T> {
withdrawals: pa.withdrawals.clone().into(),
})
}
ForkName::Eip4844 => {
ExecutionPayload::Eip4844(ExecutionPayloadEip4844 {
ForkName::Deneb => {
ExecutionPayload::Deneb(ExecutionPayloadDeneb {
parent_hash: forkchoice_state.head_block_hash,
fee_recipient: pa.suggested_fee_recipient,
receipts_root: Hash256::repeat_byte(42),
@@ -549,11 +549,11 @@ impl<T: EthSpec> ExecutionBlockGenerator<T> {
timestamp: pa.timestamp,
extra_data: "block gen was here".as_bytes().to_vec().into(),
base_fee_per_gas: Uint256::one(),
// FIXME(4844): maybe this should be set to something?
excess_data_gas: Uint256::one(),
block_hash: ExecutionBlockHash::zero(),
transactions: vec![].into(),
withdrawals: pa.withdrawals.clone().into(),
// FIXME(deneb) maybe this should be set to something?
excess_data_gas: Uint256::one(),
})
}
_ => unreachable!(),

View File

@@ -149,17 +149,17 @@ pub async fn handle_rpc<T: EthSpec>(
));
}
}
ForkName::Eip4844 => {
ForkName::Deneb => {
if method == ENGINE_NEW_PAYLOAD_V1 || method == ENGINE_NEW_PAYLOAD_V2 {
return Err((
format!("{} called after eip4844 fork!", method),
format!("{} called after deneb fork!", method),
GENERIC_ERROR_CODE,
));
}
if matches!(request, JsonExecutionPayload::V1(_)) {
return Err((
format!(
"{} called with `ExecutionPayloadV1` after eip4844 fork!",
"{} called with `ExecutionPayloadV1` after deneb fork!",
method
),
GENERIC_ERROR_CODE,
@@ -168,7 +168,7 @@ pub async fn handle_rpc<T: EthSpec>(
if matches!(request, JsonExecutionPayload::V2(_)) {
return Err((
format!(
"{} called with `ExecutionPayloadV2` after eip4844 fork!",
"{} called with `ExecutionPayloadV2` after deneb fork!",
method
),
GENERIC_ERROR_CODE,
@@ -237,16 +237,16 @@ pub async fn handle_rpc<T: EthSpec>(
FORK_REQUEST_MISMATCH_ERROR_CODE,
));
}
// validate method called correctly according to eip4844 fork time
// validate method called correctly according to deneb fork time
if ctx
.execution_block_generator
.read()
.get_fork_at_timestamp(response.timestamp())
== ForkName::Eip4844
== ForkName::Deneb
&& (method == ENGINE_GET_PAYLOAD_V1 || method == ENGINE_GET_PAYLOAD_V2)
{
return Err((
format!("{} called after eip4844 fork!", method),
format!("{} called after deneb fork!", method),
FORK_REQUEST_MISMATCH_ERROR_CODE,
));
}
@@ -357,7 +357,7 @@ pub async fn handle_rpc<T: EthSpec>(
));
}
}
ForkName::Capella | ForkName::Eip4844 => {
ForkName::Capella | ForkName::Deneb => {
if method == ENGINE_FORKCHOICE_UPDATED_V1 {
return Err((
format!("{} called after Capella fork!", method),

View File

@@ -405,7 +405,7 @@ impl<E: EthSpec> mev_rs::BlindedBlockProvider for MockBuilder<E> {
let payload_attributes = match fork {
ForkName::Merge => PayloadAttributes::new(timestamp, *prev_randao, fee_recipient, None),
// the withdrawals root is filled in by operations
ForkName::Capella | ForkName::Eip4844 => {
ForkName::Capella | ForkName::Deneb => {
PayloadAttributes::new(timestamp, *prev_randao, fee_recipient, Some(vec![]))
}
ForkName::Base | ForkName::Altair => {
@@ -452,7 +452,7 @@ impl<E: EthSpec> mev_rs::BlindedBlockProvider for MockBuilder<E> {
value: to_ssz_rs(&Uint256::from(DEFAULT_BUILDER_PAYLOAD_VALUE_WEI))?,
public_key: self.builder_sk.public_key(),
}),
ForkName::Base | ForkName::Altair | ForkName::Eip4844 => {
ForkName::Base | ForkName::Altair | ForkName::Deneb => {
return Err(BlindedBlockProviderError::Custom(format!(
"Unsupported fork: {}",
fork

View File

@@ -41,7 +41,7 @@ impl<T: EthSpec> MockExecutionLayer<T> {
executor: TaskExecutor,
terminal_block: u64,
shanghai_time: Option<u64>,
eip4844_time: Option<u64>,
deneb_time: Option<u64>,
builder_threshold: Option<u128>,
jwt_key: Option<JwtKey>,
spec: ChainSpec,
@@ -57,7 +57,7 @@ impl<T: EthSpec> MockExecutionLayer<T> {
terminal_block,
spec.terminal_block_hash,
shanghai_time,
eip4844_time,
deneb_time,
);
let url = SensitiveUrl::parse(&server.url()).unwrap();

View File

@@ -62,7 +62,7 @@ pub struct MockExecutionConfig {
pub terminal_block: u64,
pub terminal_block_hash: ExecutionBlockHash,
pub shanghai_time: Option<u64>,
pub eip4844_time: Option<u64>,
pub deneb_time: Option<u64>,
}
impl Default for MockExecutionConfig {
@@ -74,7 +74,7 @@ impl Default for MockExecutionConfig {
terminal_block_hash: ExecutionBlockHash::zero(),
server_config: Config::default(),
shanghai_time: None,
eip4844_time: None,
deneb_time: None,
}
}
}
@@ -95,7 +95,7 @@ impl<T: EthSpec> MockServer<T> {
DEFAULT_TERMINAL_BLOCK,
ExecutionBlockHash::zero(),
None, // FIXME(capella): should this be the default?
None, // FIXME(eip4844): should this be the default?
None, // FIXME(deneb): should this be the default?
)
}
@@ -107,7 +107,7 @@ impl<T: EthSpec> MockServer<T> {
terminal_block_hash,
server_config,
shanghai_time,
eip4844_time,
deneb_time,
} = config;
let last_echo_request = Arc::new(RwLock::new(None));
let preloaded_responses = Arc::new(Mutex::new(vec![]));
@@ -116,7 +116,7 @@ impl<T: EthSpec> MockServer<T> {
terminal_block,
terminal_block_hash,
shanghai_time,
eip4844_time,
deneb_time,
);
let ctx: Arc<Context<T>> = Arc::new(Context {
@@ -175,7 +175,7 @@ impl<T: EthSpec> MockServer<T> {
terminal_block: u64,
terminal_block_hash: ExecutionBlockHash,
shanghai_time: Option<u64>,
eip4844_time: Option<u64>,
deneb_time: Option<u64>,
) -> Self {
Self::new_with_config(
handle,
@@ -186,7 +186,7 @@ impl<T: EthSpec> MockServer<T> {
terminal_block,
terminal_block_hash,
shanghai_time,
eip4844_time,
deneb_time,
},
)
}