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

Fixes bug where an Ethereum node giving bad answers could break things. #18

Merged
merged 3 commits into from
Jun 16, 2018

Conversation

MicahZoltu
Copy link
Collaborator

@MicahZoltu MicahZoltu commented Jun 14, 2018

This changes the way we announce block/log additions/removals so that we wait until we are sure we can fully synch with the node before doing any announcements. This allows us to rollback when the Ethereum node gives us something weird in response such as a claim that a parent block doesn't exist, or logs that don't line up with the expected block.

Reorders block/log additions/removals. It now guarantees that you'll receive block addition announcements before receiving log addition announcements for that block and you'll receive log removal announcements before receiving block removal announcements for that block.

No longer does console.log when an error occurs, instead calls the optional user provided onError. This cleans up the tests, and also allows the user to do something more useful with errors like track them externally.

Removes deprecated ES5 callback stuff.

@MicahZoltu
Copy link
Collaborator Author

MicahZoltu commented Jun 14, 2018

Fixes #17.

@MicahZoltu
Copy link
Collaborator Author

Pinging @epheph @mohoff @LogvinovLeon to see if anyone wants to review this PR. I currently have the flu so I don't really trust my abilities at the moment and there may be some glaringly obvious problem. If I don't hear from anyone by the time I am feeling better I'll review it myself in a few days (after having forgotten what I have done here today).

@MicahZoltu MicahZoltu force-pushed the micah branch 2 times, most recently from edec057 to 6c42229 Compare June 16, 2018 06:06
This changes the way we announce block/log additions/removals so that we wait until we are sure we can fully synch with the node before doing any announcements.  This allows us to rollback when the Ethereum node gives us something weird in response such as a claim that a parent block doesn't exist, or logs that don't line up with the expected block.

No longer does console.log when an error occurs, instead calls the optional user provided `errorCallback`.  This cleans up the tests, and also allows the user to do something more useful with errors like track them.

Removes deprecated ES5 callback stuff.
Only bumped Chai to 3.5.0 because 4.x broke deep equality checks of Errors.

ts-node support lets us avoid having to compile the tests to the output directory.
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.

1 participant