Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
09c15f0
Make RPCBlock a variant with an available and maybeavailable variants
eserilev Nov 17, 2025
d97a9ff
Fix tests
eserilev Nov 18, 2025
f92e1df
Fix tests
eserilev Nov 25, 2025
0ac040c
Merge branch 'unstable' of https://github.com/sigp/lighthouse into rp…
eserilev Nov 25, 2025
ba5a58e
Fix tests
eserilev Nov 25, 2025
545bf41
Temp
eserilev Nov 26, 2025
44e5672
Fix
eserilev Nov 30, 2025
aad7828
Fix verify_kzg
eserilev Nov 30, 2025
6f07e44
Fix test
eserilev Dec 1, 2025
00c0fe8
Merge branch 'unstable' of https://github.com/sigp/lighthouse into rp…
eserilev Dec 1, 2025
2b3b923
Update kzg block verif for list
eserilev Dec 1, 2025
be9d7c9
Fix
eserilev Dec 1, 2025
1cb189b
beginning changes
ethDreamer Dec 4, 2025
e3517cc
Merge pull request #25 from ethDreamer/rpc-block-avail-refactor
eserilev Dec 4, 2025
632331a
Merge branch 'unstable' of https://github.com/sigp/lighthouse into rp…
eserilev Dec 4, 2025
95f6971
Updates
eserilev Dec 4, 2025
00e6419
Fix
eserilev Dec 4, 2025
59b45db
Update
eserilev Dec 4, 2025
e854933
verify_kzg_for_blocks refactor
ethDreamer Dec 4, 2025
d92fc8d
Merge branch 'unstable' of https://github.com/sigp/lighthouse into rp…
eserilev Dec 8, 2025
622c199
Rename kzg verification for blocks and improve comments
eserilev Dec 8, 2025
d669bec
Fmt
eserilev Dec 8, 2025
f082560
Refactor kzg verifcation for rpc block
eserilev Dec 8, 2025
ba3abcd
Fix
eserilev Dec 8, 2025
0e997cb
Fix tests
eserilev Dec 8, 2025
c2a180a
Cleanup
eserilev Dec 8, 2025
7e1bada
Fix test
eserilev Dec 8, 2025
ce377c7
Fix
eserilev Dec 9, 2025
6e7f5b7
Fix test
eserilev Dec 9, 2025
af2d6a3
Use chain for rpc block construction
eserilev Dec 10, 2025
206c016
Add availability checks inside of RpcBlock construction
eserilev Dec 10, 2025
e82de0f
pass da checker to rpc block and make verification checks
eserilev Dec 10, 2025
d27270b
Fix
eserilev Dec 11, 2025
cac3b14
Fix
eserilev Dec 11, 2025
ef96ff0
Fix
eserilev Dec 11, 2025
42a9e7a
Merge branch 'unstable' of https://github.com/sigp/lighthouse into rp…
eserilev Dec 11, 2025
aa1888e
fix
eserilev Dec 11, 2025
2c2c4a8
Merge branch 'unstable' into rpc-block-avail-varaint
eserilev Dec 12, 2025
7cd75bf
Fix
eserilev Dec 12, 2025
65302af
Tests are still failing
eserilev Dec 14, 2025
6bce2fc
Fix more tests
eserilev Dec 15, 2025
2da8ece
Fix mroe tests
eserilev Dec 15, 2025
ae44413
Fix one more test
eserilev Dec 15, 2025
1298285
Last test
eserilev Dec 15, 2025
bb27482
Fix regression where we silently drop blocks in signature_verify_cha…
eserilev Dec 15, 2025
8cadad9
Change AvailableBlockData api
eserilev Dec 17, 2025
b5a534e
Update comment
eserilev Dec 17, 2025
4931ffb
Resolve merge conflicts
eserilev Dec 17, 2025
ed948e9
Removed unused AvailableBlockData::new fn
eserilev Dec 17, 2025
b6ff08e
Fix test
eserilev Dec 17, 2025
0cd59ad
Resolve TODO
eserilev Dec 17, 2025
886f875
Update comments
eserilev Dec 18, 2025
d8be010
Added new tests
eserilev Dec 19, 2025
6c75930
Lints
eserilev Jan 3, 2026
7f61d0d
Changes based on feedback
eserilev Jan 7, 2026
534cfad
Add new test
eserilev Jan 8, 2026
ccabb3c
Merge branch 'rpc-block-avail-varaint' of https://github.com/eserilev…
eserilev Jan 8, 2026
5e4c454
Fmt
eserilev Jan 8, 2026
ab54242
Added comments and a small refactor
eserilev Jan 9, 2026
30a51a1
Merge branch 'rpc-block-avail-varaint' of https://github.com/eserilev…
eserilev Jan 9, 2026
7b54829
Merge branch 'unstable' into rpc-block-avail-varaint
eserilev Jan 9, 2026
a5cf26b
Remove uneeded match
eserilev Jan 12, 2026
d639b14
Merge branch 'rpc-block-avail-varaint' of https://github.com/eserilev…
eserilev Jan 12, 2026
ce653a2
Re-add commitment check
eserilev Jan 12, 2026
2b6d068
Add TODO
eserilev Jan 13, 2026
0700514
Remove arc and pass by ref
eserilev Jan 13, 2026
d95a34b
Delete outdated comment and remove unused error variant
eserilev Jan 16, 2026
1ea0242
lint
eserilev Jan 16, 2026
ec096f6
Merge branch 'rpc-block-avail-varaint' of https://github.com/eserilev…
eserilev Jan 16, 2026
0873861
Merge branch 'unstable' into rpc-block-avail-varaint
eserilev Jan 16, 2026
e0698a3
Merge branch 'unstable' into rpc-block-avail-varaint
eserilev Jan 20, 2026
9a4c5b1
Merge branch 'unstable' of https://github.com/sigp/lighthouse into rp…
eserilev Jan 22, 2026
306ee28
Merge branch 'rpc-block-avail-varaint' of https://github.com/eserilev…
eserilev Jan 22, 2026
259d900
move certain custody checks to custody context
eserilev Jan 22, 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
5 changes: 4 additions & 1 deletion beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7300,12 +7300,15 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
/// The epoch at which we require a data availability check in block processing.
/// `None` if the `Deneb` fork is disabled.
pub fn data_availability_boundary(&self) -> Option<Epoch> {
self.data_availability_checker.data_availability_boundary()
self.data_availability_checker
.custody_context()
.data_availability_boundary()
}

/// Returns true if epoch is within the data availability boundary
pub fn da_check_required_for_epoch(&self, epoch: Epoch) -> bool {
self.data_availability_checker
.custody_context()
.da_check_required_for_epoch(epoch)
}

Expand Down
80 changes: 51 additions & 29 deletions beacon_node/beacon_chain/src/block_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,26 +645,36 @@ pub fn signature_verify_chain_segment<T: BeaconChainTypes>(
&chain.spec,
)?;

// unzip chain segment and verify kzg in bulk
let (roots, blocks): (Vec<_>, Vec<_>) = chain_segment.into_iter().unzip();
let maybe_available_blocks = chain
.data_availability_checker
.verify_kzg_for_rpc_blocks(blocks)?;
// zip it back up
let mut signature_verified_blocks = roots
.into_iter()
.zip(maybe_available_blocks)
.map(|(block_root, maybe_available_block)| {
let consensus_context = ConsensusContext::new(maybe_available_block.slot())
.set_current_block_root(block_root);
SignatureVerifiedBlock {
block: maybe_available_block,
block_root,
parent: None,
consensus_context,
let mut available_blocks = Vec::with_capacity(chain_segment.len());
let mut signature_verified_blocks = Vec::with_capacity(chain_segment.len());

for (block_root, block) in chain_segment {
let consensus_context =
ConsensusContext::new(block.slot()).set_current_block_root(block_root);

match block {
RpcBlock::FullyAvailable(available_block) => {
available_blocks.push(available_block.clone());
signature_verified_blocks.push(SignatureVerifiedBlock {
block: MaybeAvailableBlock::Available(available_block),
block_root,
parent: None,
consensus_context,
});
}
})
.collect::<Vec<_>>();
RpcBlock::BlockOnly { .. } => {
// RangeSync and BackfillSync already ensure that the chain segment is fully available
// so this shouldn't be possible in practice.
return Err(BlockError::InternalError(
"Chain segment is not fully available".to_string(),
));
}
}
}

chain
.data_availability_checker
.batch_verify_kzg_for_available_blocks(&available_blocks)?;

// verify signatures
let pubkey_cache = get_validator_pubkey_cache(chain)?;
Expand Down Expand Up @@ -1297,16 +1307,28 @@ impl<T: BeaconChainTypes> IntoExecutionPendingBlock<T> for RpcBlock<T::EthSpec>
// Perform an early check to prevent wasting time on irrelevant blocks.
let block_root = check_block_relevancy(self.as_block(), block_root, chain)
.map_err(|e| BlockSlashInfo::SignatureNotChecked(self.signed_block_header(), e))?;
let maybe_available = chain
.data_availability_checker
.verify_kzg_for_rpc_block(self.clone())
.map_err(|e| {
BlockSlashInfo::SignatureNotChecked(
self.signed_block_header(),
BlockError::AvailabilityCheck(e),
)
})?;
SignatureVerifiedBlock::check_slashable(maybe_available, block_root, chain)?

let maybe_available_block = match &self {
RpcBlock::FullyAvailable(available_block) => {
chain
.data_availability_checker
.verify_kzg_for_available_block(available_block)
.map_err(|e| {
BlockSlashInfo::SignatureNotChecked(
self.signed_block_header(),
BlockError::AvailabilityCheck(e),
)
})?;
MaybeAvailableBlock::Available(available_block.clone())
}
// No need to perform KZG verification unless we have a fully available block
RpcBlock::BlockOnly { block, block_root } => MaybeAvailableBlock::AvailabilityPending {
block_root: *block_root,
block: block.clone(),
},
};

SignatureVerifiedBlock::check_slashable(maybe_available_block, block_root, chain)?
.into_execution_pending_block_slashable(block_root, chain, notify_execution_layer)
}

Expand Down
Loading