-
Notifications
You must be signed in to change notification settings - Fork 298
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
Creation of blob sidecars (with inclusion proof) when publishing #7721
Creation of blob sidecars (with inclusion proof) when publishing #7721
Conversation
return operationSelector | ||
.createBlobSidecarsSelector() | ||
.createBlobSidecarsSelectorOld() |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
BlockOperationSelectorFactory.createBlobSidecarsSelectorOld
return operationSelector | ||
.createBlobSidecarsSelector() | ||
.createBlobSidecarsSelectorOld() |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
BlockOperationSelectorFactory.createBlobSidecarsSelectorOld
.isEqualTo(blobsBundle.getCommitments().get(0)); | ||
assertThat(blobSidecar.getKZGProof()).isEqualTo(blobsBundle.getProofs().get(0)); | ||
}); | ||
safeJoin(factory.createBlobSidecarsSelectorOld().apply(block)); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
BlockOperationSelectorFactory.createBlobSidecarsSelectorOld
aad6a7f
to
ecfe8c4
Compare
1ff3ff7
to
01f2428
Compare
...alidator/src/test/java/tech/pegasys/teku/validator/coordinator/AbstractBlockFactoryTest.java
Fixed
Show fixed
Hide fixed
7ef48e4
to
cfaf024
Compare
...spec/src/main/java/tech/pegasys/teku/spec/logic/versions/deneb/helpers/MiscHelpersDeneb.java
Outdated
Show resolved
Hide resolved
@@ -1181,6 +1207,49 @@ public BeaconBlockBody randomBlindedBeaconBlockBody() { | |||
return randomBlindedBeaconBlockBody(randomUInt64()); | |||
} | |||
|
|||
public BeaconBlockBody randomBlindedBeaconBlockBodyWithCommitments( | |||
final UInt64 slot, final SszList<SszKZGCommitment> commitments) { | |||
BeaconBlockBodySchema<?> schema = |
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.
final
}) | ||
.join(); | ||
} | ||
|
||
public BeaconBlockBody randomBlindedBeaconBlockBody(UInt64 slotNum) { |
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.
We could call yours from this one with randomBlobKzgCommitments()
at commitments.
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 problem is for pre-Deneb
spec that would fail since there would be no BlobKzgCommitmentsSchema
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.
Ahh, got it. Ok
@@ -1410,8 +1484,7 @@ public BeaconBlockBody randomBeaconBlockBodyWithCommitments(final int count) { | |||
.syncAggregate(randomSyncAggregateIfRequiredBySchema(schema)) | |||
.executionPayload(SafeFuture.completedFuture(randomExecutionPayload())) | |||
.blsToExecutionChanges(randomSignedBlsToExecutionChangesList()) | |||
.blobKzgCommitments( | |||
SafeFuture.completedFuture(randomBlobKzgCommitments(count)))) | |||
.blobKzgCommitments(SafeFuture.completedFuture(commitments))) | |||
.join(); | |||
} | |||
|
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.
you could use #randomBeaconBlockBodyWithCommitments( final SszList<SszKZGCommitment> commitments)
in randomFullBeaconBlockBody()
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.
So this suggestion will fail preDeneb too. Ok
final SignedBeaconBlock signedBeaconBlock, | ||
final UInt64 index, | ||
final Blob blob, | ||
final SszKZGCommitment commitment, |
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 don't like this interface a bit, because we already have commitment in block and passed index, so passing commitment separately is redundant and could cause error, maybe omit this field?
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 like that idea. Makes things cleaner.
|
||
final BlockAndBlobs blockAndBlobs = assertBlobSidecarsCreated(false, spec); | ||
|
||
final List<BlobSidecar> blobSidecars = blockAndBlobs.blobSidecars(); |
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.
could you please add assert not empty here, I'm a bit paranoid
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.
These assertions are done in the assertBlobSidecarsCreated
method following the pattern from other unit tests in this class.
|
||
final BlockAndBlobs blockAndBlobs = assertBlobSidecarsCreated(true, spec); | ||
|
||
final List<BlobSidecar> blobSidecars = blockAndBlobs.blobSidecars(); |
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.
and here please (check non empty)
...src/test/java/tech/pegasys/teku/validator/coordinator/BlockOperationSelectorFactoryTest.java
Show resolved
Hide resolved
...src/test/java/tech/pegasys/teku/validator/coordinator/BlockOperationSelectorFactoryTest.java
Outdated
Show resolved
Hide resolved
...src/test/java/tech/pegasys/teku/validator/coordinator/BlockOperationSelectorFactoryTest.java
Outdated
Show resolved
Hide resolved
Thanks for feedback @zilm13 Added required changes, so you can have another look when you can. |
ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java
Outdated
Show resolved
Hide resolved
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, good refactor of computeKzgCommitmentInclusionProof
Just some final nits
Also #7721 (comment) is still actual
...n/validator/src/test/java/tech/pegasys/teku/validator/coordinator/BlockFactoryDenebTest.java
Show resolved
Hide resolved
...n/validator/src/test/java/tech/pegasys/teku/validator/coordinator/BlockFactoryDenebTest.java
Show resolved
Hide resolved
eadb9f3
to
00a7246
Compare
Thanks. I renamed the method to |
@StefanBratanov yeah, looks good |
PR Description
computeBlobSidecar
inMiscHelpersDeneb
BlockOperationSelectorFactory
createBlobSidecars
method inBlockFactory
and use it inAbstractBlockPublisher
Fixed Issue(s)
helps with block publishing flow for #7654
Documentation
doc-change-required
label to this PR if updates are required.Changelog