-
Notifications
You must be signed in to change notification settings - Fork 997
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
Specify when clients can serve block and sidecars in byRoot RPC methods #3551
Conversation
This might be ambiguous. Does it mean that the decision to serve a block depends on the attestation boundary? When does a client run an |
I'm referring to the second, when In actual client implementations, we could have block import failing for that reason before receiving a response from the EL (this is not the case in TEKU, where we fail that way when everything else has been validated successfully). We could add a sentence like: |
Ah, sorry, got confused but I see the point now. Then we should include that into Deneb p2p-interface as in the proposed change the spec doesn’t make any note about a block without fully available blobs. |
Added, but the problem with that detail is that, if we strictly follow how |
@mkalinin I'm thinking about a different phrasing like:
(Similarly for This clarifies what is supposed to be served, but I don't have the history of why it wasn't made explicit from the beginning. |
@tbenr -- what do you think about the difference between passing |
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.
ah damn, I just realized I never submitted my review from last week
here you go!
@djrtwo made a good call on referring to the
The spec can say SHOULD NOT serve blocks for which one of the following conditions is not satisfied:
SHOULD NOT would give a room for implementations to start serving a block after it passes gossip validation but additional checks aren’t yet executed. |
Doing a final review @tbenr can you rebase this to |
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
Co-authored-by: danny <dannyjryan@gmail.com>
Co-authored-by: danny <dannyjryan@gmail.com>
589d0ac
to
bdac932
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.
I think we can merge after addressing a couple of small things
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
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.
- Signalling approval to current text here and to the discussion in Serving blocks and blob_sidecars in RPC byRoot right after they passed gossip validation #3547 by extension
Note for implementers: In Lodestar today the flow to query blocks by root is:
- Receive block ReqResp response
- Run state transition on block
- Import to fork-choice / db
now block is available to other ReqResp requesters
I think the requesting logic will have to be modified to:
- Receive block ReqResp response
- Run gossip validation rules
Make block available to other ReqResp requesters - Run state transition on block
- Import to fork-choice / db
specs/deneb/p2p-interface.md
Outdated
@@ -300,6 +303,11 @@ Clients MUST support requesting sidecars since `minimum_request_epoch`, where `m | |||
Clients MUST respond with at least one sidecar, if they have it. | |||
Clients MAY limit the number of blocks and sidecars in the response. | |||
|
|||
Clients SHOULD include a sidecar in the response as soon as it passes the gossip validation rules. | |||
Clients MUST NOT respond with sidecars that fails gossip validation rules. |
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.
Does this need to be explicit? This is the default for all gossip topics wrt other responses and general processing, right?
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.
To me this explicitly states that client must not try to serve this before completing the validation, and if validation fails it must not be considered when serving the RPC call.
So there are no assumptions on clients internal RPC and gossip processing.
I agree that probably for most of current clients (teku for sure) this is true by default.
Is there somewhere a general statement that says "messages must pass gossip validation rules before being considered by any mean by the client"?
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.
There is not other than the fact that gossipsub generally is gating messages from the application layer on these conditions. Not opposed to a general note if it's warranted, but I don't think we need to call out for each specific instance
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.
Fair, let's remove it from here.
Co-authored-by: danny <dannyjryan@gmail.com>
specs/phase0/p2p-interface.md
Outdated
@@ -856,6 +856,9 @@ Clients MUST support requesting blocks since the latest finalized epoch. | |||
Clients MUST respond with at least one block, if they have it. | |||
Clients MAY limit the number of blocks in the response. | |||
|
|||
Clients MAY include a block in the response as soon as it passes the gossip validation rules. | |||
Clients SHOULD NOT respond with blocks that fail beacon chain state transition. |
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 can still have this post deneb as well as all clients are verifying blocks without waiting for all blobs to show up
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.
Yes. Deneb updates the first rule but leaves this one unchanged
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.
sounds good, it would have been good to enumerate the rules so as to be super clear, but nevertheless lgtm
specs/deneb/p2p-interface.md
Outdated
@@ -300,6 +303,10 @@ Clients MUST support requesting sidecars since `minimum_request_epoch`, where `m | |||
Clients MUST respond with at least one sidecar, if they have it. | |||
Clients MAY limit the number of blocks and sidecars in the response. | |||
|
|||
Clients SHOULD include a sidecar in the response as soon as it passes the gossip validation rules. | |||
Clients SHOULD NOT respond with sidecars related to blocks that fail gossip validation rules. | |||
Clients SHOULD NOT include sidecars related to blocks that fail `state_transition(block)`. |
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.
Clients SHOULD NOT include sidecars related to blocks that fail `state_transition(block)`. | |
Clients SHOULD NOT include sidecars related to blocks that fail beacon chain state transition. |
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.
why do we wanna have this removed? seems reasonable to me
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.
Sorry, that was due to my misread, updated the suggestion!
Based on conversation in #3547.
Allow clients to respond with blocks and blobs as soon as they pass gossip validation.
Blocks:
The idea is to have it a possibility (
MAY
) inPhase0
but to be an encouraged (SHOULD
) behaviour fromDeneb
. This to allow mixed client approach: some could add it fromDeneb
only, other could have it enabled for all forks.The second rule (
SHOULD NOT
) is to prevent clients continue serving blocks that turn out to be invalid during state transition.Blob sidecar:
Similar to blocks: they
SHOULD
be served as soon as they pass gossip validation rules, even before the corresponding block is received. But as soon as block is received, If it fails gossip rules or state transition, the associated blob sidecars have to stop being served (together with the block itself).fixes #3547