-
Notifications
You must be signed in to change notification settings - Fork 14
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
Proposer finalization rewards #1081
Proposer finalization rewards #1081
Conversation
This comment has been minimized.
This comment has been minimized.
Needs rebase. |
32ba35c
to
5be8a8f
Compare
const Dependency<BlockDB> m_block_db; | ||
|
||
CScript GetRewardScript(const CBlockIndex &index) const { | ||
// TODO UNIT-E: implement more efficient reward script retrieval |
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.
If I understood correct, this function will be called on every block in epoch, on every checkpoint. Then, reading blocks from disk is super inefficient. I faced with this when worked on commits and full-sync, on my machine every block read could pause the process for up to 500ms. I suggest avoid disk reading.
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.
@Nizametdinov Is this comment resolved/acted upon?
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.
@scravy I will create an issue when this branch is merged.
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.
Looks good to me, utACK 5be8a8f
if (num_reward_outputs > 1 && !(prev_block.pprev->nStatus & BLOCK_HAVE_DATA)) { | ||
// prev_block is a parent block of the snapshot which was used for ISD. | ||
// We do not have data for the ancestor blocks of prev_block. | ||
// TODO UNIT-E: implement proper validation of finalization rewards after ISD |
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.
I'd like to have an issue for this. It seems that we cannot check if the rewards are being payed to the correct scripts here, correct?
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.
Did we create an issue for this?
@@ -60,7 +60,9 @@ def test_empty_blocks_balance(self, created_money, nodes): | |||
coinstake_tx_id = block_info['tx'][0] | |||
coinstake_tx_info = nodes[node_idx].gettransaction(coinstake_tx_id) | |||
|
|||
created_money += coinstake_tx_info['details'][0]['amount'] | |||
# TODO UNIT-E: gettransaction should not return fees for coinbase transactions |
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.
I would like to have an issue here as well. We don't want to forget this stuff.
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.
Did we create an issue for this?
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 sure, can't find anything.
17ed35d
to
c27f7f3
Compare
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
clang showed the following error: wallet/wallet.cpp:2577:17: error: calling function 'IsLockedCoin' requires holding mutex 'cs_wallet' exclusively [-Werror,-Wthread-safety-analysis] if (IsLockedCoin(entry.first, i)) { ^ Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
cde2613
to
a288d8c
Compare
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
This pull request implements proposer finalization rewards.
The first block of every epoch must contain finalization rewards for the block proposers of the previous epoch. The number of finalization reward outputs equals the epoch length. The scripts to which finalization rewards are sent are taken from the reward (0th) outputs of the previous epoch coinbase transactions. The reward amount must depend on the percentage of votes included in the previous epoch, but this will be implemented in following PRs.
See some additional details in #418.