Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.1.6 field/method renaming #2853

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<Hash256>,
}

Expand Down Expand Up @@ -1023,7 +1023,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
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()
Expand Down Expand Up @@ -3153,7 +3153,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.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);

Expand Down Expand Up @@ -3387,7 +3387,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {

// 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()
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/src/block_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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())?
}

Expand Down
10 changes: 5 additions & 5 deletions beacon_node/beacon_chain/src/execution_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down Expand Up @@ -150,7 +150,7 @@ pub fn validate_execution_payload_for_gossip<T: BeaconChainTypes>(
// 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
Expand All @@ -165,7 +165,7 @@ pub fn validate_execution_payload_for_gossip<T: BeaconChainTypes>(
}
};

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())
Expand Down Expand Up @@ -247,7 +247,7 @@ pub async fn prepare_execution_payload<T: BeaconChainTypes>(
.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;
Expand Down Expand Up @@ -292,7 +292,7 @@ pub async fn prepare_execution_payload<T: BeaconChainTypes>(
.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,
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/client/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/client/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub struct Config {
pub chain: beacon_chain::ChainConfig,
pub eth1: eth1::Config,
pub execution_endpoints: Option<Vec<SensitiveUrl>>,
pub fee_recipient: Option<Address>,
pub suggested_fee_recipient: Option<Address>,
pub http_api: http_api::Config,
pub http_metrics: http_metrics::Config,
pub monitoring_api: Option<monitoring_api::Config>,
Expand All @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/execution_layer/src/engine_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
24 changes: 12 additions & 12 deletions beacon_node/execution_layer/src/engine_api/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand All @@ -462,7 +462,7 @@ mod test {
{
"timestamp":"0x5",
"random": HASH_00,
"feeRecipient": ADDRESS_00
"suggestedFeeRecipient": ADDRESS_00
}]
}),
)
Expand Down Expand Up @@ -494,7 +494,7 @@ mod test {
let _ = client
.execute_payload_v1::<MainnetEthSpec>(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(),
Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand All @@ -617,7 +617,7 @@ mod test {
{
"timestamp":"0x5",
"random": HASH_00,
"feeRecipient":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"
"suggestedFeeRecipient":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"
}]
})
)
Expand All @@ -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
Expand Down Expand Up @@ -678,7 +678,7 @@ mod test {
"id":STATIC_ID,
"result":{
"parentHash":"0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a",
"coinbase":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"feeRecipient":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"stateRoot":"0xca3149fa9e37db08d1cd49c9061db1002ef1cd58db2210f2115c8c989b2bdf45",
"receiptRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"logsBloom": LOGS_BLOOM_00,
Expand All @@ -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(),
Expand All @@ -726,7 +726,7 @@ mod test {
let _ = client
.execute_payload_v1::<MainnetEthSpec>(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(),
Expand All @@ -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,
Expand Down
20 changes: 10 additions & 10 deletions beacon_node/execution_layer/src/engine_api/json_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub struct JsonPayloadIdResponse {
#[serde(bound = "T: EthSpec", rename_all = "camelCase")]
pub struct JsonExecutionPayloadV1<T: EthSpec> {
pub parent_hash: Hash256,
pub coinbase: Address,
pub fee_recipient: Address,
pub state_root: Hash256,
pub receipt_root: Hash256,
#[serde(with = "serde_logs_bloom")]
Expand Down Expand Up @@ -87,7 +87,7 @@ impl<T: EthSpec> From<ExecutionPayload<T>> for JsonExecutionPayloadV1<T> {
// 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,
Expand All @@ -104,7 +104,7 @@ impl<T: EthSpec> From<ExecutionPayload<T>> for JsonExecutionPayloadV1<T> {

Self {
parent_hash,
coinbase,
fee_recipient,
state_root,
receipt_root,
logs_bloom,
Expand All @@ -126,7 +126,7 @@ impl<T: EthSpec> From<JsonExecutionPayloadV1<T>> for ExecutionPayload<T> {
// 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,
Expand All @@ -143,7 +143,7 @@ impl<T: EthSpec> From<JsonExecutionPayloadV1<T>> for ExecutionPayload<T> {

Self {
parent_hash,
coinbase,
fee_recipient,
state_root,
receipt_root,
logs_bloom,
Expand All @@ -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<PayloadAttributes> for JsonPayloadAttributesV1 {
Expand All @@ -175,13 +175,13 @@ impl From<PayloadAttributes> for JsonPayloadAttributesV1 {
let PayloadAttributes {
timestamp,
random,
fee_recipient,
suggested_fee_recipient,
} = p;

Self {
timestamp,
random,
fee_recipient,
suggested_fee_recipient,
}
}
}
Expand All @@ -192,13 +192,13 @@ impl From<JsonPayloadAttributesV1> for PayloadAttributes {
let JsonPayloadAttributesV1 {
timestamp,
random,
fee_recipient,
suggested_fee_recipient,
} = j;

Self {
timestamp,
random,
fee_recipient,
suggested_fee_recipient,
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions beacon_node/execution_layer/src/engines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -76,7 +76,7 @@ impl<T> Engine<T> {
head_block_hash: Hash256,
timestamp: u64,
random: Hash256,
fee_recipient: Address,
suggested_fee_recipient: Address,
) -> Option<PayloadId> {
self.payload_id_cache
.lock()
Expand All @@ -85,7 +85,7 @@ impl<T> Engine<T> {
head_block_hash,
timestamp,
random,
fee_recipient,
suggested_fee_recipient,
})
.cloned()
}
Expand Down Expand Up @@ -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,
}
}
}
Loading