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

[framework] Refactor reward rate calculation #7867

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

xindingw
Copy link
Contributor

Description

Why this change?

  • delegation_pool::get_add_stake_fee doesn't consider reward rate change. This could cause problem when yearly reward rate reduction.

Behavior change

  • In stake::on_new_epoch, Reward rate deduction happens after reward distribution on this epoch instead of before.
  • staking_config::get_reward_rate won't abort even after PERIODICAL_REWARD_RATE_DECREASE is enabled. People can always use this function to get the reward rate of the current epoch.

Test Plan

Unit testing/ e2e testing

@xindingw xindingw force-pushed the xinding/fix-delegation-add-stake-fee branch from 38b32fa to 266953e Compare April 20, 2023 00:16
Copy link
Contributor

@movekevin movekevin left a comment

Choose a reason for hiding this comment

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

Awesome!

@xindingw xindingw enabled auto-merge (rebase) April 20, 2023 19:46
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

✅ Forge suite compat success on testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> 266953e9bd19e4fd181466c36a0f99a0a5cb7a9f

Compatibility test results for testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> 266953e9bd19e4fd181466c36a0f99a0a5cb7a9f (PR)
1. Check liveness of validators at old version: testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b
compatibility::simple-validator-upgrade::liveness-check : 7828 TPS, 4891 ms latency, 7500 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: 266953e9bd19e4fd181466c36a0f99a0a5cb7a9f
compatibility::simple-validator-upgrade::single-validator-upgrade : 4301 TPS, 9295 ms latency, 12600 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: 266953e9bd19e4fd181466c36a0f99a0a5cb7a9f
compatibility::simple-validator-upgrade::half-validator-upgrade : 4364 TPS, 9174 ms latency, 12900 ms p99 latency,no expired txns
4. upgrading second batch to new version: 266953e9bd19e4fd181466c36a0f99a0a5cb7a9f
compatibility::simple-validator-upgrade::rest-validator-upgrade : 6271 TPS, 6195 ms latency, 9500 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> 266953e9bd19e4fd181466c36a0f99a0a5cb7a9f passed
Test Ok

@github-actions
Copy link
Contributor

✅ Forge suite land_blocking success on 266953e9bd19e4fd181466c36a0f99a0a5cb7a9f

performance benchmark : 5429 TPS, 7332 ms latency, 10500 ms p99 latency,no expired txns
Test Ok

@github-actions
Copy link
Contributor

✅ Forge suite framework_upgrade success on aptos-node-v1.3.0_3fc3d42b6cfe27460004f9a0326451bcda840a60 ==> 266953e9bd19e4fd181466c36a0f99a0a5cb7a9f

Compatibility test results for aptos-node-v1.3.0_3fc3d42b6cfe27460004f9a0326451bcda840a60 ==> 266953e9bd19e4fd181466c36a0f99a0a5cb7a9f (PR)
Upgrade the nodes to version: 266953e9bd19e4fd181466c36a0f99a0a5cb7a9f
framework_upgrade::framework-upgrade::full-framework-upgrade : 6012 TPS, 6679 ms latency, 14600 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for aptos-node-v1.3.0_3fc3d42b6cfe27460004f9a0326451bcda840a60 ==> 266953e9bd19e4fd181466c36a0f99a0a5cb7a9f passed
Test Ok

@xindingw xindingw merged commit ec7d8f7 into main Apr 20, 2023
@xindingw xindingw deleted the xinding/fix-delegation-add-stake-fee branch April 20, 2023 20:23
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.

3 participants