Skip to content
Merged
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
3 changes: 2 additions & 1 deletion packages/beacon-node/test/spec/general/ssz_generic_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
ListBasicType,
ListCompositeType,
ProgressiveBitListType,
ProgressiveByteListType,
ProgressiveContainerType,
ProgressiveListBasicType,
ProgressiveListCompositeType,
Expand Down Expand Up @@ -85,7 +86,7 @@ const ComplexTestStruct = new ContainerType({
// C: ProgressiveList[SmallTestStruct]
// D: ProgressiveList[ProgressiveList[VarTestStruct]]
const ProgressiveTestStruct = new ContainerType({
A: new ProgressiveListBasicType(byte),
A: new ProgressiveByteListType(),
B: new ProgressiveListBasicType(uint64),
C: new ProgressiveListCompositeType(SmallTestStruct),
D: new ProgressiveListCompositeType(new ProgressiveListCompositeType(VarTestStruct)),
Expand Down
15 changes: 14 additions & 1 deletion packages/beacon-node/test/spec/presets/fast_confirmation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,12 @@ const fastConfirmationTest =
// and these tests are failing until we update our implementation.
name.includes("voting_source_beyond_two_epoch") ||
name.includes("justified_update_always_if_better") ||
name.includes("justified_update_not_realized_finality"),
name.includes("justified_update_not_realized_finality") ||
// TODO: lodestar's fast-confirmation rule (FCR) needs a broader overhaul. These two
// is_one_confirmed cases (new in v1.7.0-alpha.12, present in electra + fulu) currently
// fail. Unskip once the FCR is reworked.
name.includes("is_one_confirmed_fails_large_validator_slashed") ||
name.includes("is_one_confirmed_fails_recently_activated_validator_voting_in_empty_slot"),
},
};
};
Expand Down Expand Up @@ -717,5 +722,13 @@ specTestIterator(
{
...defaultSkipOpts,
skippedRunners: [],
skippedTestSuites: [
...(defaultSkipOpts.skippedTestSuites ?? []),
// TODO-GLOAS: lodestar's fast-confirmation rule is block-root based and does not model the
// ePBS payload_status dimension required by specs/gloas/fast-confirmation.md (PTC payload
// presence/timeliness, get_node_for_root with PAYLOAD_STATUS_PENDING). Head/justified/
// finalized/proposer-head all match; only getConfirmedRoot diverges.
/^gloas\/fast_confirmation\/.*/,
],
}
);
21 changes: 20 additions & 1 deletion packages/beacon-node/test/spec/utils/specTestIterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,37 @@ export const defaultSkipOpts: SkipOpts = {
/^.+\/light_client\/data_collection\/.*/,
// Ignore the partial data column container additions for now. Unskip them when
// cell level DAS is ready
/^fulu\/ssz_static\/PartialDataColumn(Header|PartsMetadata|Sidecar)\/.*$/,
/^fulu\/ssz_static\/PartialDataColumn(GroupID|Header|PartsMetadata|Sidecar)\/.*$/,
/^gloas\/ssz_static\/PartialDataColumn(GroupID|PartsMetadata|Sidecar)\/.*$/,
// TODO-GLOAS: re-enable after Gloas light-client sync deserializes updates by fork digest.
/^gloas\/light_client\/sync\/.*/,
// TODO-GLOAS: re-enable after on_payload_attestation_message (PTC) fork choice is implemented.
// New test suite added in v1.7.0-alpha.8 (consensus-specs #5206); gloas PTC fork choice
// handling is not yet implemented in Lodestar.
/^gloas\/fork_choice\/on_payload_attestation_message\/.*$/,
// TODO GLOAS: Unskip in #9606
/^gloas\/operations\/builder_deposit_request\/.*$/,
],
skippedTests: [
// TODO-GLOAS: re-enable after gloas light client is implemented
/\/gloas_fork$/,
// TODO GLOAS: Unskip in #9606
/^gloas\/operations\/builder_deposit_request\/.*$/,
/\/fork_builder_deposit_followed_by_non_builder_credentials$/,
/\/fork_builder_deposit_uses_deposit_slot_epoch$/,
/\/fork_builder_deposit_version$/,
/\/fork_invalid_builder_deposit_followed_by_valid_builder_deposit$/,
/\/fork_invalid_validator_deposit_followed_by_builder_credentials$/,
/\/fork_mixed_pending_deposits$/,
/\/fork_multiple_builder_deposits$/,
/\/fork_multiple_deposits_same_builder$/,
/\/fork_single_builder_deposit$/,
/\/fork_valid_builder_deposit_followed_by_invalid_builder_deposit$/,
/\/deposit_requests_greater_than_electra_max$/,
/\/process_parent_execution_payload__new_builder_does_not_reuse_topped_up_builder_slot$/,
/\/process_builder_exit_request__success$/,
/\/process_parent_execution_payload__builder_exit_request$/,
/\/switch_to_compounding_with_pending_consolidations_at_limit$/,
],
// TODO GLOAS: Investigate why networking tests are failing since alpha.5
skippedRunners: ["networking"],
Expand Down
3 changes: 3 additions & 0 deletions packages/config/test/e2e/ensure-config-is-synced.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ const ignoredRemoteConfigFields: (keyof ChainConfig)[] = [
// These are preset values, not config values - they're tested separately
"PRESET_BASE",
"CONFIG_NAME",
// TODO GLOAS: Unskip in #9606
"PAYLOAD_DUE_BPS" as keyof ChainConfig,
"MIN_BUILDER_WITHDRAWABILITY_DELAY" as keyof ChainConfig,
];

/**
Expand Down
27 changes: 23 additions & 4 deletions packages/params/test/e2e/ensure-config-is-synced.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ import {loadConfigYaml} from "../yaml.js";
* Fields that we filter from local config when doing comparison.
* Ideally this should be empty as it is not spec compliant
*/
const ignoredLocalPresetFields: (keyof BeaconPreset)[] = [];
// TODO GLOAS: Remove in #9606
const ignoredLocalPresetFields: (keyof BeaconPreset)[] = [
"BUILDER_REGISTRY_LIMIT",
"BUILDER_PENDING_WITHDRAWALS_LIMIT",
"MAX_SIGNED_BEACON_BLOCK_SIZE",
"MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD",
];

// TODO GLOAS: Remove in #9606
const ignoredRemotePresetFields: string[] = ["MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD"];

describe("Ensure config is synced", () => {
vi.setConfig({testTimeout: 60 * 1000});
Expand All @@ -38,15 +47,25 @@ function assertCorrectPreset(localPreset: BeaconPreset, remotePreset: BeaconPres
{} as Partial<BeaconPreset>
);

const filteredRemotePreset: Partial<BeaconPreset> = Object.keys(remotePreset)
.filter((key) => !ignoredRemotePresetFields.includes(key))
.reduce(
(acc, key) => {
acc[key as keyof BeaconPreset] = remotePreset[key as keyof BeaconPreset];
return acc;
},
{} as Partial<BeaconPreset>
);
Comment on lines +50 to +58

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

We can improve type safety and readability by casting Object.keys(remotePreset) to (keyof BeaconPreset)[] at the start of the chain. This allows TypeScript to automatically infer the type of key as keyof BeaconPreset, eliminating the need for redundant type assertions (as keyof BeaconPreset) inside the reduce callback.

  const filteredRemotePreset: Partial<BeaconPreset> = (Object.keys(remotePreset) as (keyof BeaconPreset)[])
    .filter((key) => !ignoredRemotePresetFields.includes(key))
    .reduce(
      (acc, key) => {
        acc[key] = remotePreset[key];
        return acc;
      },
      {} as Partial<BeaconPreset>
    );


// Check each key for better debuggability
for (const key of Object.keys(remotePreset) as (keyof BeaconPreset)[]) {
for (const key of Object.keys(filteredRemotePreset) as (keyof BeaconPreset)[]) {
const localValue = filteredLocalPreset[key];
const remoteValue = remotePreset[key];
const remoteValue = filteredRemotePreset[key];

expect(localValue).toBeWithMessage(remoteValue, `${key} does not match ${localValue} != ${remoteValue}`);
}

expect(filteredLocalPreset).toEqual(remotePreset);
expect(filteredLocalPreset).toEqual(filteredRemotePreset);
}

async function downloadRemoteConfig(preset: "mainnet" | "minimal", commit: string): Promise<BeaconPreset> {
Expand Down
2 changes: 1 addition & 1 deletion spec-tests-version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ethereumConsensusSpecsTests": {
"specVersion": "v1.7.0-alpha.11",
"specVersion": "v1.7.0-alpha.12",
"specTestsRepoUrl": "https://github.com/ethereum/consensus-specs",
"outputDirBase": "spec-tests",
"testsToDownload": [
Expand Down
21 changes: 16 additions & 5 deletions specrefs/.ethspecify.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: v1.7.0-alpha.11
version: v1.7.0-alpha.12
style: full

specrefs:
Expand Down Expand Up @@ -68,6 +68,7 @@ exceptions:
- PartialDataColumnSidecar#gloas

# fulu (not implemented yet)
- PartialDataColumnGroupID#fulu
- PartialDataColumnHeader#fulu
- PartialDataColumnPartsMetadata#fulu
- PartialDataColumnSidecar#fulu
Expand Down Expand Up @@ -128,6 +129,8 @@ exceptions:
presets:
# heze (not implemented)
- INCLUSION_LIST_COMMITTEE_SIZE#heze
- MAX_SIGNED_EXECUTION_PAYLOAD_BID_SIZE_HEZE#heze
- MAX_SIGNED_INCLUSION_LIST_SIZE#heze

functions:
# phase0
Expand All @@ -152,7 +155,6 @@ exceptions:
- get_base_reward#phase0
- get_checkpoint_block#phase0
- get_current_store_epoch#phase0
- get_dependent_root#phase0
- get_eligible_validator_indices#phase0
- get_eth1_vote#phase0
- get_filtered_block_tree#phase0
Expand Down Expand Up @@ -346,7 +348,6 @@ exceptions:
- get_builder_withdrawals#gloas
- get_builders_sweep_withdrawals#gloas
- get_checkpoint_block#gloas
- get_dependent_root#gloas
- get_execution_payload_bid_signature#gloas
- get_execution_payload_envelope_signature#gloas
- get_forkchoice_store#gloas
Expand All @@ -360,7 +361,6 @@ exceptions:
- get_payload_attestation_message_signature#gloas
- get_payload_status_tiebreaker#gloas
- get_pending_balance_to_withdraw#gloas
- get_proposer_preferences_signature#gloas
- get_ptc_assignment#gloas
- get_safe_execution_block_hash#gloas
- get_supported_node#gloas
Expand Down Expand Up @@ -398,7 +398,6 @@ exceptions:
- update_proposer_boost_root#gloas
- validate_merge_block#gloas
- validate_on_attestation#gloas
- get_proposer_dependent_root#gloas

# gloas (new in alpha.3, not yet implemented)
- compute_weak_subjectivity_period#gloas
Expand All @@ -412,6 +411,16 @@ exceptions:
- upgrade_lc_store_to_gloas#gloas
- upgrade_lc_update_to_gloas#gloas

# gloas (slot-based gindex helpers; lodestar uses fork-based currentSyncCommitteeGindexAtFork)
- current_sync_committee_gindex_at_slot#gloas
- finalized_root_gindex_at_slot#gloas
- next_sync_committee_gindex_at_slot#gloas

# gloas (attestation upgrade helpers; lodestar ssz types are structurally cross-fork compatible)
- upgrade_attestation_to_gloas#gloas
- upgrade_attester_slashing_to_gloas#gloas
- upgrade_indexed_attestation_to_gloas#gloas

# computed helpers replacing config vars (added in alpha.3)
# the following are hardcoded in config files rather than computed at runtime
- compute_max_request_blob_sidecars#deneb
Expand All @@ -422,12 +431,14 @@ exceptions:
# heze (not implemented)
- compute_fork_version#heze
- get_forkchoice_store#heze
- get_inclusion_list_bits#heze
- get_inclusion_list_committee#heze
- get_inclusion_list_committee_assignment#heze
- get_inclusion_list_due_ms#heze
- get_inclusion_list_signature#heze
- get_inclusion_list_store#heze
- get_inclusion_list_transactions#heze
- is_inclusion_list_bits_inclusive#heze
- is_payload_inclusion_list_satisfied#heze
- is_valid_inclusion_list_signature#heze
- on_inclusion_list#heze
Expand Down
28 changes: 14 additions & 14 deletions specrefs/configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,17 @@
search: '^\s+CUSTODY_REQUIREMENT:'
regex: true
spec: |
<spec config_var="CUSTODY_REQUIREMENT" fork="fulu" hash="b7340203">
CUSTODY_REQUIREMENT = 4
<spec config_var="CUSTODY_REQUIREMENT" fork="fulu" hash="3ed53d1d">
CUSTODY_REQUIREMENT: uint64 = 4
</spec>

- name: DATA_COLUMN_SIDECAR_SUBNET_COUNT#fulu
sources:
- file: packages/config/src/chainConfig/configs/mainnet.ts
search: "DATA_COLUMN_SIDECAR_SUBNET_COUNT:"
spec: |
<spec config_var="DATA_COLUMN_SIDECAR_SUBNET_COUNT" fork="fulu" hash="626172a6">
DATA_COLUMN_SIDECAR_SUBNET_COUNT = 128
<spec config_var="DATA_COLUMN_SIDECAR_SUBNET_COUNT" fork="fulu" hash="4b4dd06b">
DATA_COLUMN_SIDECAR_SUBNET_COUNT: uint64 = 128
</spec>

- name: DENEB_FORK_EPOCH#deneb
Expand Down Expand Up @@ -516,8 +516,8 @@
- file: packages/config/src/chainConfig/configs/mainnet.ts
search: "MIN_BUILDER_WITHDRAWABILITY_DELAY:"
spec: |
<spec config_var="MIN_BUILDER_WITHDRAWABILITY_DELAY" fork="gloas" hash="e1cd053c">
MIN_BUILDER_WITHDRAWABILITY_DELAY: uint64 = 8192
<spec config_var="MIN_BUILDER_WITHDRAWABILITY_DELAY" fork="gloas" hash="be7f8473">
MIN_BUILDER_WITHDRAWABILITY_DELAY: uint64 = 64
</spec>

- name: MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS#deneb
Expand All @@ -534,8 +534,8 @@
- file: packages/config/src/chainConfig/configs/mainnet.ts
search: "MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:"
spec: |
<spec config_var="MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS" fork="fulu" hash="910e49bb">
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS = 4096
<spec config_var="MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS" fork="fulu" hash="b717a22d">
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: uint64 = 4096
</spec>

- name: MIN_GENESIS_ACTIVE_VALIDATOR_COUNT#phase0
Expand Down Expand Up @@ -588,8 +588,8 @@
- file: packages/config/src/chainConfig/configs/mainnet.ts
search: "NUMBER_OF_CUSTODY_GROUPS:"
spec: |
<spec config_var="NUMBER_OF_CUSTODY_GROUPS" fork="fulu" hash="05e3016e">
NUMBER_OF_CUSTODY_GROUPS = 128
<spec config_var="NUMBER_OF_CUSTODY_GROUPS" fork="fulu" hash="ef65e821">
NUMBER_OF_CUSTODY_GROUPS: uint64 = 128
</spec>

- name: PAYLOAD_ATTESTATION_DUE_BPS#gloas
Expand All @@ -606,8 +606,8 @@
- file: packages/config/src/chainConfig/configs/mainnet.ts
search: "PAYLOAD_DUE_BPS:"
spec: |
<spec config_var="PAYLOAD_DUE_BPS" fork="gloas" hash="ee4d44de">
PAYLOAD_DUE_BPS: uint64 = 7500
<spec config_var="PAYLOAD_DUE_BPS" fork="gloas" hash="07d2a783">
PAYLOAD_DUE_BPS: uint64 = 5000
</spec>

- name: PROPOSER_REORG_CUTOFF_BPS#phase0
Expand Down Expand Up @@ -660,8 +660,8 @@
- file: packages/config/src/chainConfig/configs/mainnet.ts
search: "SAMPLES_PER_SLOT:"
spec: |
<spec config_var="SAMPLES_PER_SLOT" fork="fulu" hash="158798b8">
SAMPLES_PER_SLOT = 8
<spec config_var="SAMPLES_PER_SLOT" fork="fulu" hash="dfbcb295">
SAMPLES_PER_SLOT: uint64 = 8
</spec>

- name: SECONDS_PER_ETH1_BLOCK#phase0
Expand Down
16 changes: 8 additions & 8 deletions specrefs/constants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
- file: packages/params/src/index.ts
search: export const BUILDER_WITHDRAWAL_PREFIX =
spec: |
<spec constant_var="BUILDER_WITHDRAWAL_PREFIX" fork="gloas" hash="1094ce21">
BUILDER_WITHDRAWAL_PREFIX: Bytes1 = '0x03'
<spec constant_var="BUILDER_WITHDRAWAL_PREFIX" fork="gloas" hash="d3243a75">
BUILDER_WITHDRAWAL_PREFIX: Bytes1 = '0xB0'
</spec>

- name: BYTES_PER_COMMITMENT#deneb
Expand Down Expand Up @@ -427,8 +427,8 @@
- name: KZG_SETUP_G2_LENGTH#deneb
sources: []
spec: |
<spec constant_var="KZG_SETUP_G2_LENGTH" fork="deneb" hash="6cb8d5fd">
KZG_SETUP_G2_LENGTH = 65
<spec constant_var="KZG_SETUP_G2_LENGTH" fork="deneb" hash="6435c362">
KZG_SETUP_G2_LENGTH: uint64 = 65
</spec>

- name: KZG_SETUP_G2_MONOMIAL#deneb
Expand Down Expand Up @@ -590,8 +590,8 @@
- file: packages/params/src/index.ts
search: export const SYNC_COMMITTEE_SUBNET_COUNT =
spec: |
<spec constant_var="SYNC_COMMITTEE_SUBNET_COUNT" fork="altair" hash="58794943">
SYNC_COMMITTEE_SUBNET_COUNT = 4
<spec constant_var="SYNC_COMMITTEE_SUBNET_COUNT" fork="altair" hash="9b41920c">
SYNC_COMMITTEE_SUBNET_COUNT: uint64 = 2**2
</spec>

- name: SYNC_REWARD_WEIGHT#altair
Expand All @@ -617,8 +617,8 @@
- file: packages/params/src/index.ts
search: export const TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE =
spec: |
<spec constant_var="TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE" fork="altair" hash="af3f6c9e">
TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE = 2**4
<spec constant_var="TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE" fork="altair" hash="76404bd9">
TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE: uint64 = 2**4
</spec>

- name: TIMELY_HEAD_FLAG_INDEX#altair
Expand Down
Loading
Loading