-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: validate headers loaded from file on reth import
#14050
Conversation
2fb92ca
to
f187331
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.
smol, nit
this solution seems fine, although the fileclient type and chunk reading is a bit weird and ideally we have a different stream type for this, but we could scope separately
@@ -668,7 +717,7 @@ mod tests { | |||
let mut local_header = headers.first().unwrap().clone(); | |||
|
|||
// test | |||
while let Some(client) = reader.next_chunk::<FileClient>().await.unwrap() { | |||
while let Some(client) = reader.next_chunk::<Block>(NoopConsensus::arc()).await.unwrap() { |
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.
this loops a bit odd, why do we need to provide this per chunk?
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.
although not ideal, each chunk is like 1GB worth of blocks that we read from disk, so it should be kinda fine
while let Some(file_client) = | ||
reader.next_chunk::<BlockTy<N>>(consensus.clone(), Some(sealed_header)).await? |
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.
this works, but I wonder if a nicer solution to this would be a custom stream type and not require the consensus per next_chunk call.
but this entire type is weird so seems fine
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.
agree, would rather we track this separately tbh, just want it to work for now for hive tests
3b2de27
to
af41aba
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
will scope some improvements to this separately
af41aba
to
ad0a920
Compare
ad0a920
to
b2fdec7
Compare
We were trusting that all headers coming from rlp were valid, but that might not be the case (eg. hive negative tests)
Should solve a bunch of tests on hive eest
#14009
edit: it does solve a bunch of eest tests (consume/rlp)