-
Notifications
You must be signed in to change notification settings - Fork 81
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
core: store NEP5 balances separately from account #748
Conversation
Codecov Report
@@ Coverage Diff @@
## master #748 +/- ##
==========================================
- Coverage 65.86% 65.82% -0.05%
==========================================
Files 138 138
Lines 12461 12543 +82
==========================================
+ Hits 8208 8256 +48
- Misses 3854 3887 +33
- Partials 399 400 +1
Continue to review full report at Codecov.
|
Use existing functions to invoke smartcontract's method instead of constructing ad-hoc script.
There is no need to take and unmarshal an account structure only to get it's NEP5 balances.
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.
One thing I think still is missing here is NEP5Balances and NEP5Transfers caching in the cachedDao
. Just take a look at typical blocks like these:
https://neoscan.io/block/233db5a99fd0bb893fd9bb4abee4806ade8a99c64cb8ee3aad9ca2338f8a6e4d
https://neoscan.io/block/5216166
https://neoscan.io/block/4997999
https://neoscan.io/block/4717987
I see at lot of cache hits there.
This is an append-only log which is read only during some RPCs. It is rather slow to get it from base every time we need to append to it. This commit stores all NEP5Transfers in batches, so that only a last batch needs to be unmarshaled during block processing.
Track NEP5-related things separately from account.