-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Remove unnecessary unwrap from simulate_transaction_unchecked()
#35375
Conversation
execution_results | ||
.pop() | ||
.unwrap_or(TransactionExecutionResult::NotExecuted( | ||
TransactionError::InvalidProgramForExecution, |
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.
i guess this is about as generic a TransactionError
as we have 🤔
prolly fine for now since this is isolated to simulation
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.
Yeah, the other one we could use was AccountInUse
. Nothing generic otherwise.
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.
Does TransactionExecutionResult::NotExecuted
trigger a replay?
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.
assuming by "replay" you mean that the tx is retryable, no. when a tx makes it to execute, it's getting fees taken and committed in a block. even if it were, this logic is in simulate, which won't be committed anyway
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.
I meant retryable yes. And I forgot that this is simulation and thus a failure is not repeated. So seems alright to me.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #35375 +/- ##
========================================
Coverage 81.7% 81.7%
========================================
Files 834 834
Lines 224299 224819 +520
========================================
+ Hits 183361 183831 +470
- Misses 40938 40988 +50 |
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.
-2 unwrap()
s! 🥳
Backports to the stable branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. |
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
…()` (backport of #35375) (#35397) Remove unnecessary unwrap from `simulate_transaction_unchecked()` (#35375) Remove unnecessary unwrap from simulate_transaction_unchecked() (cherry picked from commit cb260f1) Co-authored-by: Pankaj Garg <[email protected]>
…()` (backport of solana-labs#35375) Remove unnecessary unwrap from `simulate_transaction_unchecked()` (solana-labs#35375) Remove unnecessary unwrap from simulate_transaction_unchecked() (cherry picked from commit cb260f1) Co-authored-by: Pankaj Garg <[email protected]>
…()` (backport of solana-labs#35375) Remove unnecessary unwrap from `simulate_transaction_unchecked()` (solana-labs#35375) Remove unnecessary unwrap from simulate_transaction_unchecked() (cherry picked from commit cb260f1) Co-authored-by: Pankaj Garg <[email protected]>
…()` (backport of solana-labs#35375) Remove unnecessary unwrap from `simulate_transaction_unchecked()` (solana-labs#35375) Remove unnecessary unwrap from simulate_transaction_unchecked() (cherry picked from commit cb260f1) Co-authored-by: Pankaj Garg <[email protected]>
…()` (backport of solana-labs#35375) (#65) Remove unnecessary unwrap from `simulate_transaction_unchecked()` (solana-labs#35375) Remove unnecessary unwrap from simulate_transaction_unchecked() (cherry picked from commit cb260f1) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Changing the defaults for ScanConfig v1.17: ignore mio audit report (solana-labs#76) ci: ignore mio audit v1.17: Display error message while loading geyser plugins (solana-labs#33990) (solana-labs#97) Display error message while laoding geyser plugins (solana-labs#33990) Co-authored-by: galactus <[email protected]> v1.17: Remove unnecessary unwrap from `simulate_transaction_unchecked()` (backport of solana-labs#35375) (solana-labs#65) Remove unnecessary unwrap from `simulate_transaction_unchecked()` (solana-labs#35375) Remove unnecessary unwrap from simulate_transaction_unchecked() (cherry picked from commit cb260f1) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Problem
simulate_transaction_unchecked()
does unnecessaryunwrap()
, that can be handled more gracefully.Summary of Changes
Replace
unwrap()
with better handling.Fixes #