diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index bfe7ca143e2..ca11c8a7b76 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -66,7 +66,7 @@ use ssz::Encode; use state_processing::{ common::get_indexed_attestation, per_block_processing, - per_block_processing::{errors::AttestationValidationError, is_merge_complete}, + per_block_processing::{errors::AttestationValidationError, is_merge_transition_complete}, per_slot_processing, state_advance::{complete_state_advance, partial_state_advance}, BlockSignatureStrategy, SigVerifiedOp, @@ -195,7 +195,7 @@ pub struct HeadInfo { pub genesis_time: u64, pub genesis_validators_root: Hash256, pub proposer_shuffling_decision_root: Hash256, - pub is_merge_complete: bool, + pub is_merge_transition_complete: bool, pub execution_payload_block_hash: Option, } @@ -1023,7 +1023,7 @@ impl BeaconChain { genesis_time: head.beacon_state.genesis_time(), genesis_validators_root: head.beacon_state.genesis_validators_root(), proposer_shuffling_decision_root, - is_merge_complete: is_merge_complete(&head.beacon_state), + is_merge_transition_complete: is_merge_transition_complete(&head.beacon_state), execution_payload_block_hash: head .beacon_block .message() @@ -3153,7 +3153,7 @@ impl BeaconChain { .body() .execution_payload() .map(|ep| ep.block_hash); - let is_merge_complete = is_merge_complete(&new_head.beacon_state); + let is_merge_transition_complete = is_merge_transition_complete(&new_head.beacon_state); drop(lag_timer); @@ -3387,7 +3387,7 @@ impl BeaconChain { // If this is a post-merge block, update the execution layer. if let Some(new_head_execution_block_hash) = new_head_execution_block_hash_opt { - if is_merge_complete { + if is_merge_transition_complete { let execution_layer = self .execution_layer .clone() diff --git a/beacon_node/beacon_chain/src/block_verification.rs b/beacon_node/beacon_chain/src/block_verification.rs index f94332c9231..556535c5ea8 100644 --- a/beacon_node/beacon_chain/src/block_verification.rs +++ b/beacon_node/beacon_chain/src/block_verification.rs @@ -60,7 +60,7 @@ use safe_arith::ArithError; use slog::{debug, error, Logger}; use slot_clock::SlotClock; use ssz::Encode; -use state_processing::per_block_processing::is_merge_block; +use state_processing::per_block_processing::is_merge_transition_block; use state_processing::{ block_signature_verifier::{BlockSignatureVerifier, Error as BlockSignatureVerifierError}, per_block_processing, per_slot_processing, @@ -1113,7 +1113,7 @@ impl<'a, T: BeaconChainTypes> FullyVerifiedBlock<'a, T> { // early. // - Doing the check here means we can keep our fork-choice implementation "pure". I.e., no // calls to remote servers. - if is_merge_block(&state, block.message().body()) { + if is_merge_transition_block(&state, block.message().body()) { validate_merge_block(chain, block.message())? } diff --git a/beacon_node/beacon_chain/src/execution_payload.rs b/beacon_node/beacon_chain/src/execution_payload.rs index cdf1d7b6a27..5896dbf3d8e 100644 --- a/beacon_node/beacon_chain/src/execution_payload.rs +++ b/beacon_node/beacon_chain/src/execution_payload.rs @@ -17,7 +17,7 @@ use proto_array::{Block as ProtoBlock, ExecutionStatus}; use slog::debug; use slot_clock::SlotClock; use state_processing::per_block_processing::{ - compute_timestamp_at_slot, is_execution_enabled, is_merge_complete, + compute_timestamp_at_slot, is_execution_enabled, is_merge_transition_complete, partially_verify_execution_payload, }; use types::*; @@ -150,7 +150,7 @@ pub fn validate_execution_payload_for_gossip( // This logic should match `is_execution_enabled`. We use only the execution block hash of // the parent here in order to avoid loading the parent state during gossip verification. - let is_merge_complete = match parent_block.execution_status { + let is_merge_transition_complete = match parent_block.execution_status { // Optimistically declare that an "unknown" status block has completed the merge. ExecutionStatus::Valid(_) | ExecutionStatus::Unknown(_) => true, // It's impossible for an irrelevant block to have completed the merge. It is pre-merge @@ -165,7 +165,7 @@ pub fn validate_execution_payload_for_gossip( } }; - if is_merge_complete || execution_payload != &<_>::default() { + if is_merge_transition_complete || execution_payload != &<_>::default() { let expected_timestamp = chain .slot_clock .start_of(block.slot()) @@ -247,7 +247,7 @@ pub async fn prepare_execution_payload( .as_ref() .ok_or(BlockProductionError::ExecutionLayerMissing)?; - let parent_hash = if !is_merge_complete(state) { + let parent_hash = if !is_merge_transition_complete(state) { let is_terminal_block_hash_set = spec.terminal_block_hash != Hash256::zero(); let is_activation_epoch_reached = state.current_epoch() >= spec.terminal_block_hash_activation_epoch; @@ -292,7 +292,7 @@ pub async fn prepare_execution_payload( .map(|ep| ep.block_hash) }; - // Note: the fee_recipient is stored in the `execution_layer`, it will add this parameter. + // Note: the suggested_fee_recipient is stored in the `execution_layer`, it will add this parameter. let execution_payload = execution_layer .get_payload( parent_hash, diff --git a/beacon_node/client/src/builder.rs b/beacon_node/client/src/builder.rs index 0d61e09220a..bcf0ee198e4 100644 --- a/beacon_node/client/src/builder.rs +++ b/beacon_node/client/src/builder.rs @@ -152,7 +152,7 @@ where let context = runtime_context.service_context("exec".into()); let execution_layer = ExecutionLayer::from_urls( execution_endpoints, - config.fee_recipient, + config.suggested_fee_recipient, context.executor.clone(), context.log().clone(), ) diff --git a/beacon_node/client/src/config.rs b/beacon_node/client/src/config.rs index 8a15e45983e..f4519e05c87 100644 --- a/beacon_node/client/src/config.rs +++ b/beacon_node/client/src/config.rs @@ -75,7 +75,7 @@ pub struct Config { pub chain: beacon_chain::ChainConfig, pub eth1: eth1::Config, pub execution_endpoints: Option>, - pub fee_recipient: Option
, + pub suggested_fee_recipient: Option
, pub http_api: http_api::Config, pub http_metrics: http_metrics::Config, pub monitoring_api: Option, @@ -97,7 +97,7 @@ impl Default for Config { sync_eth1_chain: false, eth1: <_>::default(), execution_endpoints: None, - fee_recipient: None, + suggested_fee_recipient: None, disabled_forks: Vec::new(), graffiti: Graffiti::default(), http_api: <_>::default(), diff --git a/beacon_node/execution_layer/src/engine_api.rs b/beacon_node/execution_layer/src/engine_api.rs index 0ec9888f00a..555044b3dc8 100644 --- a/beacon_node/execution_layer/src/engine_api.rs +++ b/beacon_node/execution_layer/src/engine_api.rs @@ -107,7 +107,7 @@ pub struct ExecutionBlock { pub struct PayloadAttributes { pub timestamp: u64, pub random: Hash256, - pub fee_recipient: Address, + pub suggested_fee_recipient: Address, } #[derive(Clone, Copy, Debug, PartialEq)] diff --git a/beacon_node/execution_layer/src/engine_api/http.rs b/beacon_node/execution_layer/src/engine_api/http.rs index c4e7a71ae75..973c3b0f65c 100644 --- a/beacon_node/execution_layer/src/engine_api/http.rs +++ b/beacon_node/execution_layer/src/engine_api/http.rs @@ -289,7 +289,7 @@ mod test { > { let mut json = json!({ "parentHash": HASH_00, - "coinbase": ADDRESS_01, + "feeRecipient": ADDRESS_01, "stateRoot": HASH_01, "receiptRoot": HASH_00, "logsBloom": LOGS_BLOOM_01, @@ -445,7 +445,7 @@ mod test { Some(PayloadAttributes { timestamp: 5, random: Hash256::zero(), - fee_recipient: Address::repeat_byte(0), + suggested_fee_recipient: Address::repeat_byte(0), }), ) .await; @@ -462,7 +462,7 @@ mod test { { "timestamp":"0x5", "random": HASH_00, - "feeRecipient": ADDRESS_00 + "suggestedFeeRecipient": ADDRESS_00 }] }), ) @@ -494,7 +494,7 @@ mod test { let _ = client .execute_payload_v1::(ExecutionPayload { parent_hash: Hash256::repeat_byte(0), - coinbase: Address::repeat_byte(1), + fee_recipient: Address::repeat_byte(1), state_root: Hash256::repeat_byte(1), receipt_root: Hash256::repeat_byte(0), logs_bloom: vec![1; 256].into(), @@ -516,7 +516,7 @@ mod test { "method": ENGINE_EXECUTE_PAYLOAD_V1, "params": [{ "parentHash": HASH_00, - "coinbase": ADDRESS_01, + "feeRecipient": ADDRESS_01, "stateRoot": HASH_01, "receiptRoot": HASH_00, "logsBloom": LOGS_BLOOM_01, @@ -600,7 +600,7 @@ mod test { Some(PayloadAttributes { timestamp: 5, random: Hash256::zero(), - fee_recipient: Address::from_str("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap(), + suggested_fee_recipient: Address::from_str("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap(), }) ) .await; @@ -617,7 +617,7 @@ mod test { { "timestamp":"0x5", "random": HASH_00, - "feeRecipient":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" + "suggestedFeeRecipient":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" }] }) ) @@ -643,7 +643,7 @@ mod test { Some(PayloadAttributes { timestamp: 5, random: Hash256::zero(), - fee_recipient: Address::from_str("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap(), + suggested_fee_recipient: Address::from_str("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap(), }) ) .await @@ -678,7 +678,7 @@ mod test { "id":STATIC_ID, "result":{ "parentHash":"0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a", - "coinbase":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "feeRecipient":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "stateRoot":"0xca3149fa9e37db08d1cd49c9061db1002ef1cd58db2210f2115c8c989b2bdf45", "receiptRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "logsBloom": LOGS_BLOOM_00, @@ -701,7 +701,7 @@ mod test { let expected = ExecutionPayload { parent_hash: Hash256::from_str("0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a").unwrap(), - coinbase: Address::from_str("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap(), + fee_recipient: Address::from_str("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap(), state_root: Hash256::from_str("0xca3149fa9e37db08d1cd49c9061db1002ef1cd58db2210f2115c8c989b2bdf45").unwrap(), receipt_root: Hash256::from_str("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap(), logs_bloom: vec![0; 256].into(), @@ -726,7 +726,7 @@ mod test { let _ = client .execute_payload_v1::(ExecutionPayload { parent_hash: Hash256::from_str("0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a").unwrap(), - coinbase: Address::from_str("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap(), + fee_recipient: Address::from_str("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap(), state_root: Hash256::from_str("0xca3149fa9e37db08d1cd49c9061db1002ef1cd58db2210f2115c8c989b2bdf45").unwrap(), receipt_root: Hash256::from_str("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap(), logs_bloom: vec![0; 256].into(), @@ -748,7 +748,7 @@ mod test { "method": ENGINE_EXECUTE_PAYLOAD_V1, "params": [{ "parentHash":"0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a", - "coinbase":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "feeRecipient":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "stateRoot":"0xca3149fa9e37db08d1cd49c9061db1002ef1cd58db2210f2115c8c989b2bdf45", "receiptRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "logsBloom": LOGS_BLOOM_00, diff --git a/beacon_node/execution_layer/src/engine_api/json_structures.rs b/beacon_node/execution_layer/src/engine_api/json_structures.rs index c1335bb5b49..e12bdee923e 100644 --- a/beacon_node/execution_layer/src/engine_api/json_structures.rs +++ b/beacon_node/execution_layer/src/engine_api/json_structures.rs @@ -59,7 +59,7 @@ pub struct JsonPayloadIdResponse { #[serde(bound = "T: EthSpec", rename_all = "camelCase")] pub struct JsonExecutionPayloadV1 { pub parent_hash: Hash256, - pub coinbase: Address, + pub fee_recipient: Address, pub state_root: Hash256, pub receipt_root: Hash256, #[serde(with = "serde_logs_bloom")] @@ -87,7 +87,7 @@ impl From> for JsonExecutionPayloadV1 { // Use this verbose deconstruction pattern to ensure no field is left unused. let ExecutionPayload { parent_hash, - coinbase, + fee_recipient, state_root, receipt_root, logs_bloom, @@ -104,7 +104,7 @@ impl From> for JsonExecutionPayloadV1 { Self { parent_hash, - coinbase, + fee_recipient, state_root, receipt_root, logs_bloom, @@ -126,7 +126,7 @@ impl From> for ExecutionPayload { // Use this verbose deconstruction pattern to ensure no field is left unused. let JsonExecutionPayloadV1 { parent_hash, - coinbase, + fee_recipient, state_root, receipt_root, logs_bloom, @@ -143,7 +143,7 @@ impl From> for ExecutionPayload { Self { parent_hash, - coinbase, + fee_recipient, state_root, receipt_root, logs_bloom, @@ -166,7 +166,7 @@ pub struct JsonPayloadAttributesV1 { #[serde(with = "eth2_serde_utils::u64_hex_be")] pub timestamp: u64, pub random: Hash256, - pub fee_recipient: Address, + pub suggested_fee_recipient: Address, } impl From for JsonPayloadAttributesV1 { @@ -175,13 +175,13 @@ impl From for JsonPayloadAttributesV1 { let PayloadAttributes { timestamp, random, - fee_recipient, + suggested_fee_recipient, } = p; Self { timestamp, random, - fee_recipient, + suggested_fee_recipient, } } } @@ -192,13 +192,13 @@ impl From for PayloadAttributes { let JsonPayloadAttributesV1 { timestamp, random, - fee_recipient, + suggested_fee_recipient, } = j; Self { timestamp, random, - fee_recipient, + suggested_fee_recipient, } } } diff --git a/beacon_node/execution_layer/src/engines.rs b/beacon_node/execution_layer/src/engines.rs index 2ec748e3001..5db00d37f6a 100644 --- a/beacon_node/execution_layer/src/engines.rs +++ b/beacon_node/execution_layer/src/engines.rs @@ -49,7 +49,7 @@ struct PayloadIdCacheKey { pub head_block_hash: Hash256, pub timestamp: u64, pub random: Hash256, - pub fee_recipient: Address, + pub suggested_fee_recipient: Address, } /// An execution engine. @@ -76,7 +76,7 @@ impl Engine { head_block_hash: Hash256, timestamp: u64, random: Hash256, - fee_recipient: Address, + suggested_fee_recipient: Address, ) -> Option { self.payload_id_cache .lock() @@ -85,7 +85,7 @@ impl Engine { head_block_hash, timestamp, random, - fee_recipient, + suggested_fee_recipient, }) .cloned() } @@ -392,7 +392,7 @@ impl PayloadIdCacheKey { head_block_hash: state.head_block_hash, timestamp: attributes.timestamp, random: attributes.random, - fee_recipient: attributes.fee_recipient, + suggested_fee_recipient: attributes.suggested_fee_recipient, } } } diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index ec5d7e8265e..5c069f0b0b1 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -48,7 +48,7 @@ impl From for Error { struct Inner { engines: Engines, - fee_recipient: Option
, + suggested_fee_recipient: Option
, execution_blocks: Mutex>, executor: TaskExecutor, log: Logger, @@ -72,7 +72,7 @@ impl ExecutionLayer { /// Instantiate `Self` with `urls.len()` engines, all using the JSON-RPC via HTTP. pub fn from_urls( urls: Vec, - fee_recipient: Option
, + suggested_fee_recipient: Option
, executor: TaskExecutor, log: Logger, ) -> Result { @@ -95,7 +95,7 @@ impl ExecutionLayer { latest_forkchoice_state: <_>::default(), log: log.clone(), }, - fee_recipient, + suggested_fee_recipient, execution_blocks: Mutex::new(LruCache::new(EXECUTION_BLOCKS_LRU_CACHE_SIZE)), executor, log, @@ -116,9 +116,9 @@ impl ExecutionLayer { &self.inner.executor } - fn fee_recipient(&self) -> Result { + fn suggested_fee_recipient(&self) -> Result { self.inner - .fee_recipient + .suggested_fee_recipient .ok_or(Error::FeeRecipientUnspecified) } @@ -255,11 +255,11 @@ impl ExecutionLayer { random: Hash256, finalized_block_hash: Hash256, ) -> Result, Error> { - let fee_recipient = self.fee_recipient()?; + let suggested_fee_recipient = self.suggested_fee_recipient()?; debug!( self.log(), "Issuing engine_getPayload"; - "fee_recipient" => ?fee_recipient, + "suggested_fee_recipient" => ?suggested_fee_recipient, "random" => ?random, "timestamp" => timestamp, "parent_hash" => ?parent_hash, @@ -267,7 +267,7 @@ impl ExecutionLayer { self.engines() .first_success(|engine| async move { let payload_id = if let Some(id) = engine - .get_payload_id(parent_hash, timestamp, random, fee_recipient) + .get_payload_id(parent_hash, timestamp, random, suggested_fee_recipient) .await { // The payload id has been cached for this engine. @@ -287,7 +287,7 @@ impl ExecutionLayer { let payload_attributes = PayloadAttributes { timestamp, random, - fee_recipient, + suggested_fee_recipient, }; engine @@ -521,13 +521,6 @@ impl ExecutionLayer { self.execution_blocks().await.put(block.block_hash, block); - // TODO(merge): This implementation adheres to the following PR in the `dev` branch: - // - // https://github.com/ethereum/consensus-specs/pull/2719 - // - // Therefore this implementation is not strictly v1.1.5, it is more lenient to some - // edge-cases during EL genesis. We should revisit this prior to the merge to ensure that - // this implementation becomes canonical. loop { let block_reached_ttd = block.total_difficulty >= spec.terminal_total_difficulty; if block_reached_ttd { diff --git a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs index 40e04138d23..2cf05e69111 100644 --- a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs +++ b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs @@ -324,7 +324,7 @@ impl ExecutionBlockGenerator { let mut execution_payload = ExecutionPayload { parent_hash: forkchoice_state.head_block_hash, - coinbase: attributes.fee_recipient, + fee_recipient: attributes.suggested_fee_recipient, receipt_root: Hash256::repeat_byte(42), state_root: Hash256::repeat_byte(43), logs_bloom: vec![0; 256].into(), diff --git a/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs b/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs index dba78eb6878..59345bc01f2 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs @@ -121,7 +121,7 @@ impl MockExecutionLayer { Some(PayloadAttributes { timestamp, random, - fee_recipient: Address::repeat_byte(42), + suggested_fee_recipient: Address::repeat_byte(42), }), ) .await diff --git a/beacon_node/src/config.rs b/beacon_node/src/config.rs index ac2ba9d47a2..e9e3e2cd5b7 100644 --- a/beacon_node/src/config.rs +++ b/beacon_node/src/config.rs @@ -18,7 +18,7 @@ use types::{Address, Checkpoint, Epoch, EthSpec, Hash256, PublicKeyBytes, GRAFFI // TODO(merge): remove this default value. It's just there to make life easy during // early testnets. -const DEFAULT_FEE_RECIPIENT: [u8; 20] = +const DEFAULT_SUGGESTED_FEE_RECIPIENT: [u8; 20] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]; /// Gets the fully-initialized global client. @@ -253,11 +253,11 @@ pub fn get_config( client_config.execution_endpoints = Some(client_config.eth1.endpoints.clone()); } - client_config.fee_recipient = Some( + client_config.suggested_fee_recipient = Some( clap_utils::parse_optional(cli_args, "fee-recipient")? // TODO(merge): remove this default value. It's just there to make life easy during // early testnets. - .unwrap_or_else(|| Address::from(DEFAULT_FEE_RECIPIENT)), + .unwrap_or_else(|| Address::from(DEFAULT_SUGGESTED_FEE_RECIPIENT)), ); if let Some(freezer_dir) = cli_args.value_of("freezer-dir") { diff --git a/consensus/state_processing/src/per_block_processing.rs b/consensus/state_processing/src/per_block_processing.rs index 9975d67337e..0dbb71699d0 100644 --- a/consensus/state_processing/src/per_block_processing.rs +++ b/consensus/state_processing/src/per_block_processing.rs @@ -310,7 +310,7 @@ pub fn partially_verify_execution_payload( payload: &ExecutionPayload, spec: &ChainSpec, ) -> Result<(), BlockProcessingError> { - if is_merge_complete(state) { + if is_merge_transition_complete(state) { block_verify!( payload.parent_hash == state.latest_execution_payload_header()?.block_hash, BlockProcessingError::ExecutionHashChainIncontiguous { @@ -355,7 +355,7 @@ pub fn process_execution_payload( *state.latest_execution_payload_header_mut()? = ExecutionPayloadHeader { parent_hash: payload.parent_hash, - coinbase: payload.coinbase, + fee_recipient: payload.fee_recipient, state_root: payload.state_root, receipt_root: payload.receipt_root, logs_bloom: payload.logs_bloom.clone(), @@ -377,17 +377,22 @@ pub fn process_execution_payload( /// the merge has happened or if we're on the transition block. Thus we don't want to propagate /// errors from the `BeaconState` being an earlier variant than `BeaconStateMerge` as we'd have to /// repeaetedly write code to treat these errors as false. -/// https://github.com/ethereum/consensus-specs/blob/dev/specs/merge/beacon-chain.md#is_merge_complete -pub fn is_merge_complete(state: &BeaconState) -> bool { +/// https://github.com/ethereum/consensus-specs/blob/dev/specs/merge/beacon-chain.md#is_merge_transition_complete +pub fn is_merge_transition_complete(state: &BeaconState) -> bool { state .latest_execution_payload_header() .map(|header| *header != >::default()) .unwrap_or(false) } -/// https://github.com/ethereum/consensus-specs/blob/dev/specs/merge/beacon-chain.md#is_merge_block -pub fn is_merge_block(state: &BeaconState, body: BeaconBlockBodyRef) -> bool { +/// https://github.com/ethereum/consensus-specs/blob/dev/specs/merge/beacon-chain.md#is_merge_transition_block +pub fn is_merge_transition_block( + state: &BeaconState, + body: BeaconBlockBodyRef, +) -> bool { body.execution_payload() - .map(|payload| !is_merge_complete(state) && *payload != >::default()) + .map(|payload| { + !is_merge_transition_complete(state) && *payload != >::default() + }) .unwrap_or(false) } /// https://github.com/ethereum/consensus-specs/blob/dev/specs/merge/beacon-chain.md#is_execution_enabled @@ -395,7 +400,7 @@ pub fn is_execution_enabled( state: &BeaconState, body: BeaconBlockBodyRef, ) -> bool { - is_merge_block(state, body) || is_merge_complete(state) + is_merge_transition_block(state, body) || is_merge_transition_complete(state) } /// https://github.com/ethereum/consensus-specs/blob/dev/specs/merge/beacon-chain.md#compute_timestamp_at_slot diff --git a/consensus/types/src/execution_payload.rs b/consensus/types/src/execution_payload.rs index 0080b092c97..1b29fb34f7b 100644 --- a/consensus/types/src/execution_payload.rs +++ b/consensus/types/src/execution_payload.rs @@ -14,7 +14,7 @@ pub type Transaction = VariableList; #[serde(bound = "T: EthSpec")] pub struct ExecutionPayload { pub parent_hash: Hash256, - pub coinbase: Address, + pub fee_recipient: Address, pub state_root: Hash256, pub receipt_root: Hash256, #[serde(with = "ssz_types::serde_utils::hex_fixed_vec")] diff --git a/consensus/types/src/execution_payload_header.rs b/consensus/types/src/execution_payload_header.rs index ba0c0814585..6cb76a64656 100644 --- a/consensus/types/src/execution_payload_header.rs +++ b/consensus/types/src/execution_payload_header.rs @@ -10,7 +10,7 @@ use tree_hash_derive::TreeHash; )] pub struct ExecutionPayloadHeader { pub parent_hash: Hash256, - pub coinbase: Address, + pub fee_recipient: Address, pub state_root: Hash256, pub receipt_root: Hash256, #[serde(with = "ssz_types::serde_utils::hex_fixed_vec")] diff --git a/testing/ef_tests/check_all_files_accessed.py b/testing/ef_tests/check_all_files_accessed.py index 027959296d4..d8fc4efc3a2 100755 --- a/testing/ef_tests/check_all_files_accessed.py +++ b/testing/ef_tests/check_all_files_accessed.py @@ -39,6 +39,9 @@ "tests/minimal/altair/merkle/single_proof", "tests/mainnet/merge/merkle/single_proof", "tests/minimal/merge/merkle/single_proof", + #FIXME(merge): these will fail on v1.1.5 tests, remove this once #2822 is merged + "tests/mainnet/merge/ssz_static" + "tests/minimal/merge/ssz_static" ] def normalize_path(path): @@ -74,6 +77,7 @@ def normalize_path(path): accessed_files += 1 # Exit with an error if there were any files missed. +print(missed) assert len(missed) == 0, "{} missed files".format(len(missed)) print("Accessed {} files ({} intentionally excluded)".format(accessed_files, excluded_files)) diff --git a/testing/ef_tests/tests/tests.rs b/testing/ef_tests/tests/tests.rs index 2201bc5ee86..9d3eb700381 100644 --- a/testing/ef_tests/tests/tests.rs +++ b/testing/ef_tests/tests/tests.rs @@ -197,9 +197,11 @@ mod ssz_static { ssz_static_test!(attestation, Attestation<_>); ssz_static_test!(attestation_data, AttestationData); ssz_static_test!(attester_slashing, AttesterSlashing<_>); - ssz_static_test!(beacon_block, SszStaticWithSpecHandler, BeaconBlock<_>); + //FIXME(merge): add back once we update tests to v1.1.6 + // ssz_static_test!(beacon_block, SszStaticWithSpecHandler, BeaconBlock<_>); ssz_static_test!(beacon_block_header, BeaconBlockHeader); - ssz_static_test!(beacon_state, SszStaticTHCHandler, BeaconState<_>); + //FIXME(merge): add back once we update tests to v1.1.6 + // ssz_static_test!(beacon_state, SszStaticTHCHandler, BeaconState<_>); ssz_static_test!(checkpoint, Checkpoint); ssz_static_test!(deposit, Deposit); ssz_static_test!(deposit_data, DepositData); @@ -214,11 +216,12 @@ mod ssz_static { ssz_static_test!(pending_attestation, PendingAttestation<_>); ssz_static_test!(proposer_slashing, ProposerSlashing); ssz_static_test!(signed_aggregate_and_proof, SignedAggregateAndProof<_>); - ssz_static_test!( - signed_beacon_block, - SszStaticWithSpecHandler, - SignedBeaconBlock<_> - ); + //FIXME(merge): add back once we update tests to v1.1.6 + // ssz_static_test!( + // signed_beacon_block, + // SszStaticWithSpecHandler, + // SignedBeaconBlock<_> + // ); ssz_static_test!(signed_beacon_block_header, SignedBeaconBlockHeader); ssz_static_test!(signed_voluntary_exit, SignedVoluntaryExit); ssz_static_test!(signing_data, SigningData); @@ -234,10 +237,11 @@ mod ssz_static { .run(); SszStaticHandler::, MainnetEthSpec>::altair_only() .run(); - SszStaticHandler::, MinimalEthSpec>::merge_only() - .run(); - SszStaticHandler::, MainnetEthSpec>::merge_only() - .run(); + //FIXME(merge): add back once we update tests to v1.1.6 + // SszStaticHandler::, MinimalEthSpec>::merge_only() + // .run(); + // SszStaticHandler::, MainnetEthSpec>::merge_only() + // .run(); } // Altair and later @@ -287,22 +291,23 @@ mod ssz_static { SszStaticHandler::::altair_and_later().run(); } - // Merge and later - #[test] - fn execution_payload() { - SszStaticHandler::, MinimalEthSpec>::merge_and_later() - .run(); - SszStaticHandler::, MainnetEthSpec>::merge_and_later() - .run(); - } - - #[test] - fn execution_payload_header() { - SszStaticHandler::, MinimalEthSpec>::merge_and_later() - .run(); - SszStaticHandler::, MainnetEthSpec>::merge_and_later() - .run(); - } + //FIXME(merge): add back once we update tests to v1.1.6 + // // Merge and later + // #[test] + // fn execution_payload() { + // SszStaticHandler::, MinimalEthSpec>::merge_and_later() + // .run(); + // SszStaticHandler::, MainnetEthSpec>::merge_and_later() + // .run(); + // } + // + // #[test] + // fn execution_payload_header() { + // SszStaticHandler::, MinimalEthSpec>::merge_and_later() + // .run(); + // SszStaticHandler::, MainnetEthSpec>::merge_and_later() + // .run(); + // } } #[test]