mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 06:14:38 +00:00
Update to consensus-specs v1.1.9 (#3016)
## Issue Addressed Closes #3014 ## Proposed Changes - Rename `receipt_root` to `receipts_root` - Rename `execute_payload` to `notify_new_payload` - This is slightly weird since we modify everything except the actual HTTP call to the engine API. That change is expected to be implemented in #2985 (cc @ethDreamer) - Enable "random" tests for Bellatrix. ## Notes This will break *partially* compatibility with Kintusgi testnets in order to gain compatibility with [Kiln](https://hackmd.io/@n0ble/kiln-spec) testnets. I think it will only break the BN APIs due to the `receipts_root` change, however it might have some other effects too. Co-authored-by: Michael Sproul <micsproul@gmail.com>
This commit is contained in:
@@ -28,6 +28,11 @@ pub enum Domain {
|
||||
#[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))]
|
||||
#[derive(PartialEq, Debug, Clone)]
|
||||
pub struct ChainSpec {
|
||||
/*
|
||||
* Config name
|
||||
*/
|
||||
pub config_name: Option<String>,
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
@@ -405,6 +410,10 @@ impl ChainSpec {
|
||||
/// Returns a `ChainSpec` compatible with the Ethereum Foundation specification.
|
||||
pub fn mainnet() -> Self {
|
||||
Self {
|
||||
/*
|
||||
* Config name
|
||||
*/
|
||||
config_name: Some("mainnet".to_string()),
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
@@ -563,6 +572,7 @@ impl ChainSpec {
|
||||
let boot_nodes = vec![];
|
||||
|
||||
Self {
|
||||
config_name: None,
|
||||
max_committees_per_slot: 4,
|
||||
target_committee_size: 4,
|
||||
churn_limit_quotient: 32,
|
||||
@@ -600,6 +610,7 @@ impl ChainSpec {
|
||||
/// Returns a `ChainSpec` compatible with the Gnosis Beacon Chain specification.
|
||||
pub fn gnosis() -> Self {
|
||||
Self {
|
||||
config_name: Some("gnosis".to_string()),
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
@@ -763,6 +774,10 @@ impl Default for ChainSpec {
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
|
||||
#[serde(rename_all = "UPPERCASE")]
|
||||
pub struct Config {
|
||||
#[serde(default)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub config_name: Option<String>,
|
||||
|
||||
#[serde(default)]
|
||||
pub preset_base: String,
|
||||
|
||||
@@ -914,6 +929,7 @@ impl Config {
|
||||
|
||||
pub fn from_chain_spec<T: EthSpec>(spec: &ChainSpec) -> Self {
|
||||
Self {
|
||||
config_name: spec.config_name.clone(),
|
||||
preset_base: T::spec_name().to_string(),
|
||||
|
||||
terminal_total_difficulty: spec.terminal_total_difficulty,
|
||||
@@ -964,6 +980,7 @@ impl Config {
|
||||
pub fn apply_to_chain_spec<T: EthSpec>(&self, chain_spec: &ChainSpec) -> Option<ChainSpec> {
|
||||
// Pattern match here to avoid missing any fields.
|
||||
let &Config {
|
||||
ref config_name,
|
||||
ref preset_base,
|
||||
terminal_total_difficulty,
|
||||
terminal_block_hash,
|
||||
@@ -997,6 +1014,7 @@ impl Config {
|
||||
}
|
||||
|
||||
Some(ChainSpec {
|
||||
config_name: config_name.clone(),
|
||||
min_genesis_active_validator_count,
|
||||
min_genesis_time,
|
||||
genesis_fork_version,
|
||||
|
||||
@@ -46,7 +46,6 @@ impl ConfigAndPreset {
|
||||
let u32_hex = |v: u32| hex_string(&v.to_le_bytes());
|
||||
let u8_hex = |v: u8| hex_string(&v.to_le_bytes());
|
||||
let fields = vec![
|
||||
("config_name", self.config.preset_base.clone()),
|
||||
(
|
||||
"bls_withdrawal_prefix",
|
||||
u8_hex(spec.bls_withdrawal_prefix_byte),
|
||||
|
||||
@@ -18,7 +18,7 @@ pub struct ExecutionPayload<T: EthSpec> {
|
||||
pub parent_hash: Hash256,
|
||||
pub fee_recipient: Address,
|
||||
pub state_root: Hash256,
|
||||
pub receipt_root: Hash256,
|
||||
pub receipts_root: Hash256,
|
||||
#[serde(with = "ssz_types::serde_utils::hex_fixed_vec")]
|
||||
pub logs_bloom: FixedVector<u8, T::BytesPerLogsBloom>,
|
||||
pub random: Hash256,
|
||||
|
||||
@@ -12,7 +12,7 @@ pub struct ExecutionPayloadHeader<T: EthSpec> {
|
||||
pub parent_hash: Hash256,
|
||||
pub fee_recipient: Address,
|
||||
pub state_root: Hash256,
|
||||
pub receipt_root: Hash256,
|
||||
pub receipts_root: Hash256,
|
||||
#[serde(with = "ssz_types::serde_utils::hex_fixed_vec")]
|
||||
pub logs_bloom: FixedVector<u8, T::BytesPerLogsBloom>,
|
||||
pub random: Hash256,
|
||||
|
||||
Reference in New Issue
Block a user