Skip to content

feat: add new fork block and precompile contract for BEP294 and BEP299#1874

Merged
unclezoro merged 4 commits intobnb-chain:bc-fusionfrom
pythonberg1997:bc-fusion
Nov 30, 2023
Merged

feat: add new fork block and precompile contract for BEP294 and BEP299#1874
unclezoro merged 4 commits intobnb-chain:bc-fusionfrom
pythonberg1997:bc-fusion

Conversation

@pythonberg1997
Copy link
Copy Markdown
Contributor

@pythonberg1997 pythonberg1997 commented Sep 18, 2023

Description

This pr is to support

  • BEP-294: BSC Native Staking after BC Fusion
  • BEP-299: Token Migration after BC Fusion

Rationale

See 4. Motivation in BEP-294, BEP-299,

Changes

Notable changes:

  • add new precompile contract verifyDoubleSignEvidence and secp256k1SignatureRecover
  • add new systemTx to parlia to update validatorSet everyday after the fusion fork
  • add upgrade setting

@pythonberg1997 pythonberg1997 force-pushed the bc-fusion branch 3 times, most recently from 639fe27 to 12214ef Compare October 26, 2023 10:41
@pythonberg1997 pythonberg1997 changed the base branch from master to develop October 26, 2023 10:44
sort.SliceStable(validatorHeap, validatorHeap.Less)
} else {
i := 0
for len(validatorHeap) < int(maxElectedValidators.Int64()) && i < len(allValidators) {
Copy link
Copy Markdown
Contributor

@unclezoro unclezoro Oct 31, 2023

Choose a reason for hiding this comment

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

This is complicated than I think.

Let's simplify it:
we get allVotingPowers slice, heap.init() it, then pop until 1. top maxElectedValidators, or 2. the heap is empty. Each pop item goes to eligibleValidators

@j75689 j75689 changed the title feat: add new fork block and precompile contract for BEP294 feat: add new fork block and precompile contract for BEP294 and BEP299 Nov 10, 2023
@unclezoro unclezoro changed the base branch from develop to bc-fusion November 30, 2023 03:06
@unclezoro unclezoro merged commit 030e416 into bnb-chain:bc-fusion Nov 30, 2023
Copy link
Copy Markdown

@octavio12345300 octavio12345300 left a comment

Choose a reason for hiding this comment

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

gracias

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.

8 participants