From b2bb478fbdef5c8cef476282c91bc289575b72b1 Mon Sep 17 00:00:00 2001 From: ltitanb Date: Mon, 7 Oct 2024 13:08:44 +0100 Subject: [PATCH 1/2] add sepolia preset --- crates/common/src/signature.rs | 4 + crates/common/src/types.rs | 68 +++++++-- ..._spec_data.json => mainnet_spec_data.json} | 42 +++--- tests/data/sepolia_spec_data.json | 140 ++++++++++++++++++ 4 files changed, 222 insertions(+), 32 deletions(-) rename tests/data/{holesky_spec_data.json => mainnet_spec_data.json} (84%) create mode 100644 tests/data/sepolia_spec_data.json diff --git a/crates/common/src/signature.rs b/crates/common/src/signature.rs index 49f4ddb..a97b8f1 100644 --- a/crates/common/src/signature.rs +++ b/crates/common/src/signature.rs @@ -104,6 +104,10 @@ mod tests { compute_domain(Chain::Holesky, APPLICATION_BUILDER_DOMAIN), Chain::Holesky.builder_domain() ); + assert_eq!( + compute_domain(Chain::Sepolia, APPLICATION_BUILDER_DOMAIN), + Chain::Sepolia.builder_domain() + ); assert_eq!( compute_domain(Chain::Helder, APPLICATION_BUILDER_DOMAIN), Chain::Helder.builder_domain() diff --git a/crates/common/src/types.rs b/crates/common/src/types.rs index 7d40f29..a7aeba5 100644 --- a/crates/common/src/types.rs +++ b/crates/common/src/types.rs @@ -21,6 +21,7 @@ pub struct Jwt(pub String); pub enum Chain { Mainnet, Holesky, + Sepolia, Helder, Custom { genesis_time_secs: u64, slot_time_secs: u64, genesis_fork_version: [u8; 4] }, } @@ -30,6 +31,7 @@ impl std::fmt::Debug for Chain { match self { Self::Mainnet => write!(f, "Mainnet"), Self::Holesky => write!(f, "Holesky"), + Self::Sepolia => write!(f, "Sepolia"), Self::Helder => write!(f, "Helder"), Self::Custom { genesis_time_secs, slot_time_secs, genesis_fork_version } => f .debug_struct("Custom") @@ -46,6 +48,7 @@ impl Chain { match self { Chain::Mainnet => KnownChain::Mainnet.builder_domain(), Chain::Holesky => KnownChain::Holesky.builder_domain(), + Chain::Sepolia => KnownChain::Sepolia.builder_domain(), Chain::Helder => KnownChain::Helder.builder_domain(), Chain::Custom { .. } => compute_domain(*self, APPLICATION_BUILDER_DOMAIN), } @@ -55,6 +58,7 @@ impl Chain { match self { Chain::Mainnet => KnownChain::Mainnet.genesis_fork_version(), Chain::Holesky => KnownChain::Holesky.genesis_fork_version(), + Chain::Sepolia => KnownChain::Sepolia.genesis_fork_version(), Chain::Helder => KnownChain::Helder.genesis_fork_version(), Chain::Custom { genesis_fork_version, .. } => *genesis_fork_version, } @@ -64,6 +68,7 @@ impl Chain { match self { Chain::Mainnet => KnownChain::Mainnet.genesis_time_sec(), Chain::Holesky => KnownChain::Holesky.genesis_time_sec(), + Chain::Sepolia => KnownChain::Sepolia.genesis_time_sec(), Chain::Helder => KnownChain::Helder.genesis_time_sec(), Chain::Custom { genesis_time_secs, .. } => *genesis_time_secs, } @@ -73,6 +78,7 @@ impl Chain { match self { Chain::Mainnet => KnownChain::Mainnet.slot_time_sec(), Chain::Holesky => KnownChain::Holesky.slot_time_sec(), + Chain::Sepolia => KnownChain::Sepolia.slot_time_sec(), Chain::Helder => KnownChain::Helder.slot_time_sec(), Chain::Custom { slot_time_secs, .. } => *slot_time_secs, } @@ -85,6 +91,8 @@ pub enum KnownChain { Mainnet, #[serde(alias = "holesky")] Holesky, + #[serde(alias = "sepolia")] + Sepolia, #[serde(alias = "helder")] Helder, } @@ -101,6 +109,10 @@ impl KnownChain { 0, 0, 0, 1, 91, 131, 162, 55, 89, 197, 96, 178, 208, 198, 69, 118, 225, 220, 252, 52, 234, 148, 196, 152, 143, 62, 13, 159, 119, 240, 83, 135, ], + KnownChain::Sepolia => [ + 0, 0, 0, 1, 211, 1, 7, 120, 205, 8, 238, 81, 75, 8, 254, 103, 182, 197, 3, 181, 16, + 152, 122, 76, 228, 63, 66, 48, 109, 151, 198, 124, + ], KnownChain::Helder => [ 0, 0, 0, 1, 148, 196, 26, 244, 132, 255, 247, 150, 73, 105, 224, 189, 217, 34, 248, 45, 255, 15, 75, 232, 122, 96, 208, 102, 76, 201, 209, 255, @@ -110,9 +122,10 @@ impl KnownChain { pub fn genesis_fork_version(&self) -> [u8; 4] { match self { - KnownChain::Mainnet => [0u8; 4], - KnownChain::Holesky => [1, 1, 112, 0], - KnownChain::Helder => [16, 0, 0, 0], + KnownChain::Mainnet => hex!("00000000"), + KnownChain::Holesky => hex!("01017000"), + KnownChain::Sepolia => hex!("90000069"), + KnownChain::Helder => hex!("10000000"), } } @@ -120,13 +133,17 @@ impl KnownChain { match self { KnownChain::Mainnet => 1606824023, KnownChain::Holesky => 1695902400, + KnownChain::Sepolia => 1655733600, KnownChain::Helder => 1718967660, } } pub fn slot_time_sec(&self) -> u64 { match self { - KnownChain::Mainnet | KnownChain::Holesky | KnownChain::Helder => 12, + KnownChain::Mainnet | + KnownChain::Holesky | + KnownChain::Sepolia | + KnownChain::Helder => 12, } } } @@ -136,6 +153,7 @@ impl From for Chain { match value { KnownChain::Mainnet => Chain::Mainnet, KnownChain::Holesky => Chain::Holesky, + KnownChain::Sepolia => Chain::Sepolia, KnownChain::Helder => Chain::Helder, } } @@ -157,6 +175,7 @@ impl Serialize for Chain { let loader = match self { Chain::Mainnet => ChainLoader::Known(KnownChain::Mainnet), Chain::Holesky => ChainLoader::Known(KnownChain::Holesky), + Chain::Sepolia => ChainLoader::Known(KnownChain::Sepolia), Chain::Helder => ChainLoader::Known(KnownChain::Helder), Chain::Custom { genesis_time_secs, slot_time_secs, genesis_fork_version } => { ChainLoader::Custom { @@ -214,6 +233,10 @@ pub fn load_chain_from_file(path: PathBuf) -> eyre::Result { let genesis_fork_version: [u8; 4] = self.genesis_fork_version.as_ref().try_into()?; Ok(Chain::Custom { + // note that this can be wrong, (e.g. it's wrong in mainnet). The correct + // value should come from /eth/v1/beacon/genesis + // more info here: https://kb.beaconcha.in/ethereum-staking/the-genesis-event + // FIXME genesis_time_secs: self.min_genesis_time + self.genesis_delay, slot_time_secs: self.seconds_per_slot, genesis_fork_version, @@ -289,13 +312,34 @@ mod tests { } #[test] - fn test_load_file_data_json() { + fn test_spec_mainnet_data_json() { let a = env!("CARGO_MANIFEST_DIR"); let mut path = PathBuf::from(a); path.pop(); path.pop(); - path.push("tests/data/holesky_spec_data.json"); + path.push("tests/data/mainnet_spec_data.json"); + + let s = format!("chain = {path:?}"); + + let decoded: MockConfig = toml::from_str(&s).unwrap(); + + // see fixme in load_chain_from_file + assert_eq!(decoded.chain.slot_time_sec(), KnownChain::Mainnet.slot_time_sec()); + assert_eq!( + decoded.chain.genesis_fork_version(), + KnownChain::Mainnet.genesis_fork_version() + ); + } + + #[test] + fn test_spec_holesky_json() { + let a = env!("CARGO_MANIFEST_DIR"); + let mut path = PathBuf::from(a); + + path.pop(); + path.pop(); + path.push("tests/data/holesky_spec.json"); let s = format!("chain = {path:?}"); @@ -308,26 +352,26 @@ mod tests { } #[test] - fn test_load_file_json() { + fn test_spec_sepolia_data_json() { let a = env!("CARGO_MANIFEST_DIR"); let mut path = PathBuf::from(a); path.pop(); path.pop(); - path.push("tests/data/holesky_spec.json"); + path.push("tests/data/sepolia_spec_data.json"); let s = format!("chain = {path:?}"); let decoded: MockConfig = toml::from_str(&s).unwrap(); assert_eq!(decoded.chain, Chain::Custom { - genesis_time_secs: KnownChain::Holesky.genesis_time_sec(), - slot_time_secs: KnownChain::Holesky.slot_time_sec(), - genesis_fork_version: KnownChain::Holesky.genesis_fork_version() + genesis_time_secs: KnownChain::Sepolia.genesis_time_sec(), + slot_time_secs: KnownChain::Sepolia.slot_time_sec(), + genesis_fork_version: KnownChain::Sepolia.genesis_fork_version() }) } #[test] - fn test_load_file_yml() { + fn test_spec_helder_yml() { let a = env!("CARGO_MANIFEST_DIR"); let mut path = PathBuf::from(a); diff --git a/tests/data/holesky_spec_data.json b/tests/data/mainnet_spec_data.json similarity index 84% rename from tests/data/holesky_spec_data.json rename to tests/data/mainnet_spec_data.json index a7bde18..e60edc6 100644 --- a/tests/data/holesky_spec_data.json +++ b/tests/data/mainnet_spec_data.json @@ -2,7 +2,7 @@ "data": { "SLOTS_PER_EPOCH": "32", "PRESET_BASE": "mainnet", - "TERMINAL_TOTAL_DIFFICULTY": "0", + "TERMINAL_TOTAL_DIFFICULTY": "58750000000000000000000", "INACTIVITY_SCORE_BIAS": "4", "PENDING_BALANCE_DEPOSITS_LIMIT": "134217728", "MAX_ATTESTER_SLASHINGS": "2", @@ -19,10 +19,11 @@ "RESP_TIMEOUT": "10", "DOMAIN_VOLUNTARY_EXIT": "0x04000000", "MAX_VALIDATORS_PER_COMMITTEE": "2048", - "MIN_GENESIS_TIME": "1695902100", - "ALTAIR_FORK_EPOCH": "0", + "MIN_GENESIS_TIME": "1606824000", + "ALTAIR_FORK_EPOCH": "74240", + "MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT": "256000000000", "HYSTERESIS_QUOTIENT": "4", - "ALTAIR_FORK_VERSION": "0x02017000", + "ALTAIR_FORK_VERSION": "0x01000000", "MAX_BYTES_PER_TRANSACTION": "1073741824", "MAX_CHUNK_SIZE": "10485760", "TTFB_TIMEOUT": "5", @@ -34,7 +35,7 @@ "MAX_ATTESTER_SLASHINGS_ELECTRA": "1", "TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE": "16", "MAX_DEPOSITS": "16", - "BELLATRIX_FORK_EPOCH": "0", + "BELLATRIX_FORK_EPOCH": "144896", "MAX_REQUEST_BLOB_SIDECARS": "768", "REORG_HEAD_WEIGHT_THRESHOLD": "20", "TARGET_AGGREGATORS_PER_COMMITTEE": "16", @@ -48,31 +49,33 @@ "EPOCHS_PER_SUBNET_SUBSCRIPTION": "256", "MAX_ATTESTATIONS_ELECTRA": "8", "ATTESTATION_SUBNET_COUNT": "64", - "GENESIS_DELAY": "300", + "GENESIS_DELAY": "604800", "MAX_SEED_LOOKAHEAD": "4", "ETH1_FOLLOW_DISTANCE": "2048", "SECONDS_PER_SLOT": "12", "REORG_PARENT_WEIGHT_THRESHOLD": "160", "MIN_SYNC_COMMITTEE_PARTICIPANTS": "1", - "BELLATRIX_FORK_VERSION": "0x03017000", + "BELLATRIX_FORK_VERSION": "0x02000000", "PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX": "3", "EFFECTIVE_BALANCE_INCREMENT": "1000000000", + "MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA": "128000000000", "FIELD_ELEMENTS_PER_BLOB": "4096", "MIN_EPOCHS_TO_INACTIVITY_PENALTY": "4", "BASE_REWARD_FACTOR": "64", "MAX_EXTRA_DATA_BYTES": "32", - "CONFIG_NAME": "holesky", + "CONFIG_NAME": "mainnet", "MAX_PROPOSER_SLASHINGS": "16", + "MAX_CONSOLIDATIONS": "1", "INACTIVITY_SCORE_RECOVERY_RATE": "16", "MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS": "4096", "MAX_TRANSACTIONS_PER_PAYLOAD": "1048576", - "DEPOSIT_CONTRACT_ADDRESS": "0x4242424242424242424242424242424242424242", + "DEPOSIT_CONTRACT_ADDRESS": "0x00000000219ab540356cBB839Cbe05303d7705Fa", "MIN_ATTESTATION_INCLUSION_DELAY": "1", "SHUFFLE_ROUND_COUNT": "90", "TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH": "18446744073709551615", "MAX_EFFECTIVE_BALANCE": "32000000000", "DOMAIN_BEACON_PROPOSER": "0x00000000", - "DENEB_FORK_EPOCH": "29696", + "DENEB_FORK_EPOCH": "269568", "DOMAIN_SYNC_COMMITTEE": "0x07000000", "PROPOSER_SCORE_BOOST": "40", "DOMAIN_SELECTION_PROOF": "0x05000000", @@ -93,13 +96,14 @@ "UPDATE_TIMEOUT": "8192", "ELECTRA_FORK_EPOCH": "18446744073709551615", "SYNC_COMMITTEE_BRANCH_LENGTH": "5", - "DEPOSIT_CHAIN_ID": "17000", + "DEPOSIT_CHAIN_ID": "1", "MAX_BLOB_COMMITMENTS_PER_BLOCK": "4096", "DOMAIN_RANDAO": "0x02000000", - "CAPELLA_FORK_VERSION": "0x04017000", + "CAPELLA_FORK_VERSION": "0x03000000", "MAX_EFFECTIVE_BALANCE_ELECTRA": "2048000000000", "MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR": "64", "EPOCHS_PER_ETH1_VOTING_PERIOD": "64", + "MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD": "8192", "WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA": "4096", "HISTORICAL_ROOTS_LIMIT": "16777216", "ATTESTATION_PROPAGATION_SLOT_RANGE": "32", @@ -115,22 +119,20 @@ "MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP": "8", "EPOCHS_PER_SYNC_COMMITTEE_PERIOD": "256", "BYTES_PER_LOGS_BLOOM": "256", - "MAX_DEPOSIT_REQUESTS_PER_PAYLOAD": "8192", "MIN_GENESIS_ACTIVE_VALIDATOR_COUNT": "16384", "MAX_ATTESTATIONS": "128", "MIN_EPOCHS_FOR_BLOCK_REQUESTS": "33024", - "DENEB_FORK_VERSION": "0x05017000", - "ELECTRA_FORK_VERSION": "0x06017000", + "DENEB_FORK_VERSION": "0x04000000", + "ELECTRA_FORK_VERSION": "0x05000000", "MAX_REQUEST_BLOCKS": "1024", - "GENESIS_FORK_VERSION": "0x01017000", + "GENESIS_FORK_VERSION": "0x00000000", "KZG_COMMITMENT_INCLUSION_PROOF_DEPTH": "17", - "DEPOSIT_NETWORK_ID": "17000", - "MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD": "1", + "DEPOSIT_NETWORK_ID": "1", "MAX_REQUEST_BLOCKS_DENEB": "128", "BLOB_SIDECAR_SUBNET_COUNT": "6", "SYNC_COMMITTEE_SUBNET_COUNT": "4", - "CAPELLA_FORK_EPOCH": "256", - "EJECTION_BALANCE": "28000000000", + "CAPELLA_FORK_EPOCH": "194048", + "EJECTION_BALANCE": "16000000000", "ATTESTATION_SUBNET_EXTRA_BITS": "0", "MAX_COMMITTEES_PER_SLOT": "64", "SHARD_COMMITTEE_PERIOD": "256", diff --git a/tests/data/sepolia_spec_data.json b/tests/data/sepolia_spec_data.json new file mode 100644 index 0000000..6e20afd --- /dev/null +++ b/tests/data/sepolia_spec_data.json @@ -0,0 +1,140 @@ +{ + "data": { + "SLOTS_PER_EPOCH": "32", + "PRESET_BASE": "mainnet", + "TERMINAL_TOTAL_DIFFICULTY": "17000000000000000", + "INACTIVITY_SCORE_BIAS": "4", + "PENDING_BALANCE_DEPOSITS_LIMIT": "134217728", + "MAX_ATTESTER_SLASHINGS": "2", + "MAX_WITHDRAWALS_PER_PAYLOAD": "16", + "INACTIVITY_PENALTY_QUOTIENT_BELLATRIX": "16777216", + "PENDING_PARTIAL_WITHDRAWALS_LIMIT": "134217728", + "INACTIVITY_PENALTY_QUOTIENT": "67108864", + "SAFE_SLOTS_TO_UPDATE_JUSTIFIED": "8", + "SECONDS_PER_ETH1_BLOCK": "14", + "MIN_SEED_LOOKAHEAD": "1", + "VALIDATOR_REGISTRY_LIMIT": "1099511627776", + "SLOTS_PER_HISTORICAL_ROOT": "8192", + "RESP_TIMEOUT": "10", + "DOMAIN_VOLUNTARY_EXIT": "0x04000000", + "MAX_VALIDATORS_PER_COMMITTEE": "2048", + "MIN_GENESIS_TIME": "1655647200", + "ALTAIR_FORK_EPOCH": "50", + "HYSTERESIS_QUOTIENT": "4", + "ALTAIR_FORK_VERSION": "0x90000070", + "MAX_BYTES_PER_TRANSACTION": "1073741824", + "MAX_CHUNK_SIZE": "10485760", + "TTFB_TIMEOUT": "5", + "WHISTLEBLOWER_REWARD_QUOTIENT": "512", + "PROPOSER_REWARD_QUOTIENT": "8", + "MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP": "16384", + "EPOCHS_PER_HISTORICAL_VECTOR": "65536", + "MIN_PER_EPOCH_CHURN_LIMIT": "4", + "MAX_ATTESTER_SLASHINGS_ELECTRA": "1", + "TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE": "16", + "MAX_DEPOSITS": "16", + "BELLATRIX_FORK_EPOCH": "100", + "MAX_REQUEST_BLOB_SIDECARS": "768", + "TARGET_AGGREGATORS_PER_COMMITTEE": "16", + "DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF": "0x08000000", + "MESSAGE_DOMAIN_INVALID_SNAPPY": "0x00000000", + "EPOCHS_PER_SLASHINGS_VECTOR": "8192", + "MIN_SLASHING_PENALTY_QUOTIENT": "128", + "MAX_BLS_TO_EXECUTION_CHANGES": "16", + "GOSSIP_MAX_SIZE": "10485760", + "DOMAIN_BEACON_ATTESTER": "0x01000000", + "EPOCHS_PER_SUBNET_SUBSCRIPTION": "256", + "MAX_ATTESTATIONS_ELECTRA": "8", + "ATTESTATION_SUBNET_COUNT": "64", + "GENESIS_DELAY": "86400", + "MAX_SEED_LOOKAHEAD": "4", + "ETH1_FOLLOW_DISTANCE": "2048", + "SECONDS_PER_SLOT": "12", + "MIN_SYNC_COMMITTEE_PARTICIPANTS": "1", + "BELLATRIX_FORK_VERSION": "0x90000071", + "PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX": "3", + "EFFECTIVE_BALANCE_INCREMENT": "1000000000", + "FIELD_ELEMENTS_PER_BLOB": "4096", + "MIN_EPOCHS_TO_INACTIVITY_PENALTY": "4", + "BASE_REWARD_FACTOR": "64", + "MAX_EXTRA_DATA_BYTES": "32", + "CONFIG_NAME": "sepolia", + "MAX_PROPOSER_SLASHINGS": "16", + "MAX_CONSOLIDATIONS": "1", + "INACTIVITY_SCORE_RECOVERY_RATE": "16", + "MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS": "4096", + "MAX_TRANSACTIONS_PER_PAYLOAD": "1048576", + "DEPOSIT_CONTRACT_ADDRESS": "0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D", + "MIN_ATTESTATION_INCLUSION_DELAY": "1", + "SHUFFLE_ROUND_COUNT": "90", + "TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH": "18446744073709551615", + "MAX_EFFECTIVE_BALANCE": "32000000000", + "DOMAIN_BEACON_PROPOSER": "0x00000000", + "DENEB_FORK_EPOCH": "132608", + "DOMAIN_SYNC_COMMITTEE": "0x07000000", + "PROPOSER_SCORE_BOOST": "40", + "DOMAIN_SELECTION_PROOF": "0x05000000", + "MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX": "32", + "MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT": "8", + "HYSTERESIS_UPWARD_MULTIPLIER": "5", + "SUBNETS_PER_NODE": "2", + "MIN_DEPOSIT_AMOUNT": "1000000000", + "MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA": "4096", + "PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR": "2", + "MAX_BLOBS_PER_BLOCK": "6", + "MIN_VALIDATOR_WITHDRAWABILITY_DELAY": "256", + "MAXIMUM_GOSSIP_CLOCK_DISPARITY": "500", + "TARGET_COMMITTEE_SIZE": "128", + "TERMINAL_BLOCK_HASH": "0x0000000000000000000000000000000000000000000000000000000000000000", + "DOMAIN_DEPOSIT": "0x03000000", + "DOMAIN_CONTRIBUTION_AND_PROOF": "0x09000000", + "UPDATE_TIMEOUT": "8192", + "ELECTRA_FORK_EPOCH": "18446744073709551615", + "SYNC_COMMITTEE_BRANCH_LENGTH": "5", + "DEPOSIT_CHAIN_ID": "11155111", + "MAX_BLOB_COMMITMENTS_PER_BLOCK": "4096", + "DOMAIN_RANDAO": "0x02000000", + "CAPELLA_FORK_VERSION": "0x90000072", + "MAX_EFFECTIVE_BALANCE_ELECTRA": "2048000000000", + "MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR": "64", + "EPOCHS_PER_ETH1_VOTING_PERIOD": "64", + "MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD": "8192", + "WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA": "4096", + "HISTORICAL_ROOTS_LIMIT": "16777216", + "ATTESTATION_PROPAGATION_SLOT_RANGE": "32", + "SYNC_COMMITTEE_SIZE": "512", + "ATTESTATION_SUBNET_PREFIX_BITS": "6", + "PROPORTIONAL_SLASHING_MULTIPLIER": "1", + "MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD": "16", + "MESSAGE_DOMAIN_VALID_SNAPPY": "0x01000000", + "MAX_VOLUNTARY_EXITS": "16", + "PENDING_CONSOLIDATIONS_LIMIT": "262144", + "HYSTERESIS_DOWNWARD_MULTIPLIER": "1", + "DOMAIN_APPLICATION_BUILDER": "0x00000001", + "MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP": "8", + "EPOCHS_PER_SYNC_COMMITTEE_PERIOD": "256", + "BYTES_PER_LOGS_BLOOM": "256", + "MIN_GENESIS_ACTIVE_VALIDATOR_COUNT": "1300", + "MAX_ATTESTATIONS": "128", + "MIN_EPOCHS_FOR_BLOCK_REQUESTS": "33024", + "DENEB_FORK_VERSION": "0x90000073", + "ELECTRA_FORK_VERSION": "0x90000074", + "MAX_REQUEST_BLOCKS": "1024", + "GENESIS_FORK_VERSION": "0x90000069", + "KZG_COMMITMENT_INCLUSION_PROOF_DEPTH": "17", + "DEPOSIT_NETWORK_ID": "11155111", + "MAX_REQUEST_BLOCKS_DENEB": "128", + "BLOB_SIDECAR_SUBNET_COUNT": "6", + "SYNC_COMMITTEE_SUBNET_COUNT": "4", + "CAPELLA_FORK_EPOCH": "56832", + "EJECTION_BALANCE": "16000000000", + "ATTESTATION_SUBNET_EXTRA_BITS": "0", + "MAX_COMMITTEES_PER_SLOT": "64", + "SHARD_COMMITTEE_PERIOD": "256", + "INACTIVITY_PENALTY_QUOTIENT_ALTAIR": "50331648", + "DOMAIN_AGGREGATE_AND_PROOF": "0x06000000", + "CHURN_LIMIT_QUOTIENT": "65536", + "BLS_WITHDRAWAL_PREFIX": "0x00", + "MIN_ACTIVATION_BALANCE": "32000000000" + } +} \ No newline at end of file From 99c2e966e5283b26150ea979a6fde6a49ba750ee Mon Sep 17 00:00:00 2001 From: ltitanb Date: Mon, 7 Oct 2024 13:09:01 +0100 Subject: [PATCH 2/2] fix false positive test failures --- crates/common/src/pbs/types/beacon_block.rs | 10 +++--- .../common/src/pbs/types/execution_payload.rs | 2 +- crates/common/src/pbs/types/get_header.rs | 2 +- tests/data/registration_holesky.json | 34 +++++++++---------- tests/data/signed_blinded_block_holesky.json | 2 +- tests/data/submit_block_response_holesky.json | 34 +++++++++---------- 6 files changed, 42 insertions(+), 42 deletions(-) diff --git a/crates/common/src/pbs/types/beacon_block.rs b/crates/common/src/pbs/types/beacon_block.rs index 0bf8538..e17f1f8 100644 --- a/crates/common/src/pbs/types/beacon_block.rs +++ b/crates/common/src/pbs/types/beacon_block.rs @@ -215,7 +215,7 @@ mod tests { }, "execution_payload_header": { "parent_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "fee_recipient": "0xAbcF8e0d4e9587369b2301D0790347320302cc09", + "fee_recipient": "0xabcf8e0d4e9587369b2301d0790347320302cc09", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "receipts_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "logs_bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", @@ -237,7 +237,7 @@ mod tests { "message": { "validator_index": "1", "from_bls_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - "to_execution_address": "0xAbcF8e0d4e9587369b2301D0790347320302cc09" + "to_execution_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } @@ -537,7 +537,7 @@ mod tests { }, "execution_payload_header": { "parent_hash": "0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f", - "fee_recipient": "0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134", + "fee_recipient": "0xf97e180c050e5ab072211ad2c213eb5aee4df134", "state_root": "0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38", "receipts_root": "0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996", "logs_bloom": "0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000", @@ -579,7 +579,7 @@ mod tests { "execution_payload": { "parent_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "fee_recipient": "0xAbcF8e0d4e9587369b2301D0790347320302cc09", + "fee_recipient": "0xabcf8e0d4e9587369b2301d0790347320302cc09", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "receipts_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", @@ -603,7 +603,7 @@ mod tests { { "index": "1", "validator_index": "1", - "address": "0xAbcF8e0d4e9587369b2301D0790347320302cc09", + "address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", "amount": "32000000000" } ] diff --git a/crates/common/src/pbs/types/execution_payload.rs b/crates/common/src/pbs/types/execution_payload.rs index 6df0258..e593f5f 100644 --- a/crates/common/src/pbs/types/execution_payload.rs +++ b/crates/common/src/pbs/types/execution_payload.rs @@ -111,7 +111,7 @@ mod tests { fn test_execution_payload_header() { let data = r#"{ "parent_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "fee_recipient": "0xAbcF8e0d4e9587369b2301D0790347320302cc09", + "fee_recipient": "0xabcf8e0d4e9587369b2301d0790347320302cc09", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "receipts_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "logs_bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", diff --git a/crates/common/src/pbs/types/get_header.rs b/crates/common/src/pbs/types/get_header.rs index 069c77f..f8591a2 100644 --- a/crates/common/src/pbs/types/get_header.rs +++ b/crates/common/src/pbs/types/get_header.rs @@ -67,7 +67,7 @@ mod tests { "message": { "header": { "parent_hash": "0x114d1897fefa402a01a653c21a7f1f1db049d1373a5e73a2d25d7a8045dc02a1", - "fee_recipient": "0x1268AD189526AC0b386faF06eFfC46779c340eE6", + "fee_recipient": "0x1268ad189526ac0b386faf06effc46779c340ee6", "state_root": "0x53ffe6d7d4bbcc5ef71429ce82b3d7bbfffddaed89d53979bf4dca7af0dbe94c", "receipts_root": "0x3d67a1bb141379c352c95126c4dd06a4fe086efdc00b6e919b050c84d79f4df2", "logs_bloom": "0x05440404082f80182749948b189406732c7da48ce83013f11c02562c0d10cc714002025f21c1c64b21293e4c40c5b58e5404aed7922104002008019258ad7020097424e0b01d41eb474dc0cd26c0c9298c640692260452e27104ac808a050a0dc47187f40386108058b301007229b82f0d30bb082c72410043005e32a42c841841184260c0d744a4a9a190840048a4590011e00084ca62a8ce3a030d640350214fbedf09f041823266c491b128800802a200eb1048341000fa810323c4825804643b68ca2301c559881c0e944334c843016e0874010c81009100348a1900e0546014239b02e956940d1408c1824847516850d8de4a110495f3d9a4d8c00808a0", diff --git a/tests/data/registration_holesky.json b/tests/data/registration_holesky.json index 111b74e..ce5df39 100644 --- a/tests/data/registration_holesky.json +++ b/tests/data/registration_holesky.json @@ -1,7 +1,7 @@ [ { "message": { - "fee_recipient": "0x4770B19C113cbC07e220d51E6A9fBC4ED30Fa51a", + "fee_recipient": "0x4770b19c113cbc07e220d51e6a9fbc4ed30fa51a", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0x874564874fc4cb9ce548ce09b2e1614be8ed4be7b7882cef413a09e2b48b9c6e11c67d0e95b5945ace53424c4c2dc70e" @@ -10,7 +10,7 @@ }, { "message": { - "fee_recipient": "0x02a9d3637126923De9369557CD9673aae46666Fd", + "fee_recipient": "0x02a9d3637126923de9369557cd9673aae46666fd", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0x964fbfc9d5de5723b5e7386c37638f369e23d9df7d1b57ff427935257738518508199652339abd7c9e4cc05f2aa65ca3" @@ -19,7 +19,7 @@ }, { "message": { - "fee_recipient": "0x4b7c65194f8144c930079e6171E4a2c4DC46206e", + "fee_recipient": "0x4b7c65194f8144c930079e6171e4a2c4dc46206e", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0x93a7da94a32c25f8d26d07f4444b59c2534657be319d891515d215bd05ac9acbf8315496d755db38a3ebeec39c761f79" @@ -28,7 +28,7 @@ }, { "message": { - "fee_recipient": "0x4b7c65194f8144c930079e6171E4a2c4DC46206e", + "fee_recipient": "0x4b7c65194f8144c930079e6171e4a2c4dc46206e", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0xa75c8ecc47b74f06ed176506de9bc7b0be16286b88760c53dad3f384858a7411dd9f17659cf0e0b242e9b01bc2c1ec3e" @@ -37,7 +37,7 @@ }, { "message": { - "fee_recipient": "0x02a9d3637126923De9369557CD9673aae46666Fd", + "fee_recipient": "0x02a9d3637126923de9369557cd9673aae46666fd", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0xb0c82175cf48f0e66dd18ee214447246d8f17050a85a7aaa1d54437110be2d8ce653f27279e759103546134ece5024e1" @@ -46,7 +46,7 @@ }, { "message": { - "fee_recipient": "0x02a9d3637126923De9369557CD9673aae46666Fd", + "fee_recipient": "0x02a9d3637126923de9369557cd9673aae46666fd", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0xae728adbf92d2543f52d185db6f42e379ae495db5b6c3ea69fd629d35169834d622534bf73ab6f0c081f1b80e6568cd2" @@ -55,7 +55,7 @@ }, { "message": { - "fee_recipient": "0x02a9d3637126923De9369557CD9673aae46666Fd", + "fee_recipient": "0x02a9d3637126923de9369557cd9673aae46666fd", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0xad95c2ae134f81ef344d101c741aba4f74709d49e8812576606898b9592dfd28b8b56875f9227eb9653532a9fbbf2af9" @@ -64,7 +64,7 @@ }, { "message": { - "fee_recipient": "0x4b7c65194f8144c930079e6171E4a2c4DC46206e", + "fee_recipient": "0x4b7c65194f8144c930079e6171e4a2c4dc46206e", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0x93455720ed2c9d5978fa1ef70499708fe05ce8105a1e1e3fe38b96b9b44cbda407d4b379e5199b5b033c1e448f3a0aee" @@ -73,7 +73,7 @@ }, { "message": { - "fee_recipient": "0x02a9d3637126923De9369557CD9673aae46666Fd", + "fee_recipient": "0x02a9d3637126923de9369557cd9673aae46666fd", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0xa4401ba2aad5f89230a7031185a96bf442f3d5a8656bf71b26726538d08a6a10e06b401135c06c848160e4fc19af5e85" @@ -82,7 +82,7 @@ }, { "message": { - "fee_recipient": "0x02a9d3637126923De9369557CD9673aae46666Fd", + "fee_recipient": "0x02a9d3637126923de9369557cd9673aae46666fd", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0x830a2e821aa7e3eef052ea9234cdf8c3318e53fa2362d53de89518ceb38ad406dbc5df758cdc7fc0f5e9cb43856a0c2f" @@ -91,7 +91,7 @@ }, { "message": { - "fee_recipient": "0x4770B19C113cbC07e220d51E6A9fBC4ED30Fa51a", + "fee_recipient": "0x4770b19c113cbc07e220d51e6a9fbc4ed30fa51a", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0x874ac8ddd0bc03aab76387033796ecc35a9eee08e0dd5edbef86fbde9908dc2afdb2d52da6e4a9c2a849b81c717d7370" @@ -100,7 +100,7 @@ }, { "message": { - "fee_recipient": "0x4770B19C113cbC07e220d51E6A9fBC4ED30Fa51a", + "fee_recipient": "0x4770b19c113cbc07e220d51e6a9fbc4ed30fa51a", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0xa525b2c31e0d02f13eecac5886cfd07317dc40db322b686db11df3650ace655edff908a678e15bd61adbeb52f7090396" @@ -109,7 +109,7 @@ }, { "message": { - "fee_recipient": "0x02a9d3637126923De9369557CD9673aae46666Fd", + "fee_recipient": "0x02a9d3637126923de9369557cd9673aae46666fd", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0xa0c0e2d0caf4e671e1924bad74296595f992210cfb534fff332a99f2911279b2d40a9f9723c9a07a4fb23d7d2b64abb2" @@ -118,7 +118,7 @@ }, { "message": { - "fee_recipient": "0x02a9d3637126923De9369557CD9673aae46666Fd", + "fee_recipient": "0x02a9d3637126923de9369557cd9673aae46666fd", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0xb5661b161e50bef696f2f0275ef0f67008480e890ae4505b7401e311ee0e0acd0e13aee072aff65e6bd5db1473231d40" @@ -127,7 +127,7 @@ }, { "message": { - "fee_recipient": "0x4770B19C113cbC07e220d51E6A9fBC4ED30Fa51a", + "fee_recipient": "0x4770b19c113cbc07e220d51e6a9fbc4ed30fa51a", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0x913e7a010ac919517c86bf1ec19a86b63c3fb8a0cea9ada5f7a27f0331e07de818cfe84126f36f4a8bf3b6f7e8d56d78" @@ -136,7 +136,7 @@ }, { "message": { - "fee_recipient": "0x4770B19C113cbC07e220d51E6A9fBC4ED30Fa51a", + "fee_recipient": "0x4770b19c113cbc07e220d51e6a9fbc4ed30fa51a", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0x96ceab797644db83f6bfcb0749db5208cbe9870f6b6d17dced68cb6b3f1335b097faeadc68180a9fc3e75f0c2bde4357" @@ -145,7 +145,7 @@ }, { "message": { - "fee_recipient": "0x02a9d3637126923De9369557CD9673aae46666Fd", + "fee_recipient": "0x02a9d3637126923de9369557cd9673aae46666fd", "gas_limit": "30000000", "timestamp": "1716391930", "pubkey": "0xaced93f48c587d7ca64e6013f6398d8adac2f424e981bd85fbed18ca67a4738465d1a56bf10cdc9e4b523c555fe12bdf" diff --git a/tests/data/signed_blinded_block_holesky.json b/tests/data/signed_blinded_block_holesky.json index d7ab6c0..54bd93e 100644 --- a/tests/data/signed_blinded_block_holesky.json +++ b/tests/data/signed_blinded_block_holesky.json @@ -2200,7 +2200,7 @@ }, "execution_payload_header": { "parent_hash": "0x114d1897fefa402a01a653c21a7f1f1db049d1373a5e73a2d25d7a8045dc02a1", - "fee_recipient": "0x477cc10a5b54aeD5C88544C2e71eA0581cf64593", + "fee_recipient": "0x477cc10a5b54aed5c88544c2e71ea0581cf64593", "state_root": "0x6724be16ef8e65681cb66f9c144da67347b8983aa5e3f4662c9b5dba90ab5bc6", "receipts_root": "0xf2f6d2fe6960e4dedad18cca0c7881e6509d551d3e04c1879a627fb8aba30272", "logs_bloom": "0x00000400000000000000848008100000000000000000000004000000010080000000000100000400000000000000000000000000020100000000000000000000080004000000000800008008000000000000000020004000000400000000000000000000000400000000000000000000000000000010000002000010000000000000000000800000200100000000000000004000000000200002000004000000000800000000000000000000000000008000000000000000800000008000000400012002000000000000000000000000000200000000000000000000000000040000000000000000000000000000000000408000000000040000000000000000", diff --git a/tests/data/submit_block_response_holesky.json b/tests/data/submit_block_response_holesky.json index 3456a04..e2f2a17 100644 --- a/tests/data/submit_block_response_holesky.json +++ b/tests/data/submit_block_response_holesky.json @@ -3,7 +3,7 @@ "data": { "execution_payload": { "parent_hash": "0x7d1b19deda3378ae27947d8ad904886cde4600fe0f4d608c6ecd742d1ba8181b", - "fee_recipient": "0x32FdfD2eA08d916B8f4e73d057E99bc3358b2F4D", + "fee_recipient": "0x32fdfd2ea08d916b8f4e73d057e99bc3358b2f4d", "state_root": "0x60b508e5a6f505bc8e024a648fcf8c98278184fb674fb7c5544d6e3b196f9606", "receipts_root": "0x358fcd6d92db09e2273fb74eb3d62223aa4f0f77a9b92aec15295ddfdc134403", "logs_bloom": "0x140385010625042c0388589a111c20c068510a0010101250088d01160dd4d49020e0251504a140650484610000805800d0192104872406080101104105254900090020488226404b048d0a0b004409400119008354548454648004801820881500b51640020030d00800010402814891282000881408212c2000601801248440403520c100011413360180818049b0810520a0152821249bc0bd62014c66c021a2081181808810e000aa50a16092098102431303c184000492800010204860145102602a0380210105080019c160580a00122018100242002009914200006054081010220838261009142100e1348500293980192800b44ae3000444580c0004", @@ -134,97 +134,97 @@ { "index": "25404323", "validator_index": "135466", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6791519" }, { "index": "25404324", "validator_index": "135467", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6916089" }, { "index": "25404325", "validator_index": "135468", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6903258" }, { "index": "25404326", "validator_index": "135469", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6905481" }, { "index": "25404327", "validator_index": "135470", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6906478" }, { "index": "25404328", "validator_index": "135471", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6859379" }, { "index": "25404329", "validator_index": "135472", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6850481" }, { "index": "25404330", "validator_index": "135473", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6927834" }, { "index": "25404331", "validator_index": "135474", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6884689" }, { "index": "25404332", "validator_index": "135475", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6905196" }, { "index": "25404333", "validator_index": "135476", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6878941" }, { "index": "25404334", "validator_index": "135477", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6850202" }, { "index": "25404335", "validator_index": "135478", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6868123" }, { "index": "25404336", "validator_index": "135479", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6846854" }, { "index": "25404337", "validator_index": "135480", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6949024" }, { "index": "25404338", "validator_index": "135481", - "address": "0x9baA3244565d51D9C7897c0EB6679eD4890e536E", + "address": "0x9baa3244565d51d9c7897c0eb6679ed4890e536e", "amount": "6796446" } ],