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

Validator reward with runtime #1152

Merged
merged 7 commits into from
Aug 10, 2019
Merged

Validator reward with runtime #1152

merged 7 commits into from
Aug 10, 2019

Conversation

bowenwang1996
Copy link
Collaborator

Make validator reward work with runtime. Re-enable all runtime tests.

Copy link
Member

@ilblackdragon ilblackdragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legit

chain/epoch_manager/src/lib.rs Outdated Show resolved Hide resolved
chain/epoch_manager/src/lib.rs Outdated Show resolved Hide resolved
chain/epoch_manager/src/lib.rs Outdated Show resolved Hide resolved
chain/epoch_manager/src/lib.rs Show resolved Hide resolved
chain/epoch_manager/src/lib.rs Outdated Show resolved Hide resolved
chain/epoch_manager/src/reward_calculator.rs Outdated Show resolved Hide resolved
}
res
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to have few a test or few.
one interesting edge case - what do we pay validators who were expected to produce 0 blocks?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They will not get paid. There is an explicit check for this.

let (
last_block_hash_prev_epoch,
new_proposals,
let EpochSummary {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why unpack it right away, can just let epoch_summary and use epoch_summary.total_gas_used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise you have problems with partial moves.

chain/epoch_manager/src/types.rs Outdated Show resolved Hide resolved
near/src/runtime.rs Outdated Show resolved Hide resolved
@bowenwang1996 bowenwang1996 merged commit 5863a7c into chunks Aug 10, 2019
@bowenwang1996 bowenwang1996 deleted the validator-reward-2 branch August 10, 2019 21:40
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 this pull request may close these issues.

2 participants