Skip to content
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

Store initial voter reward data in the NEO balance #2844

Closed
roman-khimov opened this issue Dec 15, 2022 · 4 comments · Fixed by #2892
Closed

Store initial voter reward data in the NEO balance #2844

roman-khimov opened this issue Dec 15, 2022 · 4 comments · Fixed by #2892

Comments

@roman-khimov
Copy link
Member

Implement and test the second option from neo-project/neo#2815 (comment). Unit tests can be omitted for the first iteration, but we need to:

  • perform correctness tests, make a db restore for testnet and mainnet with storage dumps saved on a regular node and on a patched one, then scripts/compare-dumps can be adjusted to only compare GAS balances; obviously we need to have exactly the same balances in the patched version as we have on a regular node
  • do performance tests, run db restore for testnet, mainnet and NeoFS T5 testnet sidechain (without storage dumps) on the same machine with LevelDB/BoltDB and KeepOnlyLatestState enabled/disabled, check for restoration time and the resulting DB size

The expectation is that we would have noticeably smaller DB and better time for NeoFS sidechain, probably better time and about the same size for testnet/mainnet. If that expectation is met, we can propose this change to neo-project/neo and then either complete it as an option (I really expect it to be useful for NeoFS chains) or a proper protocol change (3.7.0/3.8.0).

@roman-khimov
Copy link
Member Author

NeoFS mainnet sidechain can also be tried (it's much longer than T5, so more interesting wrt this problem) after #2848.

@ZhangTao1596
Copy link
Contributor

I'm working on https://github.com/ZhangTao1596/neo/tree/fix-vote-reward. Once it works, I will port to neo-go.

@roman-khimov
Copy link
Member Author

It's OK, I just think that NeoGo is a bit easier to work with, there are more tests there and you can quickly synchronize the chain from dump. But the protocol is the same, we can start with C# implementation, some effects should be visible there as well.

@ZhangTao1596
Copy link
Contributor

I have compared gas balances of neo-project/neo#2841 on Testnet. Now I'm testing neo-go https://github.com/ZhangTao1596/neo-go/tree/optimize-vote-reward

ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Jan 31, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Jan 31, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Feb 1, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Mar 1, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Mar 6, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Mar 23, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Mar 24, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Mar 24, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Mar 28, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Mar 29, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Mar 30, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Mar 31, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Apr 20, 2023
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Apr 20, 2023
Signed-off-by: ZhangTao1596 <zhangtao@ngd.neo.org>
ZhangTao1596 added a commit to ZhangTao1596/neo-go that referenced this issue Apr 20, 2023
Signed-off-by: ZhangTao1596 <zhangtao@ngd.neo.org>
roman-khimov added a commit that referenced this issue Sep 5, 2023
It can be non-zero even if VoteTo is NULL. Fixes state diff with 3.6.0:

  block 41660: value mismatch for key +////xTrvgat3qG/w8hQoD/I4MgUz6rygA==: QQQhAS8hA7yiAAAhAA== vs QQQhAS8hA7yiAAAhB+POSWfBCAE=

Related to #2844.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants