This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
RPC: Add inner instructions to simulate transaction response #34313
Merged
mergify
merged 10 commits into
solana-labs:master
from
buffalojoec:solflare-rpc-simulate
Dec 16, 2023
Merged
RPC: Add inner instructions to simulate transaction response #34313
mergify
merged 10 commits into
solana-labs:master
from
buffalojoec:solflare-rpc-simulate
Dec 16, 2023
Conversation
This file contains 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
buffalojoec
force-pushed
the
solflare-rpc-simulate
branch
3 times, most recently
from
December 5, 2023 16:04
8b59c17
to
573b827
Compare
buffalojoec
force-pushed
the
solflare-rpc-simulate
branch
2 times, most recently
from
December 5, 2023 16:42
b726d73
to
a888af0
Compare
buffalojoec
force-pushed
the
solflare-rpc-simulate
branch
3 times, most recently
from
December 6, 2023 01:05
3c1e30f
to
c24d74f
Compare
buffalojoec
added
the
do-not-close
Add this tag to exempt an issue/PR from being closed by the stalebot
label
Dec 13, 2023
buffalojoec
force-pushed
the
solflare-rpc-simulate
branch
3 times, most recently
from
December 15, 2023 16:32
e974a2a
to
ad2e601
Compare
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.
Looking good! One attribute request, plus adding the conversion helper fn
And CI being happy, ofc
buffalojoec
force-pushed
the
solflare-rpc-simulate
branch
from
December 15, 2023 19:38
ad2e601
to
ddc8144
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #34313 +/- ##
=========================================
- Coverage 81.8% 81.8% -0.1%
=========================================
Files 819 820 +1
Lines 220889 220905 +16
=========================================
- Hits 180845 180782 -63
- Misses 40044 40123 +79 |
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.
r+ one last nit!
Co-authored-by: Tyera <teulberg@gmail.com>
buffalojoec
force-pushed
the
solflare-rpc-simulate
branch
from
December 15, 2023 23:50
fe7c680
to
a405a6c
Compare
CriesofCarrots
added
the
automerge
Merge this Pull Request automatically once CI passes
label
Dec 16, 2023
solana-grimes
removed
the
automerge
Merge this Pull Request automatically once CI passes
label
Dec 16, 2023
😱 New commits were pushed while the automerge label was present. |
CriesofCarrots
approved these changes
Dec 16, 2023
buffalojoec
added
the
automerge
Merge this Pull Request automatically once CI passes
label
Dec 16, 2023
buffalojoec
removed
the
automerge
Merge this Pull Request automatically once CI passes
label
Dec 16, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
Wallets use transaction simulation to notify users about the contents of a transaction before they apply their signature. This is the primary method by which wallets, and potentially other dApps and infrastructure, detect malicious instructions.
Currently, transaction simulation offers the ability to observe the resulting account state for various account keys provided and transaction logs. However, it would provide even more enhanced security for Solana users if transaction simulation also returned the parsed inner instructions of a transaction.
Summary of Changes
The RPC change includes adding an optional parameter -
innerInstructions: bool
- tosimulateTransaction
, and addingjsonParsed
inner instructions to the response type ifinnerInstructions
is provided astrue
. Similar togetTransaction
, if the instruction cannot be parsed withjsonParsed
, it defaults tojson
, where thedata
field is base58 encoded.This change also required the bank to return
inner_instructions
from itssimulate_transaction
method.