-
Notifications
You must be signed in to change notification settings - Fork 20.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
eth/protocols/eth: add protocol handler fuzzers #30417
Conversation
Well, the fuzzer will hit a little bit of production code, but the whole backend is a test-backend, so it's only a very small layer of handler-code that we'll fuzz. It's better than nothing, so I guess it's worth it. We might be hit with false positives if the testBackend is not quite stable, but I guess that's a passing phase. So LGTM |
Yeah that's a big hurdle for the fuzzer. Sure, with some help (seeding) it might stumble upon valid rlp once in a while, but it'll make for very inefficient fuzzing. |
|
||
func (d decoder) Decode(val interface{}) error { | ||
buffer := bytes.NewBuffer(d.msg) | ||
s := rlp.NewStream(buffer, uint64(len(d.msg))) | ||
return s.Decode(val) | ||
} | ||
|
||
func (d decoder) Time() time.Time { | ||
return time.Now() | ||
} | ||
|
||
func setup() (*testBackend, *testPeer) { | ||
// Generate some transactions etc. | ||
acc1Key, _ := crypto.HexToECDSA("8a1f9a8f95be41cd7ccb6168179afb4504aefe388d1e14474d32c45c72ce7b7a") | ||
acc2Key, _ := crypto.HexToECDSA("49a7b37aa6f6645917e7b807e9d1c00d4fa71f18343b0d4122a4d2df64dd6fee") |
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.
holiman sent new code style 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.
Sorry, I thought I had already approved this
Adds a protocol handler fuzzer to fuzz the ETH68 protocol handlers
Adds a protocol handler fuzzer to fuzz the ETH68 protocol handlers
Adds a protocol handler fuzzer that will try to fuzz the protocol handlers.
Two points of discussion:
wdyt @holiman