-
Notifications
You must be signed in to change notification settings - Fork 886
Fork aware max values in rpc #6847
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
Conversation
@@ -455,7 +459,6 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> { | |||
(None, None) | |||
}; | |||
|
|||
// TODO(pawan): this would break if a batch contains multiple epochs |
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.
Even if a batch contains multiple epochs (which it doesn't), this is a very niche case that would only break during fork boundaries.
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 Pawan, left some suggestions :)
|
||
match &req { | ||
RequestType::BlocksByRange(request) => { | ||
let max_allowed = spec.max_request_blocks(current_fork) as u64; |
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.
Have we ever thought about making the limit dependent on the protocol version or the active fork at the time of the request.slot
range? It seems like we could inadvertently reject requests from clients that use different limits for pre-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.
Hi Michael, can you elaborate on what you mean by request.slot
range?
If it's pre Deneb max_request_blocks
will return the value for pre Deneb 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.
We are always using the current fork according to wall clock time, so if the request is for pre-Deneb data but the current fork is post-Deneb, we will use the Deneb value.
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 don't do it that way to keep things consistent between byroot and byrange requests (since we cannot know the slot when we get root requests).
I asked other CL teams how they handle it and it seems like prysm and lodestar do by slot, but nimbus does it by current fork.
In practice, I don't think this matters that much because all clients request 1/2 epochs per by_range request which doesn't hit the limits.
Co-authored-by: Michael Sproul <[email protected]>
suggestions have already been addressed
Issue Addressed
N/A
Proposed Changes
In #6329 we changed
max_blobs_per_block
from a preset to a config value.We weren't using the right value based on fork in that PR. This is a follow up PR to use the fork dependent values.
In the proces, I also updated other places where we weren't using fork dependent values from the ChainSpec.
Note to reviewer: easier to go through by commit