-
Notifications
You must be signed in to change notification settings - Fork 43
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
[R4R] sidechain staking reward distribution #835
Conversation
LGTM |
app/app.go
Outdated
// init new param RewardDistributionBatchSize | ||
newCtx := ctx.WithSideChainKeyPrefix(storePrefix) | ||
params := app.stakeKeeper.GetParams(newCtx) | ||
params.RewardDistributionBatchSize = 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.
params.RewardDistributionBatchSize
has a default value, we can reuse that var. We need adjust the value according to the performance test result.
app/config/config.go
Outdated
@@ -544,6 +546,7 @@ func defaultUpgradeConfig() *UpgradeConfig { | |||
BEP67Height: 1, | |||
BEP70Height: 1, | |||
LaunchBscUpgradeHeight: 1, | |||
BEP128Height: 1, |
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.
Please set it to be MaxInt for the first time launch
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.
Please change the default upgrade height.
* sidechain staking reward distribution
* sidechain staking reward distribution
* sidechain staking reward distribution
* sidechain staking reward distribution
* sidechain staking reward distribution
* sidechain staking reward distribution
* sidechain staking reward distribution
* sidechain staking reward distribution
* sidechain staking reward distribution
* sidechain staking reward distribution
* sidechain staking reward distribution
Description
This pr tries to implement the staking reward distribution mechanism proposed in BEP128 - in short, staking reward will be distributed in normal blocks after breathe blocks.
Be noted, this pr will change the kafka message schema of distribution.
Rationale
As mentioned in BEP128, current reward distribution mechanism leads to a heavy load to breath blocks, and users' transactions/requests could be affected. Meanwhile, it could be also a bottleneck for further evolution of Binance Chain. Thus, we need to fix the issue and it will also benefit the evaluation of Binance Chain.
Example
N/A
Changes
Notable changes:
Preflight checks
make build
)make test
)make integration_test
)Already reviewed by
No
Related issues
No