-
Notifications
You must be signed in to change notification settings - Fork 303
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
Implement BlobSidecarsByRoot RPC method #6844
Implement BlobSidecarsByRoot RPC method #6844
Conversation
c4d09c7
to
9fb6907
Compare
3a5794a
to
5d86d13
Compare
...rc/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/BlobIdentifier.java
Show resolved
Hide resolved
71e44b0
to
44fcec9
Compare
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/Eth2Peer.java
Fixed
Show fixed
Hide fixed
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/Eth2Peer.java
Fixed
Show fixed
Hide fixed
...rc/main/java/tech/pegasys/teku/spec/datastructures/networking/libp2p/rpc/BlobIdentifier.java
Outdated
Show resolved
Hide resolved
@@ -111,6 +119,8 @@ | |||
boolean wantToReceiveBlobsSidecars( | |||
ResponseCallback<BlobsSidecar> callback, long blobsSidecarsCount); | |||
|
|||
boolean wantToReceiveBlobSidecars(ResponseCallback<BlobSidecar> callback, long blobSidecarsCount); |
Check notice
Code scanning / CodeQL
Useless parameter
@@ -111,6 +119,8 @@ | |||
boolean wantToReceiveBlobsSidecars( | |||
ResponseCallback<BlobsSidecar> callback, long blobsSidecarsCount); | |||
|
|||
boolean wantToReceiveBlobSidecars(ResponseCallback<BlobSidecar> callback, long blobSidecarsCount); |
Check notice
Code scanning / CodeQL
Useless parameter
5914094
to
2edb25a
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, just needs a few more improvements
...pegasys/teku/spec/datastructures/networking/libp2p/rpc/BlobSidecarsByRootRequestMessage.java
Outdated
Show resolved
Hide resolved
...tegration-test/java/tech/pegasys/teku/networking/eth2/BlobSidecarsByRootIntegrationTest.java
Show resolved
Hide resolved
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/DefaultEth2Peer.java
Outdated
Show resolved
Hide resolved
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/DefaultEth2Peer.java
Outdated
Show resolved
Hide resolved
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/DefaultEth2Peer.java
Show resolved
Hide resolved
identifier.getBlockRoot(), identifier.getIndex()); | ||
} | ||
|
||
private void handleError(final ResponseCallback<BlobSidecar> callback, final Throwable error) { |
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 looks very generic. How difficult is to move it to the parent class?
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.
Not very much but there are logs which are different and not straightforward to parameterize so thinking of leaving it for now
final UInt64 requestedEpoch = spec.computeEpochAtSlot(block.getSlot()); | ||
final UInt64 minimumRequestEpoch = computeMinimumRequestEpoch(finalizedEpoch); | ||
if (requestedEpoch.isLessThan(minimumRequestEpoch)) { | ||
throw new RpcException( |
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.
From the spec:
If any root in the request content references a block earlier than minimum_request_epoch, peers MAY respond with error code 3: ResourceUnavailable or not include the blob in the response.
.
So, it's MAY. Should we be so strict when responding?
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 know. It's good to have diversity, so decided to include it, since we already retrieve the block and it's cheap.
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/DefaultEth2Peer.java
Show resolved
Hide resolved
e60436b
to
48b32e9
Compare
1df0182
to
c86e2a7
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.
LGTM,
I'd just ask @tbenr if he is ok with #6844 (comment)
I'm ok with that. |
PR Description
wantToReceiveBlobSidecars
to 6778 blob sidecars by range #6835Fixed Issue(s)
fixes #6830
Documentation
doc-change-required
label to this PR if updates are required.Changelog