Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

babe: account for skipped epochs when handling equivocations #13335

Merged

Conversation

andresilva
Copy link
Contributor

When validating an equivocation proof we need to validate a key ownership proof for the validator that committed the offence at a given epoch. The key ownership proof exists in the context of a given session, therefore we must also validate the mapping between an epoch and a session. Normally these are synced (i.e. epoch index == session index), but if epochs are skipped this invariant is broken. This PR adds tracking of skipped epochs so that we can properly validate equivocation proofs after epochs are skipped.

@andresilva andresilva added B0-silent Changes should not be mentioned in any release notes D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. C1-low labels Feb 7, 2023
@andresilva andresilva requested a review from a team February 7, 2023 22:27
@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Feb 7, 2023
@andresilva andresilva added the C1-low PR touches the given topic and has a low impact on builders. label Feb 7, 2023
Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

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

lgtm

frame/babe/src/lib.rs Show resolved Hide resolved
frame/babe/src/lib.rs Show resolved Hide resolved
frame/babe/src/lib.rs Show resolved Hide resolved
@andresilva
Copy link
Contributor Author

bot merge

@paritytech-processbot paritytech-processbot bot merged commit ea4fbcb into master Feb 17, 2023
@paritytech-processbot paritytech-processbot bot deleted the andre/babe-equivocation-handling-skipped-epochs branch February 17, 2023 11:46
rossbulat pushed a commit that referenced this pull request Feb 19, 2023
* babe: account for skipped epochs when handling equivocations

* typos

* babe: enforce epoch index >= session index
rossbulat pushed a commit that referenced this pull request Feb 19, 2023
ltfschoen pushed a commit to ltfschoen/substrate that referenced this pull request Feb 22, 2023
…ech#13335)

* babe: account for skipped epochs when handling equivocations

* typos

* babe: enforce epoch index >= session index
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
…ech#13335)

* babe: account for skipped epochs when handling equivocations

* typos

* babe: enforce epoch index >= session index
Ank4n pushed a commit that referenced this pull request Feb 28, 2023
* babe: account for skipped epochs when handling equivocations

* typos

* babe: enforce epoch index >= session index
ukint-vs pushed a commit to gear-tech/substrate that referenced this pull request Apr 10, 2023
…ech#13335)

* babe: account for skipped epochs when handling equivocations

* typos

* babe: enforce epoch index >= session index
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
…ech#13335)

* babe: account for skipped epochs when handling equivocations

* typos

* babe: enforce epoch index >= session index
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants