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 border condition in Snowbridge free consensus Updates #5671

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

claravanstaden
Copy link
Contributor

Description

A fix for a border condition introduced with new feature #5201. A malicious relayer could spam the Ethereum client with sync committee updates that have already been imported for the period. This PR adds a storage item to track the last imported sync committee period, so that subsequent irrelevant updates are not free.

Original PR: Snowfork#172

Integration

Downstream projects are not affected. Relayers will not be able to spam the Ethereum client with irrelevant sync committee updates for free.

Review Notes

Adds a storage item to track the last free sync committee update period, so that duplicate imports are not free.

* illustrates border condition

* adds test payloads

* cleanup

* update comment

* fmt

* shuffle things around

* a few more test checks

* Update bridges/snowbridge/pallets/ethereum-client/src/lib.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
@claravanstaden claravanstaden changed the title Free consensus updates border condition Snowbridge free consensus updates border condition fix Sep 10, 2024
@claravanstaden
Copy link
Contributor Author

@acatangiu may you please add the T15-bridges label. :)

@ggwpez ggwpez added T15-bridges This PR/Issue is related to bridges. A4-needs-backport Pull request must be backported to all maintained releases. labels Sep 10, 2024
@claravanstaden claravanstaden marked this pull request as ready for review September 12, 2024 13:41
@paritytech-review-bot paritytech-review-bot bot requested a review from a team September 12, 2024 13:43
@claravanstaden
Copy link
Contributor Author

@vgeddes @alistair-singh @yrong ready to review. :)

@claravanstaden claravanstaden changed the title Snowbridge free consensus updates border condition fix Fix border condition in Snowbridge free consensus Updates Sep 13, 2024
@acatangiu
Copy link
Contributor

@bkontur @serban300 please review - we also need to backport this fix.

Copy link
Contributor

@franciscoaguirre franciscoaguirre left a comment

Choose a reason for hiding this comment

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

I'd add another check after this that updates with a lower number also are not free

@claravanstaden
Copy link
Contributor Author

I'd add another check after this that updates with a lower number also are not free

@franciscoaguirre do you mean another test check or a check in the light client?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A4-needs-backport Pull request must be backported to all maintained releases. T15-bridges This PR/Issue is related to bridges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants