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

Make Servicechain tx fee hardfork #2018

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

JayChoi1736
Copy link
Contributor

@JayChoi1736 JayChoi1736 commented Nov 1, 2023

Proposed changes

  • Following Fix reward distribution and getRewards API on deferredTxfee = false #1886, this problem can be corrected with a single hard fork for service chains.
  • In formal states, the deferredTxfee problem has been solved in only after MagmaHardfork
  • After this PR, servicechain operator can solve the problem with a single hardfork: ServiceChainTxFeeHardfork (like "serviceChainTxFeeCompatibleBlock":3600 in config),
Test Result
  • Test Setting
    • block reward : 1000000000
    • txFee reward : 5250000000000000
    • policy : simple(=0) or not(=2)
    • test when: before serviceChainTxFeeHardfork, after serviceChainTxFeeHardFork and before MagmaHardfork, and after MagmaHardfork
    • check KlayGetRewards result, and actual balance changes in RewardBase and Proposer account
Policy before PR after PR
not simple 스크린샷 2023-11-06 오후 3 48 12 스크린샷 2023-11-06 오후 4 46 53
simple 스크린샷 2023-11-06 오후 3 48 44 스크린샷 2023-11-06 오후 3 49 00
  • Result Analysis
    • After ServiceChainTxFeeHardfork, txfee goes to only RewardBase, and not duplicated

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

  • Please leave the issue numbers or links related to this PR here.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@JayChoi1736 JayChoi1736 self-assigned this Nov 1, 2023
@@ -505,4 +505,11 @@ var (
Usage: "kip103 contract address",
Aliases: []string{"genesis.hardfork.kip103-contract-address"},
}

serviceChainTxFeeCompatibleBlockNumberFlag = &cli.Int64Flag{
Copy link
Contributor

Choose a reason for hiding this comment

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

Apologies for the delayed input. The current name appears ambiguous in its purpose. Have you considered renaming it for clarity, perhaps as 'servicechain-consensus-rewardfix'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you.
I changes hardfork name to ServiceChainRewardFix in a96d57c
However, I will leave this conversation open to hear the opinions of other reviewers

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.

None yet

2 participants