-
Notifications
You must be signed in to change notification settings - Fork 24
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: add block signature validation #77
Conversation
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.
Super clean! Have one thought I'd like to share:
Wdyt about creating our own fuel block type instead of just reexporting from fuel_core_client
for the following reasons:
- We can write fuzzing/parameterized tests for the block validation (since we can derive stuff for the block type)
- We can remove the
fuel_core_client
dep from the ports
or just write tests for every hash input.
Mostly because of 1. since there is so much stuff that goes into the hash, we should probably cover all of it with tests -- i.e. test that any change in any of the inputs should render the block invalid since this is so sensitive in nature.
Ideally we'd do some form of fuzzing or something akin to it just so we cover as much as possible.
Co-authored-by: Ahmed Sagdati <[email protected]>
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, having read through the code. I'll not pass judgement as I don't have enough committer knowledge.
closes: #57
This PR introduces a new
validator
crate which holds aBlockValidator
struct that can validate blocks coming from the fuel network. Once theblock_watcher
receives a new block it is validated by theBlockValidator
and a newValidatedFuelBlock
is then propagated throughout the block committer.