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

LOW-3: Missing input validation #1025

Merged
merged 4 commits into from
Nov 28, 2023
Merged

Conversation

alistair-singh
Copy link
Contributor

Resolves: SNO-753

Extra merkle proof validations from the audit issue are not addressed.

Copy link

codecov bot commented Nov 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a222329) 81.06% compared to head (cd3e57c) 81.08%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1025      +/-   ##
==========================================
+ Coverage   81.06%   81.08%   +0.01%     
==========================================
  Files          52       52              
  Lines        2150     2152       +2     
  Branches       67       68       +1     
==========================================
+ Hits         1743     1745       +2     
  Misses        392      392              
  Partials       15       15              
Flag Coverage Δ
solidity 80.68% <100.00%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@alistair-singh alistair-singh force-pushed the alistair/low-3-missing-validation branch from e37aa1e to db994ef Compare November 27, 2023 12:41
@@ -215,6 +216,9 @@ contract BeefyClient {
ValidatorSet memory _initialValidatorSet,
ValidatorSet memory _nextValidatorSet
) {
if (_nextValidatorSet.id != _initialValidatorSet.id + 1) {
revert InvalidValidatorSetData();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can just revert() here without raising a custom exception. I don't want to add a custom exception InvalidValidatorSetData which may never ever be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 9fd1195.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit, would prefer a string that looks more robotic: invalid-constructor-params

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Quick fix: 87d87cc.

@alistair-singh alistair-singh force-pushed the alistair/low-3-missing-validation branch from 87d87cc to cd3e57c Compare November 28, 2023 10:03
Copy link
Collaborator

@vgeddes vgeddes left a comment

Choose a reason for hiding this comment

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

+1

@alistair-singh alistair-singh merged commit 9d28d96 into main Nov 28, 2023
1 check passed
@alistair-singh alistair-singh deleted the alistair/low-3-missing-validation branch November 28, 2023 18:54
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