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

Blob sidecars availability checker #7081

Merged
merged 17 commits into from
May 5, 2023

Conversation

tbenr
Copy link
Contributor

@tbenr tbenr commented Apr 26, 2023

  • Block processor won't deal with data availability anymore. Everything will be done in ForkChoice.
  • Some minor changes to BlobsSidecarPool (including fix to cleanly ignore non-deneb blocks)
  • BlockManager now knows about BlobsSidecarPool:
    • feeds validated blocks into it
    • removes successfully imported blocks from it
    • removes invalid blocks from it
  • BlobSidecarManager implementation
    • now interacts with FutureItems<SignedBlobSidecar> and BlobsSidecarPool
    • implements the createAvailabilityChecker method.
  • ForkChoiceBlobSidecarsAvailabilityChecker implementation:
    • leverages the BlockBlobSidecarsTracker two implement a two stage async blobs validation
    • the final verification step waits the tracker to complete with a timeout set as 1\3 of the slot time

Fixes #6848
Fixes #7080
Fixes #6673
Fixes #7110

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

@tbenr tbenr force-pushed the blob_sidecars_availability_checker branch 2 times, most recently from 842dcea to 25cfdaf Compare April 28, 2023 15:40
@@ -79,16 +93,32 @@ public BlobSidecarManagerImpl(
public SafeFuture<InternalValidationResult> validateAndImportBlobSidecar(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should find some better word for this and next method. We are not importing BlobSidecars here. validateAndPrepare maybe. Don't like either but import is definitely not a word for new flow from my view

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah... I was lazily naming it like the block counterpart but now is time to find a good one

@tbenr tbenr force-pushed the blob_sidecars_availability_checker branch from 5871a86 to 97c3ca4 Compare May 2, 2023 17:04
@tbenr tbenr marked this pull request as ready for review May 2, 2023 17:04
@tbenr tbenr marked this pull request as draft May 2, 2023 17:05
Copy link
Contributor

@zilm13 zilm13 left a comment

Choose a reason for hiding this comment

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

Looks great, most nit comments only about naming. I like the way ForkChoiceBlobSidecarsAvailabilityChecker was refactored, there are some blocks now it's made from and it's much easier to read it. Just maybe some naming could be improved. I've not checked ForkChoiceBlobSidecarsAvailabilityCheckerTest to complete review yet, will check tomorrow

invalidBlobSidecarRoots.put(
signedBlobSidecar.getBlobSidecar().hashTreeRoot(), result);
break;
default:
Copy link
Contributor

Choose a reason for hiding this comment

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

It's very counterintuitive way to handle IGNORE. I think it's better to do it in direct way

}

@Override
public void onSlot(final UInt64 slot) {
validatedPendingBlobs.headMap(slot.minusMinZero(1)).clear();

blobSidecarPool.onSlot(slot);
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe it's better to subscribe blobSidecarPool and futureBlobSidecars on onSlot events on creation in BeaconChainController like we do for all others?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was doing the same way PendingPool , which i think is a way to enforce that pools get updated before the manager performs it's things, while in the other way all onSlot are independent and run in parallel.

@@ -377,20 +378,20 @@ private BlockImportResult importBlockAndState(
payloadResult.getFailureCause().orElseThrow());
}

if (blobsSidecarAndValidationResult.isFailure()) {
if (blobSidecarsAndValidationResult.isFailure()) {
LOG.error(
"blobsSidecar validation result: {}",
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe make some custom toString() for blobSidecarsAndValidationResult to make this logging line and next two more useful?

final List<KZGCommitment> kzgCommitmentsToValidate;
final List<BlobSidecar> blobSidecarsToValidate;

final boolean performCompleteValidation = blockBlobSidecarsTracker.isCompleted();
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit worried we are not synschronized between this and getting some blobSidecars array. Isnt' we?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it isn't a problem because the tracker becomes completed only when is guaranteed to expose the full set of blobSidecar. The tracker is "add only" so it isn't possible that in the meantime a blob disappears.

@tbenr tbenr force-pushed the blob_sidecars_availability_checker branch from 97c3ca4 to 3a79ac6 Compare May 3, 2023 16:44
@tbenr tbenr force-pushed the blob_sidecars_availability_checker branch from 7ae5ce2 to 517c136 Compare May 4, 2023 17:30
Pool not failing on non deneb blocks
@tbenr tbenr marked this pull request as ready for review May 5, 2023 09:16
Copy link
Contributor

@zilm13 zilm13 left a comment

Choose a reason for hiding this comment

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

LGTM

@tbenr tbenr enabled auto-merge (squash) May 5, 2023 15:24
@tbenr tbenr merged commit 5795062 into Consensys:master May 5, 2023
@tbenr tbenr deleted the blob_sidecars_availability_checker branch May 5, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants