Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
eb0d951
Cold payload status
michaelsproul Mar 12, 2026
bdf6df4
Fix block replay starting from a full state
michaelsproul Mar 12, 2026
ba2bc3b
WIP fixing chain_dump
michaelsproul Mar 12, 2026
efc2599
Update BeaconSnapshot to include execution payload
michaelsproul Mar 16, 2026
bce5d4c
Merge remote-tracking branch 'origin/unstable' into gloas-cold-db
michaelsproul Mar 16, 2026
c2cb548
Stricter migrate_database check
michaelsproul Mar 16, 2026
f6b9ff4
Check DB invariants in new Gloas tests
michaelsproul Mar 17, 2026
b2b1e35
Merge remote-tracking branch 'origin/unstable' into gloas-cold-db
michaelsproul Mar 17, 2026
d5916a7
Start working on beacon chain tests
michaelsproul Mar 17, 2026
3d324af
All but one store test passing :fire:
michaelsproul Mar 18, 2026
ce580b4
Fix last test
michaelsproul Mar 18, 2026
76326c5
Enable Gloas tests on CI
michaelsproul Mar 18, 2026
aae6ca6
WIP debugging
michaelsproul Mar 21, 2026
fd2f064
Fix expected withdrawals bug
michaelsproul Mar 22, 2026
33c69f9
State root at slot bugfix
michaelsproul Mar 23, 2026
2c36f8d
Some vaguely acceptable fixes
michaelsproul Mar 23, 2026
baf90bf
Somewhat dubious claude stuff
michaelsproul Mar 25, 2026
59e7f19
Merge remote-tracking branch 'origin/unstable' into fix-pruning-gloas
michaelsproul Mar 31, 2026
7449e21
Restore deleted comment
michaelsproul Mar 31, 2026
485572f
Revert debugging changes in envelope processing
michaelsproul Mar 31, 2026
d4cf797
Add note about reconstruction still being scuffed
michaelsproul Mar 31, 2026
806eef8
Fix randao_genesis_storage test
michaelsproul Mar 31, 2026
19315eb
Disable payload_invalidation tests for Gloas
michaelsproul Apr 1, 2026
13e92d3
Increase test validator counts for Gloas genesis compatibility
jimmygchen Apr 2, 2026
48c2339
Fix Gloas beacon_chain test failures
jimmygchen Apr 2, 2026
16d277d
Merge branch 'unstable' into fix-pruning-gloas
jimmygchen Apr 2, 2026
eed96f0
Skip blob/column tests for Gloas
jimmygchen Apr 2, 2026
cfe8388
Fix remaining Gloas beacon_chain test failures
jimmygchen Apr 2, 2026
a6ae66f
Merge branch 'unstable' of https://github.com/sigp/lighthouse into fi…
eserilev Apr 3, 2026
e12a81b
update test harness process_envelope
eserilev Apr 5, 2026
673b5a4
Fix Gloas genesis payload status and fork choice anchor initialization
dapplion Apr 6, 2026
cb10414
Fix comments
michaelsproul Apr 7, 2026
e5b3a7b
Fix comment
michaelsproul Apr 7, 2026
6a290b3
Fix clippy
jimmygchen Apr 7, 2026
fe16319
Use fork choice payload status in recompute_head
jimmygchen Apr 7, 2026
38ad318
Resolve fork choice payload status TODOs
jimmygchen Apr 7, 2026
53fe73f
Run beacon-chain tests without fail fast
jimmygchen Apr 7, 2026
b99db65
Comment
michaelsproul Apr 7, 2026
e1744ce
Read canonical head only once
michaelsproul Apr 7, 2026
6c7741e
Use canonical_head in chain_dump
michaelsproul Apr 7, 2026
b8aa006
Revert changes to block_has_canonical_payload
michaelsproul Apr 7, 2026
9b45b53
Read atomically in state advance
michaelsproul Apr 7, 2026
d25855b
Fix genesis payload status in new Gloas block tests
michaelsproul Apr 7, 2026
f17ec74
Fix `test_gloas_hot_state_hierarchy`
michaelsproul Apr 7, 2026
9bfdcef
Remove epoch-alignment assumptions from migate_db and state cache
michaelsproul Apr 8, 2026
75ff829
Removing epoch-alignment assumptions in fork choice and checkpoint sync
michaelsproul Apr 8, 2026
cb3d23b
Remove epoch-alignment from DB pruning
michaelsproul Apr 8, 2026
5645382
Update fork choice comment about finalized slot
michaelsproul Apr 8, 2026
c9eb9d4
Fix block_gossip_verification
michaelsproul Apr 8, 2026
aaeb226
Fix block verification tests
michaelsproul Apr 9, 2026
5718e5a
Most weak subj tests passing
michaelsproul Apr 9, 2026
95e2eb5
All checkpoint sync tests passing
michaelsproul Apr 9, 2026
953e2ae
Fix reproduction_unaligned_checkpoint_sync_pruned_payload
michaelsproul Apr 9, 2026
ab4dc75
Simplified fix in canonical head
michaelsproul Apr 9, 2026
7b5c7c2
Fix epoch_boundary_state_attestation_processing and pseudo finalizati…
michaelsproul Apr 9, 2026
35a393e
Fix schema tests
michaelsproul Apr 9, 2026
074027c
Fix process_blocks_and_attestations_for_unaligned_checkpoint
michaelsproul Apr 9, 2026
2503505
Compute and store Full state in EF test on_execution_payload handler
jimmygchen Apr 10, 2026
3bcecbe
Restore pre-Gloas checkpoint state advancement to epoch boundary
jimmygchen Apr 10, 2026
58bdb3e
cargo fmt fix
jimmygchen Apr 10, 2026
d2ec857
Remove unnecessary Option from get_chain_segment and clarify validato…
jimmygchen Apr 10, 2026
0177ac2
Merge branch 'unstable' into fix-pruning-gloas
jimmygchen Apr 10, 2026
f516ded
Defer execution payload processing to next block (consensus-specs#5094)
michaelsproul Apr 14, 2026
1c61bac
Reverting epoch-unalignment assumptions
michaelsproul Apr 14, 2026
0acc8b5
Remove state payload status from state cache/etc
michaelsproul Apr 14, 2026
018d4db
Remove state payload status from store
michaelsproul Apr 14, 2026
a8dd26a
Revert block replayer changes
michaelsproul Apr 14, 2026
52c2d4c
Undo load_parent changes
michaelsproul Apr 14, 2026
c8ba0b8
Simplify chain dump
michaelsproul Apr 14, 2026
c3489bd
Simplify recompute_head_at_slot_internal
michaelsproul Apr 14, 2026
30785f6
Remove StatePayloadStatus from canonical head
michaelsproul Apr 14, 2026
d7e02c9
Remove state payload status from beacon chain
michaelsproul Apr 14, 2026
b1bfeff
Removing StatePayloadStatus
michaelsproul Apr 14, 2026
53d618e
Block production WIP
michaelsproul Apr 14, 2026
5cc89f7
Update consensus code
michaelsproul Apr 14, 2026
c4bc517
Load parent payload envelope for block production
michaelsproul Apr 15, 2026
cc6ea3d
Thread parent envelope through block production, fix withdrawals cond…
michaelsproul Apr 15, 2026
209d720
Restore epoch alignment assumptions in Gloas store tests
michaelsproul Apr 15, 2026
c08d8da
Merge remote-tracking branch 'origin/unstable' into fix-pruning-gloas
michaelsproul Apr 15, 2026
2e4706a
Fix parent exec requests field location in BeaconBlockBody
michaelsproul Apr 15, 2026
c1058bb
Run EF tests from Nico's fork
michaelsproul Apr 15, 2026
2839c78
Disable missing envelope tests for now
michaelsproul Apr 16, 2026
9a3f4b5
Fixing fork choice tests
michaelsproul Apr 16, 2026
7af5341
Add parent execution payload tests
michaelsproul Apr 16, 2026
47a04cd
Remove expect
michaelsproul Apr 16, 2026
dd833a1
Clean up genesis further
michaelsproul Apr 16, 2026
b201750
Fixing block hash used at genesis
michaelsproul Apr 16, 2026
3f0a150
Update genesis block utils
michaelsproul Apr 16, 2026
6797119
Pin new version of spec tests
michaelsproul Apr 16, 2026
d6b7313
Move parent payload processing up
michaelsproul Apr 16, 2026
66302a6
Update for newer spec
michaelsproul Apr 16, 2026
0b7a828
Swap latest_block_hash and latest_execution_payload_bid
michaelsproul Apr 17, 2026
02169a4
Set paylaod_received to true if were at genesis
eserilev Apr 17, 2026
0d15b21
Gloas genesis block should be EMPTY
eserilev Apr 17, 2026
d57a927
Merge branch 'unstable' of https://github.com/sigp/lighthouse into fi…
eserilev Apr 17, 2026
8305da3
Dont discard the zero block hash
eserilev Apr 17, 2026
ce4ff10
ensure we use el genesis block hash in fcu
eserilev Apr 17, 2026
518ca96
Minimal BAL changes for EF tests to pass
michaelsproul Apr 19, 2026
2876755
Fix payload streamer test
michaelsproul Apr 19, 2026
38b01b3
Needed fcU and friends from BAL branch
michaelsproul Apr 19, 2026
8b59844
Merge remote-tracking branch 'origin/unstable' into fix-pruning-gloas
michaelsproul Apr 19, 2026
3e32998
Fix genesis fork choice tests
michaelsproul Apr 19, 2026
44283d6
Bump tests to v1.7.0-alpha.5
michaelsproul Apr 19, 2026
b2e49f1
Undo unnecessary changes in builder.rs
michaelsproul Apr 19, 2026
90522f9
Remove state root from SSE payload events
michaelsproul Apr 20, 2026
0b27401
Remove unnecessary state write for payloads
michaelsproul Apr 20, 2026
4f07039
Clean up parent_execution_requests calculation
michaelsproul Apr 20, 2026
a843e1d
Forbid StatePayloadStatus necro-bump
michaelsproul Apr 20, 2026
7acd1d8
Revert churn in migrate.rs
michaelsproul Apr 20, 2026
f47a9af
Remove churn in state advance
michaelsproul Apr 20, 2026
3308766
Revert summaries DAG changes
michaelsproul Apr 20, 2026
20f646b
Fix head payload loading on startup/restore
michaelsproul Apr 20, 2026
ef4e0ae
Revert churn in reconstruction
michaelsproul Apr 20, 2026
3300cde
Simplify some more test code
michaelsproul Apr 20, 2026
cd8e5f3
Clarify genesis handling in fork choice
michaelsproul Apr 20, 2026
7cad466
Restore deleted comment
michaelsproul Apr 20, 2026
13b3d1c
Further genesis clarification
michaelsproul Apr 20, 2026
406a14c
Align with spec and remove state writes in FC tests
michaelsproul Apr 20, 2026
0e8e0c4
Simplify
michaelsproul Apr 20, 2026
2260059
Remove ignore for EF fork choice tests
michaelsproul Apr 20, 2026
b03d1b9
Implement on_execution_payload_envelope tests
michaelsproul Apr 20, 2026
4c11bb9
Add get_parent_payload_status tests
michaelsproul Apr 20, 2026
7eb7c91
Delete BeaconState::is_parent_block_full
michaelsproul Apr 20, 2026
e4526bc
Add comment about BeaconChainHarness envelope handling
michaelsproul Apr 20, 2026
af1fbee
Clean up store
michaelsproul Apr 20, 2026
423e1a4
Add TODO about fcU to fork choice
michaelsproul Apr 20, 2026
fd67493
Revert unnecessary comment
michaelsproul Apr 20, 2026
243e9bf
Address round 1 of review from Eitan and Lion
michaelsproul Apr 21, 2026
094c58d
Test simplification and comment clarification
michaelsproul Apr 21, 2026
bc3f6ba
Address more of Eitan's comments
michaelsproul Apr 21, 2026
612a146
Cargo fmt
michaelsproul Apr 21, 2026
4f3f468
Merge branch 'unstable' into fix-pruning-gloas
eserilev Apr 21, 2026
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
1 change: 1 addition & 0 deletions .github/forbidden-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ beacon_node/http_api/src/block_rewards.rs
common/eth2/src/lighthouse/attestation_performance.rs
common/eth2/src/lighthouse/block_packing_efficiency.rs
common/eth2/src/lighthouse/block_rewards.rs
consensus/types/src/execution/state_payload_status.rs
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,10 @@ run-ef-tests:
./$(EF_TESTS)/check_all_files_accessed.py $(EF_TESTS)/.accessed_file_log.txt $(EF_TESTS)/consensus-spec-tests

# Run the tests in the `beacon_chain` crate for all known forks.
# TODO(EIP-7732) Extend to support gloas by using RECENT_FORKS instead
test-beacon-chain: $(patsubst %,test-beacon-chain-%,$(RECENT_FORKS_BEFORE_GLOAS))
test-beacon-chain: $(patsubst %,test-beacon-chain-%,$(RECENT_FORKS))

test-beacon-chain-%:
env FORK_NAME=$* cargo nextest run --release --features "fork_from_env,slasher/lmdb,$(TEST_FEATURES)" -p beacon_chain
env FORK_NAME=$* cargo nextest run --release --features "fork_from_env,slasher/lmdb,$(TEST_FEATURES)" -p beacon_chain --no-fail-fast

# Run the tests in the `http_api` crate for recent forks.
test-http-api: $(patsubst %,test-http-api-%,$(RECENT_FORKS_BEFORE_GLOAS))
Expand Down
1 change: 1 addition & 0 deletions beacon_node/beacon_chain/src/beacon_block_streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ mod tests {
spec.deneb_fork_epoch = Some(Epoch::new(deneb_fork_epoch as u64));
spec.electra_fork_epoch = Some(Epoch::new(electra_fork_epoch as u64));
spec.fulu_fork_epoch = Some(Epoch::new(fulu_fork_epoch as u64));
spec.gloas_fork_epoch = None;
let spec = Arc::new(spec);

let harness = get_harness(VALIDATOR_COUNT, spec.clone());
Expand Down
68 changes: 36 additions & 32 deletions beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2058,12 +2058,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
// for the same block. Analysis: https://hackmd.io/@dapplion/gloas_dependant_root
let (advanced_state_root, mut state) = self
.store
.get_advanced_hot_state(
beacon_block_root,
StatePayloadStatus::Pending,
request_slot,
beacon_state_root,
)?
.get_advanced_hot_state(beacon_block_root, request_slot, beacon_state_root)?
.ok_or(Error::MissingBeaconState(beacon_state_root))?;
if state.current_epoch() < request_epoch {
partial_state_advance(
Expand Down Expand Up @@ -4564,7 +4559,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
//
// Load the parent state from disk.
let chain = self.clone();
let (state, state_root_opt) = self
let block_production_state = self
.task_executor
.spawn_blocking_handle(
move || chain.load_state_for_block_production(slot),
Expand All @@ -4573,6 +4568,10 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.ok_or(BlockProductionError::ShuttingDown)?
.await
.map_err(BlockProductionError::TokioJoin)??;
let (state, state_root_opt) = (
block_production_state.state,
block_production_state.state_root,
);

// Part 2/2 (async, with some blocking components)
//
Expand Down Expand Up @@ -4722,12 +4721,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.ok_or(Error::MissingBeaconBlock(parent_block_root))?;
let (state_root, state) = self
.store
.get_advanced_hot_state(
parent_block_root,
StatePayloadStatus::Pending,
proposal_slot,
block.state_root(),
)?
.get_advanced_hot_state(parent_block_root, proposal_slot, block.state_root())?
.ok_or(Error::MissingBeaconState(block.state_root()))?;
(Cow::Owned(state), state_root)
};
Expand Down Expand Up @@ -6019,6 +6013,12 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
None
};

let slot_number = if prepare_slot_fork.gloas_enabled() {
Some(prepare_slot.as_u64())
} else {
None
};

let payload_attributes = PayloadAttributes::new(
self.slot_clock
.start_of(prepare_slot)
Expand All @@ -6028,6 +6028,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
execution_layer.get_suggested_fee_recipient(proposer).await,
withdrawals.map(Into::into),
parent_beacon_block_root,
slot_number,
);

execution_layer
Expand Down Expand Up @@ -6663,12 +6664,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
// for the same block. Analysis: https://hackmd.io/@dapplion/gloas_dependant_root
let (state_root, state) = self
.store
.get_advanced_hot_state(
head_block_root,
StatePayloadStatus::Pending,
target_slot,
head_block.state_root,
)?
.get_advanced_hot_state(head_block_root, target_slot, head_block.state_root)?
.ok_or(Error::MissingBeaconState(head_block.state_root))?;
(state, state_root)
};
Expand Down Expand Up @@ -6756,10 +6752,10 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
blocks.push((beacon_block_root, Arc::new(beacon_block)));
}

// Collect states, using the next blocks to determine if states are full (have Gloas
// payloads).
// Collect envelopes, using the next blocks to determine if payloads are canonical
// (the parent block was full).
for (i, (block_root, block)) in blocks.iter().enumerate() {
let (opt_envelope, state_root) = if block.fork_name_unchecked().gloas_enabled() {
let opt_envelope = if block.fork_name_unchecked().gloas_enabled() {
let opt_envelope = self.store.get_payload_envelope(block_root)?.map(Arc::new);

if let Some((_, next_block)) = blocks.get(i + 1) {
Expand All @@ -6768,22 +6764,30 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
let envelope = opt_envelope.ok_or_else(|| {
Error::DBInconsistent(format!("Missing envelope {block_root:?}"))
})?;
let state_root = envelope.message.state_root;
(Some(envelope), state_root)
Some(envelope)
} else {
(None, block.state_root())
None
}
} else {
// TODO(gloas): should use fork choice/cached head for last block in sequence
opt_envelope
.as_ref()
.map_or((None, block.state_root()), |envelope| {
(Some(envelope.clone()), envelope.message.state_root)
})
// Last block in the sequence: use canonical head to determine
// whether the payload is canonical.
let head = self.canonical_head.cached_head();
assert_eq!(head.head_block_root(), *block_root);
Comment thread
michaelsproul marked this conversation as resolved.
let payload_received =
head.head_payload_status() == fork_choice::PayloadStatus::Full;
if payload_received {
let envelope = opt_envelope.ok_or_else(|| {
Error::DBInconsistent(format!("Missing envelope {block_root:?}"))
})?;
Some(envelope)
Comment thread
eserilev marked this conversation as resolved.
} else {
None
}
}
} else {
(None, block.state_root())
None
};
let state_root = block.state_root();

let mut beacon_state = self
.store
Expand Down
9 changes: 2 additions & 7 deletions beacon_node/beacon_chain/src/beacon_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,13 @@ impl<E: EthSpec, Payload: AbstractExecPayload<E>> BeaconSnapshot<E, Payload> {
}
}

/// Returns the state root from `self.beacon_block` or `self.execution_envelope` as
/// appropriate.
/// Returns the state root from `self.beacon_block`.
///
/// ## Caution
///
/// It is not strictly enforced that `root(self.beacon_state) == self.beacon_state_root()`.
pub fn beacon_state_root(&self) -> Hash256 {
if let Some(ref envelope) = self.execution_envelope {
envelope.message.state_root
} else {
self.beacon_block.message().state_root()
}
self.beacon_block.message().state_root()
}

/// Update all fields of the checkpoint.
Expand Down
8 changes: 1 addition & 7 deletions beacon_node/beacon_chain/src/blob_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use tree_hash::TreeHash;
use types::data::BlobIdentifier;
use types::{
BeaconStateError, BlobSidecar, Epoch, EthSpec, Hash256, SignedBeaconBlockHeader, Slot,
StatePayloadStatus,
};

/// An error occurred while validating a gossip blob.
Expand Down Expand Up @@ -513,12 +512,7 @@ pub fn validate_blob_sidecar_for_gossip<T: BeaconChainTypes, O: ObservationStrat
// status is sufficient.
chain
.store
.get_advanced_hot_state(
block_parent_root,
StatePayloadStatus::Pending,
blob_slot,
parent_block.state_root,
)
.get_advanced_hot_state(block_parent_root, blob_slot, parent_block.state_root)
.map_err(|e| GossipBlobError::BeaconChainError(Box::new(e.into())))?
.ok_or_else(|| {
GossipBlobError::BeaconChainError(Box::new(BeaconChainError::DBInconsistent(
Expand Down
Loading
Loading