-
Notifications
You must be signed in to change notification settings - Fork 668
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
Miscellaneous audit fixes #5155
Conversation
Added a cfg to warn about unused imports in `net/mod.rs`, which exposed a few unused imports that I've removed. I've also updated other parts of the code that had imports that were only used for testing. In those cases, I've updated the import to only be used in `cfg(test)`.
Previously, because `apply_schema_8` is called after things like `apply_schema_9`, this would override the schema version to be 8. Also removed some trailing whitespace.
I've updated the log line to be a `warn`. More investigation needed on whether we should add explicit validation here to the length of the BitVec.
Previously, there were some cases where we'd `panic`, and some where we'd just handle the error with a log. This updates the logic to always panic.
Previously, we'd only allow timestamps _less than_ 15 seconds away, but our docs state that the timestamp can be _no more than_ 15 seconds away.
In `get_nakamoto_staging_blocks_db_version`, in the case of an error, the function would default to version 1, which could cause an overwrite of tables. This updates the function to return the correct highest version, which I've also moved to a constant.
In `net::relay`, there are many cases where we return an error if unable to announce a new Stacks block, but there was one case where the error was ignored. This updates that case to also return an error.
This adds more verbose and explicit logs when the signer is unable to post a block when handling a `BlockPushed` event.
Previously, two different error cases had the same log message. This updates one of them to have a more description message about when the error occurred.
Keep it as "max 15 seconds", and update the documentation comments.
One of my changes seriously messed something up - pretty much every test that touches sortdb is broken. Needs investigation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; just address Brice's comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR implements a few of the smaller items received from an audit. Most of them are pretty trivial (ie improve this logging). Some of them have potential implications for the code's logic, which are worth investigating as a reviewer.
Instead of making a separate PR for each small item, I've bundled them into this single PR. I've added each individual item to a separate commit with (hopefully) a helpful description about what's changed, so I'd recommend going commit-by-commit to review. If there are changes in here that we think need more thought, we can move them into a separate PR.