-
Notifications
You must be signed in to change notification settings - Fork 309
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
Blob sidecars availability checker #7081
Conversation
842dcea
to
25cfdaf
Compare
@@ -79,16 +93,32 @@ public BlobSidecarManagerImpl( | |||
public SafeFuture<InternalValidationResult> validateAndImportBlobSidecar( |
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.
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
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.
yeah... I was lazily naming it like the block counterpart but now is time to find a good one
5871a86
to
97c3ca4
Compare
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.
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
.../beaconchain/src/main/java/tech/pegasys/teku/services/beaconchain/BeaconChainController.java
Outdated
Show resolved
Hide resolved
invalidBlobSidecarRoots.put( | ||
signedBlobSidecar.getBlobSidecar().hashTreeRoot(), result); | ||
break; | ||
default: |
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.
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); |
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.
maybe it's better to subscribe blobSidecarPool
and futureBlobSidecars
on onSlot
events on creation in BeaconChainController like we do for all others?
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.
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: {}", |
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.
Maybe make some custom toString()
for blobSidecarsAndValidationResult
to make this logging line and next two more useful?
.../tech/pegasys/teku/statetransition/forkchoice/ForkChoiceBlobSidecarsAvailabilityChecker.java
Outdated
Show resolved
Hide resolved
.../tech/pegasys/teku/statetransition/forkchoice/ForkChoiceBlobSidecarsAvailabilityChecker.java
Outdated
Show resolved
Hide resolved
final List<KZGCommitment> kzgCommitmentsToValidate; | ||
final List<BlobSidecar> blobSidecarsToValidate; | ||
|
||
final boolean performCompleteValidation = blockBlobSidecarsTracker.isCompleted(); |
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.
I'm a bit worried we are not synschronized between this and getting some blobSidecars
array. Isnt' we?
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.
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.
.../tech/pegasys/teku/statetransition/forkchoice/ForkChoiceBlobSidecarsAvailabilityChecker.java
Outdated
Show resolved
Hide resolved
.../tech/pegasys/teku/statetransition/forkchoice/ForkChoiceBlobSidecarsAvailabilityChecker.java
Outdated
Show resolved
Hide resolved
.../tech/pegasys/teku/statetransition/forkchoice/ForkChoiceBlobSidecarsAvailabilityChecker.java
Show resolved
Hide resolved
97c3ca4
to
3a79ac6
Compare
...h/pegasys/teku/statetransition/forkchoice/ForkChoiceBlobSidecarsAvailabilityCheckerTest.java
Outdated
Show resolved
Hide resolved
UT update started
fix tests compilation apply suggestions on the AvailabilityChecker
Improve pool for the manager usage other suggestions
7ae5ce2
to
517c136
Compare
Pool not failing on non deneb blocks
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.
LGTM
...m/statetransition/src/main/java/tech/pegasys/teku/statetransition/blobs/BlobSidecarPool.java
Outdated
Show resolved
Hide resolved
...tatetransition/src/main/java/tech/pegasys/teku/statetransition/util/BlobSidecarPoolImpl.java
Outdated
Show resolved
Hide resolved
fix method name improve comment
ForkChoice
.BlobsSidecarPool
(including fix to cleanly ignore non-deneb blocks)BlockManager
now knows aboutBlobsSidecarPool
:BlobSidecarManager
implementationFutureItems<SignedBlobSidecar>
andBlobsSidecarPool
createAvailabilityChecker
method.ForkChoiceBlobSidecarsAvailabilityChecker
implementation:BlockBlobSidecarsTracker
two implement a two stage async blobs validation1\3
of the slot timeFixes #6848
Fixes #7080
Fixes #6673
Fixes #7110
Documentation
doc-change-required
label to this PR if updates are required.Changelog