-
Notifications
You must be signed in to change notification settings - Fork 1k
Gloas payload cache #9209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Gloas payload cache #9209
Changes from all commits
Commits
Show all changes
145 commits
Select commit
Hold shift + click to select a range
d9c21f5
Add da router, and initial logic
eserilev 4a9aaa2
Resolve merge conflicts
eserilev aba7d45
Resolve merge conflicts
eserilev de0d604
Merge branch 'unstable' of https://github.com/sigp/lighthouse into gl…
eserilev e9f9ad6
Small rename
eserilev 3df2cf8
Add db boilerplate for payload envelope
eserilev c26ad96
small fixes
eserilev b10af22
Fix
eserilev bb9bfaf
fix
eserilev 534e3c7
Merge remote-tracking branch 'origin/payload-envelope-db' into gloas-…
eserilev 6ea9668
Some test fixes
eserilev 1098f5d
Merge branch 'unstable' of https://github.com/sigp/lighthouse into gl…
eserilev d122561
Test fixes
eserilev 72f0a7b
move commitments to bid
eserilev 4e00426
Test only execute for glosa
eserilev 0b92379
Remove state LRU cache for da checker v2
eserilev dee394c
Lint fixes
eserilev ec892bd
Merge branch 'gloas-move-commitments-to-bid' into gloas-data-availabi…
eserilev d047ace
new da checker doesn't need payloads
eserilev 78c61a0
DA cache updated
eserilev e1439e6
Use module level imports
eserilev fadf12e
Merge branch 'gloas-move-commitments-to-bid' into gloas-data-availabi…
eserilev 479fa3f
Remove unused error type
eserilev 4e04399
Use module level imports
eserilev 63e1e26
Cache the bid instead of the block
eserilev 047599a
Fix CI
eserilev dae4529
Merge branch 'gloas-move-commitments-to-bid' into gloas-data-availabi…
eserilev 0a111f5
Resolve merge conflicts
eserilev 1661145
Clean up
eserilev 2abb5f1
fmt
eserilev b5b5b0c
Rename
eserilev c606ba3
Merge branch 'unstable' of https://github.com/sigp/lighthouse into gl…
eserilev fa33577
Remove TODO
eserilev a6cdc41
Update beacon_node/network/src/network_beacon_processor/gossip_method…
eserilev fe602d9
Merge branch 'unstable' of https://github.com/sigp/lighthouse into gl…
eserilev abf0c33
Refactor
eserilev 23a7dc5
Fix
eserilev 3778e50
Fix
eserilev e55f2ff
Resolve merge conflicts
eserilev 2f8e140
Resolve merge conflicts
eserilev 55fa3b3
resolve merge conflicts
eserilev 9cfe662
add payload stuff
eserilev c6b1299
temp chhanges
eserilev 3e3e552
Merge branch 'unstable' of https://github.com/sigp/lighthouse into gl…
eserilev 4c56bd3
remove pre exec payload envelope
eserilev 2acbd2e
Add payload to cache
eserilev 4d04ac1
update
eserilev 83852db
refactor
eserilev 285b7eb
Refactor
eserilev dacc2f0
cleanup
eserilev 2ed5e0f
merge conflicts
eserilev 3a5492f
initial straightforward merge changes
dknopik 4535753
starting to cell-ize
dknopik 4ef4c7d
some progress around reconstruction
dknopik 3772d2f
some claude progress
dknopik 132f94c
clean up claude progress
dknopik 407fd27
impl missing_cells_for_column_sidecar
dknopik a03906d
fix remaining errors
dknopik 60e1ded
Merge branch 'unstable' into gloas-payload-cache
dknopik c76eb3e
merge from unstable
dknopik 215a07c
actually - store bid
dknopik ab1da0b
get rid of unneded type
dknopik d7f5e24
nuke router
dknopik 58fd3dd
claude cont: error handling and wiring up
dknopik 2d33545
error handling and wiring up
dknopik 7cf76ac
clean up
dknopik c5ca824
merge from unstable
dknopik e742d0b
fix tests
dknopik ce00ae2
Use stable `if matches!` instead of `if let` match guard
dapplion bbffb80
Rewrite pending_payload_cache tests to use real public API
dapplion ae17107
fix test runs
dknopik bd8cfa3
Refine Gloas data column availability
dapplion 0b7397e
Refactor
dapplion 23d5be1
Fix pending payload cache test lint
dapplion 4b1aab9
Allow large stack frame in proposer_boost_re_org_test
dapplion 8e19955
Fix pending_payload_cache tests for sampling column filtering
dknopik 361bc37
fix gloas tests
dknopik 16a3dfb
fix events test
dknopik 3e331ff
fix another bug
dknopik 48b24e9
Use SignedExecutionPayloadBid directly in pending payload cache
dapplion 4b76f4d
minor fixes
eserilev 60093f3
minor fixes
eserilev e9ffd19
smol fixes
eserilev 378eaed
Merge branch 'unstable' of https://github.com/sigp/lighthouse into gl…
eserilev fd1a8e1
use slot so we dont hit the cache twice
eserilev 64c53c6
remove duplicate fn impl
eserilev 33c250b
pending payload cache: restore vec-backed column shape
dapplion a4e8b68
pending payload cache: drop unused vec ctor arg
dapplion f7c7ed8
clean up gloas-payload-cache
eserilev 82f2843
Merge branch 'gloas-payload-cache' of https://github.com/dknopik/ligh…
eserilev f14e7b1
remove unneeded field
eserilev aa531ba
yeet some comments
eserilev 73ba763
Gloas: fix test failures (KZG verifier wiring, harness columns, WSS s…
dapplion dac8a6e
Gloas: fix test failures (KZG verifier wiring, harness columns, WSS s…
dapplion 0ce0588
Address review comments
dapplion d75963b
Address remaining review comments
dapplion 8510bb4
smol cleanup
eserilev 2120ebb
smol refactor
eserilev 5ce7c59
Rename validate_full_data_columns_with_commitments
eserilev cbe7bec
Update beacon_node/beacon_chain/src/pending_payload_cache/mod.rs
eserilev 47bcd0b
Fix TODO
eserilev f30287b
Move pending payload cache pruning to finalization callback
dapplion b73a66c
Drop dead columns_available_timestamp, document load_gloas_payload_bi…
dapplion 23159c5
gate sidecars right
dapplion a048744
pending_payload_cache: tighten test surface
dapplion a17ec17
kzg_utils: support Gloas data column reconstruction
dapplion d0209a6
Merge sigp/unstable into gloas-payload-cache
dapplion a077241
test(block_verification): mark payload received after gossip columns
dapplion cee7d03
No more box
eserilev 102c02d
just pass the arc
eserilev 01d51f2
dont panic
eserilev 378a829
Typo
eserilev 4741da5
Return invalid variant error instead of dropping silently
eserilev 0212b87
add todo, remove uneeded ignore large stack frames
eserilev c514597
Add a test case for kzg verif
eserilev 5393fda
return KZG verified data column
eserilev ef14859
Remove wierd comment
eserilev eab6855
Remove bad var name
eserilev 895ed4a
Merge branch 'unstable' of https://github.com/sigp/lighthouse into gl…
eserilev f4d674e
Merge branch 'gloas-payload-cache' of https://github.com/dknopik/ligh…
eserilev 8cc88ab
Simply is_complete()
eserilev dbd91b4
Remove incorrect doc comment about is_complete
eserilev 08637ef
Correct doc comments about sampling columns
eserilev 05bb34d
Exclude partials in status_str
eserilev 7fac5b2
Updatge module level comments to reflect correct architecture
eserilev ddcb16e
Remove unneeded bid param
eserilev 6f9a001
remove invalid scenario
eserilev 8c707ec
Renamed to cache size
eserilev d2ea1b0
Add better comments
eserilev be500f4
Fix seen timestamp
eserilev 4aae9bb
dont penalize peer for GossipDataColumnError::InvalidVariant
eserilev 914aee5
Move get_or_reconstruct_blobs to test file
eserilev b59643a
simplify to use blob kzg_Commitments_len
eserilev f16c333
remove unused MaybeAvailableEnvelope
eserilev 4e649bd
Replaced the unwrap_or_default() (which would silently use Slot(0))
eserilev 0ea5a40
update comment for fulu -> gloas
eserilev 973590a
PriorKnownUnpublished should still propogate columns
eserilev 7e539c7
remove rename start_block_cache_maintenance_service
eserilev 9e5fe03
wire up metrics appropriately
eserilev bf0aa93
Merge branch 'unstable' of https://github.com/sigp/lighthouse into gl…
eserilev cc95341
FMT
eserilev 3355674
Revert commit "PriorKnownUnpublished should still propogate columns".…
jimmygchen 13f971a
Address review comments re consistency check. Use single source of tr…
jimmygchen 1a90970
Merge remote-tracking branch 'origin/unstable' into gloas-payload-cache
jimmygchen e879090
Fix clippy
jimmygchen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ use crate::data_column_verification::{ | |
| GossipVerifiedDataColumn, KzgVerifiedCustodyDataColumn, KzgVerifiedDataColumn, | ||
| verify_kzg_for_data_column_list, | ||
| }; | ||
| use crate::kzg_utils::validate_data_columns_with_commitments; | ||
| use crate::metrics::{ | ||
| KZG_DATA_COLUMN_RECONSTRUCTION_ATTEMPTS, KZG_DATA_COLUMN_RECONSTRUCTION_FAILURES, | ||
| }; | ||
|
|
@@ -490,8 +491,7 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> { | |
| AvailableBlockData::Blobs(blobs) => verify_kzg_for_blob_list(blobs.iter(), &self.kzg) | ||
| .map_err(AvailabilityCheckError::InvalidBlobs), | ||
| AvailableBlockData::DataColumns(columns) => { | ||
| verify_kzg_for_data_column_list(columns.iter(), &self.kzg) | ||
| .map_err(AvailabilityCheckError::InvalidColumn) | ||
| verify_columns_against_block(&self.kzg, available_block.block(), columns) | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -504,13 +504,17 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> { | |
| available_blocks: &[AvailableBlock<T::EthSpec>], | ||
| ) -> Result<(), AvailabilityCheckError> { | ||
| let mut all_blobs = Vec::new(); | ||
| let mut all_data_columns = Vec::new(); | ||
|
|
||
| for available_block in available_blocks { | ||
| match available_block.data().to_owned() { | ||
| match available_block.data() { | ||
| AvailableBlockData::NoData => {} | ||
| AvailableBlockData::Blobs(blobs) => all_blobs.extend(blobs), | ||
| AvailableBlockData::DataColumns(columns) => all_data_columns.extend(columns), | ||
| AvailableBlockData::Blobs(blobs) => all_blobs.extend(blobs.iter().cloned()), | ||
| AvailableBlockData::DataColumns(columns) => { | ||
| // Each block has its own commitments. For Gloas they live in the bid; for | ||
| // Fulu they live inline on the column. Verify per block and let the helper | ||
| // pick the right path. | ||
| verify_columns_against_block(&self.kzg, available_block.block(), columns)?; | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -519,11 +523,6 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> { | |
| .map_err(AvailabilityCheckError::InvalidBlobs)?; | ||
| } | ||
|
|
||
| if !all_data_columns.is_empty() { | ||
| verify_kzg_for_data_column_list(all_data_columns.iter(), &self.kzg) | ||
| .map_err(AvailabilityCheckError::InvalidColumn)?; | ||
| } | ||
|
|
||
| Ok(()) | ||
| } | ||
|
|
||
|
|
@@ -605,9 +604,21 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> { | |
| metrics::inc_counter(&KZG_DATA_COLUMN_RECONSTRUCTION_ATTEMPTS); | ||
| let timer = metrics::start_timer(&metrics::DATA_AVAILABILITY_RECONSTRUCTION_TIME); | ||
|
|
||
| let columns: Vec<_> = verified_data_columns | ||
| .into_iter() | ||
| .map(|c| c.into_inner()) | ||
| .collect(); | ||
| // Fulu columns carry their commitments; reconstruction needs the count to drive the | ||
| // per-blob recovery loop. | ||
| let kzg_commitments = columns | ||
| .first() | ||
| .and_then(|c| c.kzg_commitments().ok().cloned()) | ||
| .ok_or(AvailabilityCheckError::InvalidVariant)?; | ||
|
|
||
| let all_data_columns = KzgVerifiedCustodyDataColumn::reconstruct_columns( | ||
| &self.kzg, | ||
| &verified_data_columns, | ||
| columns, | ||
| &kzg_commitments, | ||
| &self.spec, | ||
| ) | ||
| .map_err(|e| { | ||
|
|
@@ -676,6 +687,35 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> { | |
| } | ||
| } | ||
|
|
||
| /// Verify a batch of data columns belonging to a single block, picking the right commitment | ||
| /// source for the block's fork (Fulu: inline on column; Gloas: from the embedded payload bid). | ||
| fn verify_columns_against_block<E: EthSpec>( | ||
| kzg: &Kzg, | ||
| block: &SignedBeaconBlock<E>, | ||
| columns: &[Arc<DataColumnSidecar<E>>], | ||
| ) -> Result<(), AvailabilityCheckError> { | ||
| if columns.is_empty() { | ||
| return Ok(()); | ||
| } | ||
| if block.fork_name_unchecked().gloas_enabled() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a little confusing that we're handling gloas in the old da checker, perhaps this logic could be in the new one. This is minor though - we could clean it up when we remove the old da checker also. |
||
| let commitments = block | ||
| .message() | ||
| .body() | ||
| .signed_execution_payload_bid() | ||
| .map(|bid| bid.message.blob_kzg_commitments.clone()) | ||
| .map_err(|_| { | ||
| AvailabilityCheckError::Unexpected( | ||
| "Gloas block missing signed_execution_payload_bid".to_string(), | ||
| ) | ||
| })?; | ||
| validate_data_columns_with_commitments(kzg, columns.iter(), commitments.as_ref()) | ||
| .map_err(AvailabilityCheckError::InvalidColumn) | ||
| } else { | ||
| verify_kzg_for_data_column_list(columns.iter(), kzg) | ||
| .map_err(AvailabilityCheckError::InvalidColumn) | ||
| } | ||
| } | ||
|
|
||
| /// Helper struct to group data availability checker metrics. | ||
| pub struct DataAvailabilityCheckerMetrics { | ||
| pub block_cache_size: usize, | ||
|
|
@@ -874,10 +914,13 @@ impl<E: EthSpec> AvailableBlock<E> { | |
|
|
||
| match &block_data { | ||
| AvailableBlockData::NoData => { | ||
| if columns_required { | ||
| return Err(AvailabilityCheckError::MissingCustodyColumns); | ||
| } else if blobs_required { | ||
| return Err(AvailabilityCheckError::MissingBlobs); | ||
| // For Gloas, DA is checked for the PayloadEnvelope, not for the block. | ||
| if !block.fork_name_unchecked().gloas_enabled() { | ||
| if columns_required { | ||
| return Err(AvailabilityCheckError::MissingCustodyColumns); | ||
| } else if blobs_required { | ||
| return Err(AvailabilityCheckError::MissingBlobs); | ||
| } | ||
| } | ||
| } | ||
| AvailableBlockData::Blobs(blobs) => { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The early return is fine for correctness, however worth noting that we lose the cross-block KZG batching, and could be a slight performance regression.