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: implement BEP-333(BNB Chain Fusion) #1003

Merged
merged 28 commits into from
Feb 26, 2024
Merged

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

merged 28 commits into from
Feb 26, 2024

Conversation

j75689
Copy link
Contributor

@j75689 j75689 commented Jan 15, 2024

Description

Implement the functions for the BC-Fusion plan.

The Beacon Chain in the BC-Fusion plan consists of four stages:

  1. FirstSunsetFork - Disable Certain Message Types:
    In this stage, the system will disable specific message types to prevent users from creating additional assets on the Beacon Chain. The following Msgs will be disabled:

    • TimeLockMsg
    • TimeRelockMsg
    • FreezeMsg
    • IssueMsg
    • MintMsg
    • IssueMiniMsg
    • HTLTMsg
    • DepositHTLTMsg
    • MsgSideChainDelegate
    • MsgSideChainRedelegate
    • MsgCreateSideChainValidator
    • MsgCreateSideChainValidatorWithVoteAddr
    • MsgEditSideChainValidator
    • MsgEditSideChainValidatorWithVoteAddr

    MsgSideChainStakeMigration will be enabled to allow users to redelegate tokens to BSC.
    MsgSideChainSubmitProposal will be disabled after the SideChain Total Voting Power falls below 5M BNB.

  2. SecondSunsetFork - Token Refunding:
    During this stage, the system will process token refunds for users who have assets locked on the Beacon Chain. Refunds will be initiated for TimeLock, AtomicSwap, and Delegation on the side chain. MsgSideChainUndelegate on the Beacon Chain will be disabled to prevent undelegation and ensure system efficiency.

  3. FinalSunsetFork - Closure of Cross-Chain Channels:
    This marks the final stage of BC-Fusion. The system will close all cross-chain channels. After the FinalSunsetFork, the system will no longer support cross-chain transactions.

  4. Token Migration:
    After the FinalSunsetFork, users may still have assets on the Beacon Chain. The system will support token migration, allowing users to move their assets to BSC. For detailed instructions, please refer to BEP-299.

Rationale

For the reasoning behind this plan, refer to BEP-333.

Example

n/a

Notable Changes

  • Tokens
  • Staking
  • Governance
  • IBC

j75689 and others added 19 commits November 30, 2023 10:40
* feat: disable msgs

* fix: update dep

* fix: check unlock timelock error

* feat: implement airdrop approval msg

* fix: sign data of AirDropApproval

* fix: enforce the eth address to hex format

* refactor

* fix: remove tokenIndex for airdrop approval

* fix comments

* fix: reuse codes

* fix: enforce recipient address to lower case when signing data to be compatible with the contract

* fix: rename airdrop to token-recover

* fix: update cosmos-sdk

* fix: incorrect behavior for refund swap

* fix: comments

* fix: lint error

* fix: swapIterator
* feat: add Sunset hardfork config

* fix: nil pointer when doing ibc method in endblock
* fix: format refound logs and skip skip the processed swap

* chore: update cosmos-sdk

* chore: update cosmos-sdk

* chore: update cosmos-sdk

* fix: SetLatestProcessedRefundSwapKey out of loop

* chore: update cosmos-sdk

* chore: update cosmos-sdk

* revert: skip processed swap

* chore: update cosmos-sdk

* chore: update cosmos-sdk
* feat: add `MsgSideChainStakeMigration` and `StakeMigrationApp`

* fix review comments

* go mod tidy

* update fee param for `MsgSideChainStakeMigration`

* update go.mod
* chore: update cosmos-sdk to fix refundStake issue

* chore: update cosmos-sdk

* chore: update cosmos-sdk
@hazemdraosha111
Copy link

11

* feat: implement sign-validator-ownership cmd

* fix: add 0x prefix to the sig output
@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 19.37984% with 104 lines in your changes missing coverage. Please review.

Project coverage is 47.87%. Comparing base (dac83b6) to head (019f602).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
plugins/tokens/plugin.go 0.00% 54 Missing ⚠️
app/app.go 52.94% 6 Missing and 2 partials ⚠️
plugins/tokens/swap/handler.go 42.85% 6 Missing and 2 partials ⚠️
plugins/tokens/timelock/handler.go 0.00% 7 Missing ⚠️
plugins/tokens/timelock/keys.go 57.14% 4 Missing and 2 partials ⚠️
plugins/tokens/swap/keeper.go 0.00% 5 Missing ⚠️
app/config/config.go 0.00% 4 Missing ⚠️
plugins/tokens/freeze/handler.go 0.00% 2 Missing and 1 partial ⚠️
plugins/tokens/issue/handler.go 0.00% 2 Missing and 1 partial ⚠️
plugins/tokens/timelock/keeper.go 40.00% 3 Missing ⚠️
... and 2 more

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

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1003      +/-   ##
===========================================
- Coverage    49.08%   47.87%   -1.22%     
===========================================
  Files          127      127              
  Lines        12703    12822     +119     
===========================================
- Hits          6235     6138      -97     
- Misses        6044     6249     +205     
- Partials       424      435      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* chore: update cosmos-sdk

* chore: fix testcase

* fix: remove bep159 ut
@unclezoro unclezoro merged commit 1d1b11e into develop Feb 26, 2024
8 checks passed
unclezoro added a commit that referenced this pull request Feb 28, 2024
feat: implement BEP-333(BNB Chain Fusion) (#1003)
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.

6 participants