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

[EVM-736]: Quorum calculation discrepancy between SC and Edge #1723

Conversation

goran-ethernal
Copy link
Collaborator

@goran-ethernal goran-ethernal commented Jul 14, 2023

Description

Quorum was not calculated correctly according to the IBFT paper. It was calculated by ceiling the 2*totalVotingPower/3. For example, if we have total voting power of 6, where each validator has one token staked, than:

CEILING(2*6/3) = 4 -> 2 faulty -> WRONG
FLOOR(2*6/3) + 1 = 5 -> 1 faulty -> CORRECT

Since Edge Supernets is in release, this is added through a hard fork, called quorumcalcalignment. If chain is deployed from scratch, this fork is enabled by default from 0 block. If supernet is already running on an older version, users need to add quorumcalcalignment fork to genesis.json file, specify a block from which it is active, and restart the nodes.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

@goran-ethernal goran-ethernal requested a review from a team July 14, 2023 12:25
@goran-ethernal goran-ethernal self-assigned this Jul 14, 2023
@goran-ethernal goran-ethernal added the bug fix Functionality that fixes a bug label Jul 14, 2023
@goran-ethernal goran-ethernal marked this pull request as ready for review July 14, 2023 12:50
@goran-ethernal goran-ethernal force-pushed the EVM-736-Quorum-calculation-discrepancy-between-smart-contracts-and-edge branch from 0468341 to 8cd9519 Compare July 17, 2023 08:45
@goran-ethernal goran-ethernal changed the title [EVM-732]: Quorum calculation discrepancy between SC and Edge [EVM-736]: Quorum calculation discrepancy between SC and Edge Jul 18, 2023
chain/params.go Outdated Show resolved Hide resolved
@goran-ethernal goran-ethernal merged commit 01d7791 into develop Jul 20, 2023
@goran-ethernal goran-ethernal deleted the EVM-736-Quorum-calculation-discrepancy-between-smart-contracts-and-edge branch July 20, 2023 09:19
@github-actions github-actions bot locked and limited conversation to collaborators Jul 20, 2023
@goran-ethernal
Copy link
Collaborator Author

Tagging @DannyS03 to document the new fork on Edge that fixes the quorum calculation bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fix Functionality that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants