-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add a script that checks consistency between different fetching methods #675
base: master
Are you sure you want to change the base?
Conversation
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.
Awesome!
@@ -0,0 +1,80 @@ | |||
const BatchExchange = artifacts.require("BatchExchange") |
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.
Any reason you chose to write this in JS? I'm assuming its related to missing truffle typings?
@@ -0,0 +1,2 @@ | |||
node_modules | |||
build |
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.
ubernit: missing newline at end of file.
I still don't understand why not query from the block immediately before the first one published since the batch closed. This would have all the information and should have no problems of this type. |
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 looks very nice.
I believe that has some issues with how the contract calculates balances. Don't quote me on this, as I'm not sure, but I think that the batch ID is used to determine if a pending flux should be credited to the balance or not. |
Given the consistency errors we had with the viewers' orderbook functions (e.g #672) this PR is creating a consistency checking script, that compares the results of the BatchExchangeViewer to the traditional (client-filtered) way of fetching orders.
The goal it to run this script against mainnet/rinkeby and get alerted when the responsed don't match.
In order to get consistent results, we need to pin the query on a specify block number (e.g. the last block of when the batch was still open to receive orders for
getOpenOrderbookPaginated
and the first block of when the batch was ready to be solvedgetFinalizedOrderbookPaginated
+ legacy approach).Note, that there is still the small chance of inconsistencies if a solution was submitted in the very first block of the batch being open for solutions (this is very unlikely to happen).
Test Plan
Deploy this script in staging and let it run for the next few hours/days.