bgufix: Update uncompile_instructions to prevent index out of bounds#245
Merged
dev-jodee merged 1 commit intorelease/feature-freeze-for-auditfrom Oct 29, 2025
Conversation
- Modified `TransactionUtil::new_unsigned_versioned_transaction_resolved` to return a `Result` type, ensuring proper error handling. - Updated various test cases and transaction validation logic to unwrap results, improving robustness and clarity in error management. - Introduced a new utility function `get_account_key_required` in `IxUtils` for safer account key retrieval, enhancing error reporting for missing keys.
Contributor
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to a610995 in 1 minute and 5 seconds. Click for details.
- Reviewed
1000lines of code in6files - Skipped
0files when reviewing. - Skipped posting
4draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. crates/lib/src/validator/transaction_validator.rs:364
- Draft comment:
Consider caching the config value in validate_strict_pricing_with_fee instead of calling get_config() again. This could improve performance by avoiding redundant config fetches. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. crates/lib/src/validator/transaction_validator.rs:311
- Draft comment:
The inner loop in validate_disallowed_accounts iterates over each account in every instruction. Consider using a hash set for disallowed accounts to improve lookup performance if the number of accounts is large. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. crates/lib/src/validator/transaction_validator.rs:149
- Draft comment:
In validate_programs, consider providing additional context in the error message (e.g. which instruction or its index) to aid debugging when a program is not allowed. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. crates/lib/src/validator/transaction_validator.rs:170
- Draft comment:
Ensure that the macros used (validate_system! and validate_spl!) handle all edge cases. A code review of these macro definitions (if not already covered) is recommended to avoid unexpected behavior. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_h3kMO3alCZHfjNrS
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
amilz
approved these changes
Oct 29, 2025
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
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.
TransactionUtil::new_unsigned_versioned_transaction_resolvedto return aResulttype, ensuring proper error handling.get_account_key_requiredinIxUtilsfor safer account key retrieval, enhancing error reporting for missing keys.Important
Improves error handling in transaction processing by returning
ResultinTransactionUtil::new_unsigned_versioned_transaction_resolvedand addingIxUtils::get_account_key_requiredfor safer account key retrieval.TransactionUtil::new_unsigned_versioned_transaction_resolvednow returnsResult, improving error handling.fee.rs,transfer_transaction.rs, andtransaction_validator.rsto unwrap results, enhancing error management.IxUtils::get_account_key_requiredfor safer account key retrieval, improving error reporting for missing keys.IxUtils::uncompile_instructionsto returnResult, ensuring robust error handling.This description was created by
for a610995. You can customize this summary. It will automatically update as commits are pushed.
📊 Unit Test Coverage
Unit Test Coverage: 80.8%
View Detailed Coverage Report