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

Generalize block available time metric for PeerDAS #6850

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

dapplion
Copy link
Collaborator

@dapplion dapplion commented Jan 23, 2025

Issue Addressed

Currently BlockDelays metrics track all_blobs_observed which is has the "intention" to track the time at which the last blob for a block was received. This metric won't register for PeerDAS.

Proposed Changes

To generalize this for PeerDAS

  • Register the last blob or data column seen on all_blobs_observed

Should I update the name of the metric?

@dapplion dapplion added the das Data Availability Sampling label Jan 23, 2025
@dapplion dapplion force-pushed the observed-times-peerdas branch from 7153ecf to 66ae7ee Compare January 24, 2025 17:52
@dapplion dapplion added the ready-for-review The code is ready for review label Jan 24, 2025
@dapplion dapplion requested a review from jimmygchen January 24, 2025 17:53
@dapplion dapplion mentioned this pull request Jan 25, 2025
52 tasks
Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

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

I've added a few minor comments, overall looks good to me!
I think it's ok to keep the same metric name, it's still means the same thing - the last timestamp we get all the required blobs to make block available (regardless of whether the transmit unit is column sidecar or blob sidecar).

@@ -565,6 +571,8 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
&self.kzg,
&pending_components.verified_data_columns,
&self.spec,
// TODO(das): what timestamp to use when reconstructing columns?
timestamp_now(),
Copy link
Member

Choose a reason for hiding this comment

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

On one hand I think would be a bit more consistent if we put it after reconstruction, and right before we add the columns to put_kzg_verified_data_columns, similar to elsewhere; On the other hand, we can argue that we have these columns once we see the last column that triggered reconstruction. I don't see an issue going either way.

One scenario i can think of is -

  1. receive column 64, and trigger reconstruction, last_seen timestamp is now
  2. receive column 65 from gossip, last seen timestamp is now + t
  3. block is available when reconstruction completes, and last seen timestamp is actually now + t, not the reconstructed columns that made the block available.

Another scenario

  1. receive column 64, and trigger reconstruction, last_seen timestamp is now
  2. receive column 65-127 from gossip, last seen timestamp is now + t
  3. block is made available before reconstruction completed
  4. reconstruction completed, but we ignore the columns because they're already in the cache.
  5. Note that we trigger make_available again here (bug), but it doesnt change the last seem timestamp, still now + t

(bug issue: #6439)

Copy link
Member

Choose a reason for hiding this comment

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

Not suggesting a change here - but if you think it makes sense to use the timestamp before reconstruction (i.e. the last data column that triggered reconstruction to make this block available), we can remove this TODO

@@ -233,11 +234,17 @@ impl<T: BeaconChainTypes, O: ObservationStrategy> GossipVerifiedDataColumn<T, O>
#[ssz(struct_behaviour = "transparent")]
pub struct KzgVerifiedDataColumn<E: EthSpec> {
data: Arc<DataColumnSidecar<E>>,
#[ssz(skip_serializing, skip_deserializing)]
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need Encode and Decode here? might be able to remove it now we don't store overflow cache anymore.

@@ -293,29 +300,38 @@ impl<E: EthSpec> CustodyDataColumn<E> {
#[ssz(struct_behaviour = "transparent")]
pub struct KzgVerifiedCustodyDataColumn<E: EthSpec> {
data: Arc<DataColumnSidecar<E>>,
#[ssz(skip_serializing, skip_deserializing)]
Copy link
Member

Choose a reason for hiding this comment

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

sam as above

@jimmygchen jimmygchen added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
das Data Availability Sampling waiting-on-author The reviewer has suggested changes and awaits thier implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants