-
Notifications
You must be signed in to change notification settings - Fork 52
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
fix(validateRunningBalances): Change events we track to perform accounting #987
Conversation
…nting Signed-off-by: nicholaspai <[email protected]>
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.
Nice work. I only have nits for this one which may help prevent some error paths if our numbers are anomylously large.
const excess = Number(excesses[0]); | ||
return excess > 0.05 || excess < -0.05; |
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.
This may be problematic for the edge case that excesses[0]
is too large. It would probably make sense to compare something like:
return excess.abs().gt(fromWei(0.05))
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.
excess
is not a BN, its already been converted from one above
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.
Right, but why are we wrapping the excesses[0]
string in Number
? We could deal with it as a BN
and prevent any overflow issues
Has this been broken for some time, or was this changed in more recent changes? We may want to run this on a fixed interval and flag it into Slack to catch this earlier. |
Various fixes to script:
Signed-off-by: nicholaspai [email protected]