Skip to content

refactor!: x/slashing missed block window#1

Merged
pr0n00gler merged 3 commits intoneutronfrom
feat/15580-backport
Sep 21, 2023
Merged

refactor!: x/slashing missed block window#1
pr0n00gler merged 3 commits intoneutronfrom
feat/15580-backport

Conversation

@pr0n00gler
Copy link
Copy Markdown
Collaborator

@pr0n00gler pr0n00gler commented Aug 7, 2023

Backport of cosmos#15580 to Cosmos SDK 0.47

// determine if the validator signed the previous block
previous, err := k.GetMissedBlockBitmapValue(ctx, consAddr, index)
if err != nil {
panic(errors.Wrap(err, "failed to get the validator's bitmap value"))

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
// Bitmap value has changed from not missed to missed, so we flip the bit
// and increment the counter.
if err := k.SetMissedBlockBitmapValue(ctx, consAddr, index, true); err != nil {
panic(err)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
// Bitmap value has changed from missed to not missed, so we flip the bit
// and decrement the counter.
if err := k.SetMissedBlockBitmapValue(ctx, consAddr, index, false); err != nil {
panic(err)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
@pr0n00gler pr0n00gler changed the title Feat: 15580 backport refactor!: x/slashing missed block window Aug 7, 2023
…BlockBitmap to keep compatibility for third-party projects
Copy link
Copy Markdown

@NeverHappened NeverHappened left a comment

Choose a reason for hiding this comment

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

Looks same as original PR, nothing bad found!

@pr0n00gler pr0n00gler changed the base branch from releases/v0.47.4 to neutron August 24, 2023 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants