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

[Merged by Bors] - Limit size of ActiveSet in ballot encoding #5965

Closed
wants to merge 5 commits into from

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented May 21, 2024

Motivation

Don't allow a ballot to contain ActiveSet ATXIDs. They are immediately discarded after receiving them but other nodes can still send ballots with a list of ATXIDs attached that is unnecessarily downloaded and decoded before being deleted.

Description

The limit of the slice is changed to 1 (zero isn't allowed by go-scale). So any incoming ballot with more than 1 referenced ATX ID will be considered invalid.

Up until now the node has always deleted the ActiveSet before storing the encoded blob in the DB. To be sure I checked on my local node as well and it didn't have any ballots with ActiveSet containing ATXIDs, so this is safe to do.

Test Plan

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed
  • Update changelog as needed

@fasmat fasmat requested review from dshulyak, poszu and ivan4th as code owners May 21, 2024 14:51
@fasmat
Copy link
Member Author

fasmat commented May 21, 2024

bors merge

@spacemesh-bors
Copy link

Canceled.

@fasmat
Copy link
Member Author

fasmat commented May 21, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request May 21, 2024
## Motivation

Don't allow a ballot to contain `ActiveSet` `ATXID`s. They are immediately discarded after receiving them but other nodes can still send ballots with a list of ATXIDs attached that is unnecessarily downloaded and decoded before being deleted.
@spacemesh-bors
Copy link

Canceled.

@fasmat
Copy link
Member Author

fasmat commented May 21, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request May 21, 2024
## Motivation

Don't allow a ballot to contain `ActiveSet` `ATXID`s. They are immediately discarded after receiving them but other nodes can still send ballots with a list of ATXIDs attached that is unnecessarily downloaded and decoded before being deleted.
@spacemesh-bors
Copy link

Canceled.

@fasmat
Copy link
Member Author

fasmat commented May 21, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request May 21, 2024
## Motivation

Don't allow a ballot to contain `ActiveSet` `ATXID`s. They are immediately discarded after receiving them but other nodes can still send ballots with a list of ATXIDs attached that is unnecessarily downloaded and decoded before being deleted.
Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.8%. Comparing base (25222c1) to head (7b3f807).

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #5965   +/-   ##
=======================================
  Coverage     80.8%   80.8%           
=======================================
  Files          286     286           
  Lines        29722   29714    -8     
=======================================
- Hits         24042   24036    -6     
+ Misses        4116    4115    -1     
+ Partials      1564    1563    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@spacemesh-bors
Copy link

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title Limit size of ActiveSet in ballot encoding [Merged by Bors] - Limit size of ActiveSet in ballot encoding May 21, 2024
@spacemesh-bors spacemesh-bors bot closed this May 21, 2024
@spacemesh-bors spacemesh-bors bot deleted the cleanup-ballots-db branch May 21, 2024 17:12
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.

2 participants