-
Notifications
You must be signed in to change notification settings - Fork 8
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
(VDB-955) Associate diffs with headers #6
Conversation
rmulhol
commented
Nov 21, 2019
- Queue diffs if matching header not found
- Queue diffs if matching header not found
- replaces block number and block hash - make corresponding update to storage transformer
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!
if getHeaderErr != nil { | ||
return 0, getHeaderErr | ||
} | ||
if diff.BlockHash.Hex() != header.Hash { |
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.
Thinking maybe this should convert header.Hash
to a common.Hash
and do this comparison with common.Hash
instead of hex strings so that we don't run into pesky issues around the presence/absence of the 0x
prefix
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.
done d73a988
- When determining equality between diff and db - Prevents false negatives derived from presence/absence of 0x prefix
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.
🚀
) | ||
|
||
type ErrHeaderMismatch struct { |
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.
💯
Eventually(func() utils.StorageDiff { | ||
return mockQueue.AddPassedDiff | ||
}).Should(Equal(csvDiff)) | ||
close(done) |
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.
When I looked at this test quickly it took me a minute to understand why that when execution fails Execute
doesn't isn't expected to return an error. Not sure it's necessary (maybe I should have just looked at the test closer 😜 ) - but do you think it's worth it to test that the transformer execution logged the error?
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.
👍 e5973ea
Not returning an error via Execute
is a bit confusing, but I think it makes sense to continue in most failure scenarios. Definitely up for returning errors if we consider anything other than a fetcher error a showstopper
- verify logging when transformer execution fails
- Verify that rows aren't deleted when parsing queue fails