-
Notifications
You must be signed in to change notification settings - Fork 724
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
Remove the MaxRequestBlocks
type
#4562
Comments
Tagging this as Deneb, because some consumers of our |
I've started working on this. Essentially going with this suggestion:
Except in implementation, I'm making a wrapper around a vec that does the length check and requires it at construction and during decoding. Looks like this: EDIT: I initially had
|
implemented in #4841 |
Description
#4426 shifts a lot of the network configuration constants into the configuration file. There are some configurations still remaining to shift. One is the
max_request_blocks
configuration.This one is a little bit trickier because we have specified a
MaxRequestBlocks
type astypenum::U1024
and we use it inside anssz_types::VariableList
.The way that I see we can remedy this, is in most cases to use a
VariableList<_,Usize::max>
kind of deal. The second type parameter just sets an upper bound on how many elements we can ssz decode. Although it would be nice to set this to whatever is in the configuration file, this might not be easy to do. There are two easy paths:U1024
. The configuration can set lower bounds and it will be fine.In principle, if we are careful, we shouldn't need to rely on this type to limit the number of elements to decode. The inbound RPC should be bounded by the configuration file and we shouldn't be adding excess elements anyway. So although this type bound is nice, it shouldn't be strictly necessary, provided we have the checks when reading or requesting these objects on the RPC.
This needs to be checked.
Also open to any other solutions people may have. Maybe we can convert an arbitrary uint from configuration to its closest (rounded up) typenum and use that value?
The text was updated successfully, but these errors were encountered: