Skip to content
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

Store execution payloads during backfill if --prune-payloads false #6510

Open
michaelsproul opened this issue Oct 18, 2024 · 4 comments
Open
Assignees
Labels
database enhancement New feature or request

Comments

@michaelsproul
Copy link
Member

Description

@KolbyML notes that the ability to keep execution payloads during block backfill would be useful for syncing Trin (portal network client). It's a bit of a gotcha that at the moment Lighthouse throws out execution payloads during backfill sync, even when running with --prune-payloads false. We download the payloads from peers, and then throw them straight in the bin!

// Store block in the hot database without payload.
self.store
.blinded_block_as_kv_store_ops(&block_root, &blinded_block, &mut hot_batch);
// Store the blobs too
if let Some(blobs) = maybe_blobs {
new_oldest_blob_slot = Some(block.slot());
self.store
.blobs_as_kv_store_ops(&block_root, blobs, &mut blob_batch);
}
// Store block roots, including at all skip slots in the freezer DB.
for slot in (block.slot().as_usize()..prev_block_slot.as_usize()).rev() {
chunk_writer.set(slot, block_root, &mut cold_batch)?;
}

Steps to resolve

If prune-payloads is false, store execution payloads in the hot DB as part of import_historical_block_batch.

Additional Info

Should probably be implemented after the hdiff PR is merged, which modifies the backfill logic:

@KolbyML
Copy link
Contributor

KolbyML commented Oct 18, 2024

Just to clarify some terminology as we (EF Portal) use a lot of confusing terminology.

  • Portal: is a collection of p2p protocols built on the Portal-wire-specification which is a framework for building distributed storage networks or p2p networks in general
  • Trin: is an implementation of the Portal specification and all the sub-protocols (history,state,beacon,etc). All networks are optional to implement.
  • Trin Execution: is an Execution client we are implementing comparable to Geth/Nethermind/Besu/etc but with the key difference of we will not be using devp2p. So instead we will need to rely on “The Portal Networks”, archival formats, and Consensus clients to achieve what devp2p provides.

Our initial usecase of Trin Execution will be gossiping genesis-latest execution state diffs to the “Portal State Network”, but it will likely become a full Execution client released to the public in time. It also serves as a backup solution if we don’t get adequate adoption by major EL clients.

So this change would be very nice for syncing Trin Execution!

@michaelsproul
Copy link
Member Author

Unblocked, will try to get this in for the next release

@chong-he
Copy link
Member

chong-he commented Jan 3, 2025

I would like to give this a go

@michaelsproul
Copy link
Member Author

michaelsproul commented Jan 9, 2025

Part of the changes required for this feature (pruning) are in this PR:

That PR updates the pruning to go back to the oldest_block_slot (rather than the slot of the downloaded checkpoint), which ensures that we will prune payloads between oldest_block_slot and anchor_slot if they are backfilled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants
@michaelsproul @KolbyML @chong-he and others