-
Notifications
You must be signed in to change notification settings - Fork 570
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
[10] Performance improvement: calling set_subscribe_callback API with false #1338
Comments
The GUI sets this to true via the bitsharesjs ChainStore here: https://github.com/bitshares/bitsharesjs/blob/master/lib/chain/src/ChainStore.js#L163 The consequence for the GUI of being connected to a node with this boolean set to false will be that certain parts of the GUI will go out of sync with the blockchain |
@svk31 setting this to |
For example, for the code mentioned above (https://github.com/bitshares/bitsharesjs/blob/master/lib/chain/src/ChainStore.js#L163), theoretically we can set the parameter to false, after got response, call |
Actually the |
We can't really turn it on or off, set_subscribe_callback is a global call and is only called once, on app initialization. Without the subscribe callback the GUI receives no notification for any objects. Without notify_remove_create, the GUI receives no notification about deleted orders, new orders, new margin positions etc. get_full_account has a per account subscription model that the GUI does make use of. |
I'm not talking about stop calling the whole IMHO, deleted/filled orders, new orders and position changes should be notified if
Once we've sorted out the logic, we can check if there are bugs, and fix them accordingly. So, the approach is straight forward:
|
I agree with your points about how it should ideally work. Setting it to false and seeing what breaks is not as easy as it sounds though, as the changes could be subtle, it can be hard to tell if something doesn't change that should have. As is the GUI depends on that boolean and will break without it. Are you able to make a list of what types of objects are affected by the boolean? By the way the api node spams a lot of stuff that was never asked for just from setting a subscribe call back. I've coded the chainstore to just ignore a lot of it, cutting down on that would certainly help api performance as well. An effort was made in the past to improve it but it's still pretty bad i think. |
@svk31 as the in-code comment quoted in OP, if the boolean is set to true, API server will push every newly created object to the client, no matter whether the client explicitly subscribed, thus the "spamming" as you described. This ticket is for fixing this. The correct way is to set it to false. By setting it to false, API server will only push subscribed data to client; e.g. if you subscribe to an account, changes related to the account will be pushed, including transfers, orders and etc; if you subscribe to a market, changes in that market will be pushed, including new orders, fills, call order updates and etc. This is actually what you want. |
@abitmore do we need to tell nodes to set the boolean to false in combination with our UI work? |
@wmbutler no, we won't ask API servers to do anything. Before UI get fixed, back end should always allow the parameter to be set to |
@svk31 regarding filtering on client side, since the backend uses bloom filter which uses less RAM but naturally has false positives, the server will push a few unsubscribed data to client, so the client still need to do filtering. But that data should be limited to certain data types if set_subscribe_callback is called with |
TODO: revert this commit when this GUI issue is done: bitshares/bitshares-ui#1338
as @svk31 said there were efforts in the past to improve the subscription system but it is still not working properly. i requested test cases in the node side to fix this problem or at least being able to fully understand the limitations. |
Setting the boolean to |
The data pushing might be triggered by something. By default if the boolean is set to
If some data are not expected please submit an issue to bitshares-core, then we can analyse and fix. |
OK, we do use the 2.9.x objects but none of the others are used by the GUI. I've been doing quote a bit of testing with the boolean set to false and it works much better than I expected. Both new/changed margin positions show up correctly, and placing and cancelling orders works fine as well. I'm OK with us setting it to false in staging in the GUI for now, which will allow developers and testers to discover potential issues. Unless we discover something major we can then include it in the 0415 release. |
Since I haven't seen any adverse effects I decided to set the boolean to false already in this 0401 release. If we discover something major we can always hotfix it. |
TODO: revert this commit when this GUI issue is done: bitshares/bitshares-ui#1338
Revert commit b7ae96f as the bitshares/bitshares-ui#1338 is complete
… using get_full_accounts
I'm not sure if this will affect reference wallet: bitshares/bitshares-core#725
Currently no limitation about the second parameter. However, in next bitshares-core release, by default API servers won't allow it to be set to
true
.Please check.
The text was updated successfully, but these errors were encountered: