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

fix: add bsc chainID to encodeSigHeader when submitting evidence for slashing #897

Merged
merged 6 commits into from
Dec 21, 2022

Conversation

randyahx
Copy link
Contributor

Motivation
In order to prevent malicious behaviour from the validators, slashing has to be implemented as a counter measure. However, a bug in the current implementation is preventing the slashing mechanism from working as intended. Until this is fixed, validators cannot be punished for double signing a block.

Specification
In BSC sealHash is calculated taking into account Chain ID. However encodeSigHeader does not take into account chainID, meaning that sealHash will return an incorrect hash, thus ExtractSignerFromHeader() returns an invalid signer. In BSC header hash is Sealed including chainID, so encodeSigHeader() must include the chain ID.

@unclezoro unclezoro added the r4r ready for review label Dec 21, 2022
@unclezoro unclezoro merged commit dfb43ae into bnb-chain:develop Dec 21, 2022
@unclezoro unclezoro changed the title bep174: add bsc chainID to encodeSigHeader when submitting evidence for slashing fix: add bsc chainID to encodeSigHeader when submitting evidence for slashing Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r4r ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants