-
Notifications
You must be signed in to change notification settings - Fork 128
LINTER PR 6: eliminate usage of unsafe #651
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… for better clarity and maintainability; enable all revive rules in golangci-lint configuration
… vectors - Introduced `validate_memory_size` function to enforce memory limits. - Added `SafeByteSlice` and `SafeUnmanagedVector` to prevent double consumption. - Updated `do_init_cache`, `do_store_code`, and other functions to utilize safe wrappers and perform memory validation. - Created a new file `wasmvm-description.mdc` with project guidelines for Go and Rust development.
- Replaced unsafe calls to `go_error.into_result` with `go_error.into_result_safe` in `api.rs` and `storage.rs` to enhance safety and eliminate unsafe blocks. - Removed `SafeUnmanagedVector` from imports and code where it was unnecessary. - Added a new method `into_result_safe` in `GoError` to ensure safe error handling without risking reuse of error messages.
- Updated `GoIter` and `GoQuerier` implementations to replace unsafe calls to `go_result.into_result` with `go_result.into_result_safe`, enhancing safety in error handling. - This change improves the overall robustness of the Go API by eliminating unsafe blocks in the iterator and querier modules.
- Modified error messages in `iterator_test.go` and `lib_test.go` to provide more specific feedback regarding gas limit and checksum format issues. - Enhanced clarity of error reporting to improve debugging and user experience.
I will make the one with deny.toml into its own PR with only the deny related changes so that we can get these landed. |
closing in favor of #652 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request eliminates usages of unsafe, as many as possible without a full redesign of ffi.
It should be reviewed after #589 which may be broken into sub components to ensure that it is an easy fit.