-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Optimize vote reward data #2841
Conversation
1607216
to
f74638f
Compare
I will fix ut. |
public override void FromStackItem(StackItem stackItem) | ||
{ | ||
base.FromStackItem(stackItem); | ||
Struct @struct = (Struct)stackItem; | ||
BalanceHeight = (uint)@struct[1].GetInteger(); | ||
VoteTo = @struct[2].IsNull ? null : ECPoint.DecodePoint(@struct[2].GetSpan(), ECCurve.Secp256r1); | ||
LastGasPerVote = @struct[3].GetInteger(); |
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 will fork the chain
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.
Yes and no. We'll get a different NEO contract state, true. We may have some problem with getAccountState
method, but that's easy to solve (strip the third struct item, return only the old two ones to stay compatible, we can add getAccountStateV2
that will return everything, but we might as well not do that, I don't see a lot of uses for this data). But anything else will just work: balances, transfer data, GAS calculations, etc. So it looks more like a regular DB resync to me.
The main question though, does it have any effect wrt to the DB resync speed and size? Have you measured this? |
Not yet. I just compare gas balances on Testnet. I will measure db size and resync speed these two days. |
I test data sync on my working laptop with RpcServer, ApplicationLogs, StateService
I expect this patch will sync faster but actually not. I will retest it again on a server and test mainnet. |
Mainnet fullstate leveldb sync compare:
|
@shargon, @devhawk, @erikzhang, @vncoelho, @igormcoelho, I think after all of the testing done by @ZhangTao1596 here and in nspcc-dev/neo-go#2892 we can say that
So, I'd say it's good to go. |
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.
@shargon I think we can move on. |
@shargon may you please review this pr? |
Optimize vote reward data, see also neo-project/neo#2841.
Close #2815
2nd option from #2815 (comment)