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 validation for potential slashing evasion during re-delegation #1306

Merged
merged 7 commits into from
Mar 27, 2024

Conversation

ulbqb
Copy link
Member

@ulbqb ulbqb commented Mar 26, 2024

Description

closes: #XXXX

According to the GHSA-86h5-xcpx-cfqc, an issue was identified in the slashing mechanism that may allow for the evasion of slashing penalties during a slashing event. If a delegation contributed to the byzantine behavior of a validator and the validator has not yet been slashed, it may be possible for that delegation to evade a pending slashing penalty through re-delegation behavior.

Additional validation logic was added to restrict this behavior in below commit in cosmos-sdk.
cosmos/cosmos-sdk@d1b5b0c

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

Copy link

codecov bot commented Mar 26, 2024

Codecov Report

Attention: Patch coverage is 6.89655% with 27 lines in your changes are missing coverage. Please review.

Project coverage is 70.41%. Comparing base (e986f03) to head (6afe0d4).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1306      +/-   ##
==========================================
- Coverage   70.42%   70.41%   -0.02%     
==========================================
  Files         643      643              
  Lines       54730    54758      +28     
==========================================
+ Hits        38546    38560      +14     
- Misses      14011    14023      +12     
- Partials     2173     2175       +2     
Files Coverage Δ
simapp/app.go 79.16% <0.00%> (-2.09%) ⬇️
x/staking/keeper/slash.go 63.52% <9.52%> (-7.71%) ⬇️

... and 3 files with indirect coverage changes

@ulbqb ulbqb self-assigned this Mar 26, 2024
@ulbqb ulbqb marked this pull request as ready for review March 26, 2024 09:30
@ulbqb ulbqb requested a review from 170210 March 26, 2024 09:31
tkxkd0159
tkxkd0159 previously approved these changes Mar 26, 2024
jaeseung-bae
jaeseung-bae previously approved these changes Mar 26, 2024
@ulbqb ulbqb dismissed stale reviews from jaeseung-bae and tkxkd0159 via 6afe0d4 March 27, 2024 02:12
@ulbqb ulbqb merged commit 05ff4ea into Finschia:main Mar 27, 2024
37 of 38 checks passed
@ulbqb ulbqb deleted the fix/add_slash_validation branch March 27, 2024 03:16
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.

4 participants