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

feat: add MsgSideChainStakeMigration and StakeMigrationApp #367

Merged
merged 6 commits into from
Jan 6, 2024

Conversation

pythonberg1997
Copy link
Contributor

Description

This pr is to add MsgSideChainStakeMigration and StakeMigrationApp.

Changes

Notable changes:

  • add MsgSideChainStakeMigration and StakeMigrationApp

@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2024

Codecov Report

Merging #367 (77e2b69) into bc-fusion (555f527) will decrease coverage by 0.23%.
The diff coverage is 4.47%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@              Coverage Diff              @@
##           bc-fusion     #367      +/-   ##
=============================================
- Coverage      45.51%   45.29%   -0.23%     
=============================================
  Files            248      249       +1     
  Lines          24449    24569     +120     
=============================================
  Hits           11129    11129              
- Misses         12648    12768     +120     
  Partials         672      672              

x/stake/handler.go Outdated Show resolved Hide resolved
}

// send coins to pegAccount
_, sdkErr = k.BankKeeper.SendCoins(ctx, msg.RefundAddress, sdk.PegAccount, sdk.Coins{ubd.Balance})
Copy link
Collaborator

@unclezoro unclezoro Jan 5, 2024

Choose a reason for hiding this comment

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

There is a special test case here:

  1. user undelegate 1BNB before the hardfork, and it will delay in 7 days.
  2. user undeleagate another 1 BNB after the hardfork

what will happen?
a. step #2 will fail?
b. user get 2 BNB undelegated immediately ?

I think should be a, but can we have a test?

@unclezoro unclezoro merged commit 7565ea7 into bc-fusion Jan 6, 2024
2 checks passed
unclezoro pushed a commit that referenced this pull request Feb 26, 2024
* feat: bc fusion hardfork implementation (#358)

* fix: panic issue when doing refundStake and closeCorssChainChannel (#362)

* fix: handleMsgSideChainUndelegate should not pass prefixCtx

* fix: nil pointer when doing ibc method in endblock

* fix: add logs to sunset fork events and immediate sidechain undelegation (#364)

* fix: revert immediate sidechain undelegation and handle undelegation in endblock (#365)

* fix: disable ClaimMsg after FinalSunsetFork (#366)

* feat: add `MsgSideChainStakeMigration` and `StakeMigrationApp` (#367)

* feat: add `MsgSideChainStakeMigration` and `StakeMigrationApp`

* add missing tag

* fix `handleMsgSideChainStakeMigration`

* fix review comments

* rename `MsgTypeSideChainStakeMigration`

* add fee param for `MsgSideChainStakeMigration`

* fix: add missing register for new msg (#368)

* fix: error within `CreateRawIBCPackageByIdWithFee` (#369)

* fix: decimal for BCFusionStopGovThreshold (#370)

* fix: panic when totally unbound the validator in voting period (#371)

* fix: add missing event (#372)

* fix: wrong json tag (#373)

* fix: add missing tag of relayer fee in `handleMsgSideChainStakeMigration` (#376)

* feat: add IsAutoUnDelegate field to CrossStakeDistributeUndelegatedSynPackage and  prevent too many failed in auto refund (#377)

* feat: add IsAutoUnDelegate field to CrossStakeDistributeUndelegatedSynPackage

* fix: disable undelegate after SecondSunsetFork and prevent too many failed in auto refund

* chore: add more logs

* revert: cross stake changes

* fix: error handling in refund

* fix: transferPackage

* fix: CrossStakeDistributeUndelegatedSynPackageV2

* fix: reset context every time in refund loop (#378)

* fix: do not charge relayerFee for auto cross undelegate after SecondSunsetFork (#379)

* fix: do not charge relayerFee for auto cross undelegate after SecondSunsetFork

* fix: FeeCalculator

* chore: add logs for processed refunding count (#380)

* fix: close mirror, mirrorSync channel after FinalSunsetFork (#382)

* fix: disable MsgEditSideChainValidator after FirstSunsetFork and refine codes (#383)

* fix: change StakeMigrationRelayFee to 0.002BNB (#384)

* fix: appHash mismatch causes by channelsMap (#385)

---------

Co-authored-by: Roshan <[email protected]>
unclezoro added a commit that referenced this pull request Feb 26, 2024
* fix: fix nil validator when publishing message (#356)

* feat: implement BEP-333(BNB Chain Fusion) (#381)

* feat: bc fusion hardfork implementation (#358)

* fix: panic issue when doing refundStake and closeCorssChainChannel (#362)

* fix: handleMsgSideChainUndelegate should not pass prefixCtx

* fix: nil pointer when doing ibc method in endblock

* fix: add logs to sunset fork events and immediate sidechain undelegation (#364)

* fix: revert immediate sidechain undelegation and handle undelegation in endblock (#365)

* fix: disable ClaimMsg after FinalSunsetFork (#366)

* feat: add `MsgSideChainStakeMigration` and `StakeMigrationApp` (#367)

* feat: add `MsgSideChainStakeMigration` and `StakeMigrationApp`

* add missing tag

* fix `handleMsgSideChainStakeMigration`

* fix review comments

* rename `MsgTypeSideChainStakeMigration`

* add fee param for `MsgSideChainStakeMigration`

* fix: add missing register for new msg (#368)

* fix: error within `CreateRawIBCPackageByIdWithFee` (#369)

* fix: decimal for BCFusionStopGovThreshold (#370)

* fix: panic when totally unbound the validator in voting period (#371)

* fix: add missing event (#372)

* fix: wrong json tag (#373)

* fix: add missing tag of relayer fee in `handleMsgSideChainStakeMigration` (#376)

* feat: add IsAutoUnDelegate field to CrossStakeDistributeUndelegatedSynPackage and  prevent too many failed in auto refund (#377)

* feat: add IsAutoUnDelegate field to CrossStakeDistributeUndelegatedSynPackage

* fix: disable undelegate after SecondSunsetFork and prevent too many failed in auto refund

* chore: add more logs

* revert: cross stake changes

* fix: error handling in refund

* fix: transferPackage

* fix: CrossStakeDistributeUndelegatedSynPackageV2

* fix: reset context every time in refund loop (#378)

* fix: do not charge relayerFee for auto cross undelegate after SecondSunsetFork (#379)

* fix: do not charge relayerFee for auto cross undelegate after SecondSunsetFork

* fix: FeeCalculator

* chore: add logs for processed refunding count (#380)

* fix: close mirror, mirrorSync channel after FinalSunsetFork (#382)

* fix: disable MsgEditSideChainValidator after FirstSunsetFork and refine codes (#383)

* fix: change StakeMigrationRelayFee to 0.002BNB (#384)

* fix: appHash mismatch causes by channelsMap (#385)

---------

Co-authored-by: Roshan <[email protected]>

* docs: add change logs for release 0.26.7 (#386)

---------

Co-authored-by: forcodedancing <[email protected]>
Co-authored-by: dylanhuang <[email protected]>
Co-authored-by: Roshan <[email protected]>
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.

4 participants