Skip to content

(VDB-955) Associate diffs with headers#6

Merged
rmulhol merged 5 commits intostagingfrom
vdb-955-diff-reorgs
Nov 26, 2019
Merged

(VDB-955) Associate diffs with headers#6
rmulhol merged 5 commits intostagingfrom
vdb-955-diff-reorgs

Conversation

@rmulhol
Copy link
Copy Markdown

@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
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

@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.

🚀

"time"
)

type ErrHeaderMismatch struct {
Copy link
Copy Markdown

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

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

Rob Mulholand added 2 commits November 26, 2019 10:46
- 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

Development

Successfully merging this pull request may close these issues.

3 participants