-
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
Fix incentive for committee #1884
Fix incentive for committee #1884
Conversation
neo/src/neo/Ledger/Blockchain.cs Line 419 in 7032907
Remove this |
No, native contracts have not yet been deployed. |
What about move the incentive logic to neo/src/neo/Ledger/Blockchain.cs Lines 469 to 474 in cb7a327
We can remove the |
I think it's ok. I'll move it. |
Waiting for #1738, I still need one or two days for testing it. |
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.
Waiting for #1738
…o-L/neo into fix_incentive_for_committee
@Tommo-L Please fix the UTs. |
Ok, I'll fix them. |
// Distribute GAS for committee | ||
|
||
int index = (int)(engine.Snapshot.PersistingBlock.Index % (uint)ProtocolSettings.Default.CommitteeMembersCount); | ||
var gasPerBlock = GetGasPerBlock(engine.Snapshot); | ||
var committee = GetCommitteeMembers(engine.Snapshot).ToArray(); | ||
var pubkey = committee.OrderBy(p => p).ElementAt(index); | ||
var pubkey = GetCommittee(engine.Snapshot)[index]; | ||
var account = Contract.CreateSignatureRedeemScript(pubkey).ToScriptHash(); | ||
GAS.Mint(engine, account, gasPerBlock * CommitteeRewardRatio / 100); |
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.
We set nextValidators
before process the transactions and reward the committee after process these transactions, isn't it?
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.
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.
Maybe we should wait for #1907 and reward every epoch (28 blocks)?
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.
Why #1907 is needed?
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.
Not needed, but ig #1907 it's merged, we can reward them every 28 blocks.
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.
we can optimize it later #1884 (comment) after #1907
* fix incentive for committee * fix * Update Blockchain.cs * Update NeoToken.cs * fix ut Co-authored-by: Tommo-L <luchuan@neo.org> Co-authored-by: Shargon <shargon@gmail.com> Co-authored-by: Erik Zhang <erik@neo.org>
* fix incentive for committee * fix * Update Blockchain.cs * Update NeoToken.cs * fix ut Co-authored-by: Tommo-L <luchuan@neo.org> Co-authored-by: Shargon <shargon@gmail.com> Co-authored-by: Erik Zhang <erik@neo.org>
No description provided.