Skip to content

Commit d099ad5

Browse files
authored
Remove execution dependency from core module in consensus/types (#8666)
#8652 This moves the `ExecutionBlockHash` from the `execution` module to the `core` module. This allows `core` to not depend on the `execution` module, and the `ExecutionBlockHash` is a pretty core part of our types so I think it makes sense. Co-Authored-By: Mac L <mjladson@pm.me>
1 parent 3903e1c commit d099ad5

File tree

7 files changed

+9
-12
lines changed

7 files changed

+9
-12
lines changed

consensus/types/src/core/chain_spec.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ use tree_hash::TreeHash;
1414
use crate::{
1515
core::{
1616
APPLICATION_DOMAIN_BUILDER, Address, ApplicationDomain, EnrForkId, Epoch, EthSpec,
17-
EthSpecId, Hash256, MainnetEthSpec, Slot, Uint256,
17+
EthSpecId, ExecutionBlockHash, Hash256, MainnetEthSpec, Slot, Uint256,
1818
},
1919
data::{BlobIdentifier, DataColumnSubnetId, DataColumnsByRootIdentifier},
20-
execution::ExecutionBlockHash,
2120
fork::{Fork, ForkData, ForkName},
2221
};
2322

File renamed without changes.

consensus/types/src/core/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ mod chain_spec;
55
mod config_and_preset;
66
mod enr_fork_id;
77
mod eth_spec;
8+
mod execution_block_hash;
89
mod graffiti;
910
mod non_zero_usize;
1011
mod preset;
@@ -25,6 +26,7 @@ pub use config_and_preset::{
2526
};
2627
pub use enr_fork_id::EnrForkId;
2728
pub use eth_spec::{EthSpec, EthSpecId, GNOSIS, GnosisEthSpec, MainnetEthSpec, MinimalEthSpec};
29+
pub use execution_block_hash::ExecutionBlockHash;
2830
pub use graffiti::{GRAFFITI_BYTES_LEN, Graffiti, GraffitiString};
2931
pub use non_zero_usize::new_non_zero_usize;
3032
pub use preset::{

consensus/types/src/execution/execution_payload.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ use test_random_derive::TestRandom;
1010
use tree_hash_derive::TreeHash;
1111

1212
use crate::{
13-
core::{Address, EthSpec, Hash256},
14-
execution::ExecutionBlockHash,
13+
core::{Address, EthSpec, ExecutionBlockHash, Hash256},
1514
fork::{ForkName, ForkVersionDecode},
1615
state::BeaconStateError,
1716
test_utils::TestRandom,

consensus/types/src/execution/execution_payload_header.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ use tree_hash::TreeHash;
1111
use tree_hash_derive::TreeHash;
1212

1313
use crate::{
14-
core::{Address, EthSpec, Hash256, Uint256},
14+
core::{Address, EthSpec, ExecutionBlockHash, Hash256, Uint256},
1515
execution::{
16-
ExecutionBlockHash, ExecutionPayloadBellatrix, ExecutionPayloadCapella,
17-
ExecutionPayloadDeneb, ExecutionPayloadElectra, ExecutionPayloadFulu, ExecutionPayloadRef,
18-
Transactions,
16+
ExecutionPayloadBellatrix, ExecutionPayloadCapella, ExecutionPayloadDeneb,
17+
ExecutionPayloadElectra, ExecutionPayloadFulu, ExecutionPayloadRef, Transactions,
1918
},
2019
fork::ForkName,
2120
map_execution_payload_ref_into_execution_payload_header,

consensus/types/src/execution/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
mod eth1_data;
2-
mod execution_block_hash;
32
mod execution_block_header;
43
#[macro_use]
54
mod execution_payload;
@@ -16,7 +15,6 @@ mod signed_execution_payload_envelope;
1615

1716
pub use bls_to_execution_change::BlsToExecutionChange;
1817
pub use eth1_data::Eth1Data;
19-
pub use execution_block_hash::ExecutionBlockHash;
2018
pub use execution_block_header::{EncodableExecutionBlockHeader, ExecutionBlockHeader};
2119
pub use execution_payload::{
2220
ExecutionPayload, ExecutionPayloadBellatrix, ExecutionPayloadCapella, ExecutionPayloadDeneb,

consensus/types/src/execution/payload.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ use tree_hash::TreeHash;
1111
use tree_hash_derive::TreeHash;
1212

1313
use crate::{
14-
core::{Address, EthSpec, Hash256},
14+
core::{Address, EthSpec, ExecutionBlockHash, Hash256},
1515
execution::{
16-
ExecutionBlockHash, ExecutionPayload, ExecutionPayloadBellatrix, ExecutionPayloadCapella,
16+
ExecutionPayload, ExecutionPayloadBellatrix, ExecutionPayloadCapella,
1717
ExecutionPayloadDeneb, ExecutionPayloadElectra, ExecutionPayloadFulu,
1818
ExecutionPayloadHeader, ExecutionPayloadHeaderBellatrix, ExecutionPayloadHeaderCapella,
1919
ExecutionPayloadHeaderDeneb, ExecutionPayloadHeaderElectra, ExecutionPayloadHeaderFulu,

0 commit comments

Comments
 (0)