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 resubmit checkpoint bug #547

Merged
merged 8 commits into from
Dec 27, 2024
Merged

Fix resubmit checkpoint bug #547

merged 8 commits into from
Dec 27, 2024

Conversation

voidash
Copy link
Contributor

@voidash voidash commented Dec 18, 2024

Description

Since anyone can post inscriptions, a malicious user can resend checkpoint inscription that has already been published and sequencer stops working. This PR fixes that particular bug

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency Update

Notes to Reviewers

Checklist

This

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.

Related Issues

STR-795

@voidash voidash requested review from a team as code owners December 18, 2024 07:41
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.

Project coverage is 57.32%. Comparing base (506fd5c) to head (055793d).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...rates/consensus-logic/src/csm/client_transition.rs 0.00% 22 Missing ⚠️
@@            Coverage Diff             @@
##             main     #547      +/-   ##
==========================================
- Coverage   57.33%   57.32%   -0.02%     
==========================================
  Files         309      309              
  Lines       31510    31509       -1     
==========================================
- Hits        18067    18062       -5     
- Misses      13443    13447       +4     
Files with missing lines Coverage Δ
...rates/consensus-logic/src/csm/client_transition.rs 58.81% <0.00%> (+0.10%) ⬆️

... and 3 files with indirect coverage changes

@delbonis
Copy link
Contributor

delbonis commented Dec 18, 2024

How does this change fix the bug? I would expect that the change would be to check if the epoch is less than or equal to the current finalized epoch then we just ignore it the checkpoint. I don't follow what was changed.

@voidash
Copy link
Contributor Author

voidash commented Dec 19, 2024

How does this change fix the bug? I would expect that the change would be to check if the epoch is less than or equal to the current finalized epoch then we just ignore it the checkpoint. I don't follow what was changed.

There was already a check present in the code. Instead of passing those filtered checkpoints, we were passing the initial checkpoint vector. Changing it to filtered checkpoint fixes the problem

Copy link
Contributor

@bewakes bewakes left a comment

Choose a reason for hiding this comment

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

Some minor comments.

functional-tests/fn_btcio_resubmit_checkpoint.py Outdated Show resolved Hide resolved
functional-tests/fn_btcio_resubmit_checkpoint.py Outdated Show resolved Hide resolved
functional-tests/fn_btcio_resubmit_checkpoint.py Outdated Show resolved Hide resolved
@voidash voidash force-pushed the STR-643-BUG-RESUBMIT-CHECKPOINT branch from 95b5fac to f0ed257 Compare December 22, 2024 11:58
@john-light john-light changed the title Str 643 Fix resubmit checkpoint bug Fix resubmit checkpoint bug Dec 25, 2024
Copy link
Member

@storopoli storopoli left a comment

Choose a reason for hiding this comment

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

ACK 055793d

@storopoli storopoli requested a review from bewakes December 25, 2024 05:47
@voidash voidash added this pull request to the merge queue Dec 27, 2024
Merged via the queue into main with commit 4b4589d Dec 27, 2024
17 of 18 checks passed
@voidash voidash deleted the STR-643-BUG-RESUBMIT-CHECKPOINT branch December 27, 2024 06:23
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