Skip to content
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

Merged
merged 5 commits into from
Nov 26, 2019
Merged

Conversation

rmulhol
Copy link

@rmulhol 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
Copy link

@Gslaughl Gslaughl left a 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 {
Copy link
Author

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

Copy link
Author

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
Copy link

@elizabethengelman elizabethengelman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

)

type ErrHeaderMismatch struct {

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)

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?

Copy link
Author

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
@rmulhol rmulhol merged commit 949388b into staging Nov 26, 2019
@rmulhol rmulhol deleted the vdb-955-diff-reorgs branch November 26, 2019 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants