-
Notifications
You must be signed in to change notification settings - Fork 198
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
Return parsed token accounts in simulateBundle #600
base: master
Are you sure you want to change the base?
Return parsed token accounts in simulateBundle #600
Conversation
* Add GHA to close new issues with a comment * Remove trailing whitespace
Add github action to close new pull requests with a comment directing them to agave
* ci: add upload-gcs-artifact * ci: publish release binaries to GCS * ci: redirect github repo to anza-xyz * ci: publish windows binaries to GCS * replace release.solana.com with release.anza.xyz * use a explicit name for credential
* Update README.md * ci: update CodeCov report link * ci: update github pr link * ci: rename secondary pipeline * replace org name in .mergify * update channel info link * update dependabot pr link * use anza docker image * delete travis --------- Co-authored-by: Will Hickey <[email protected]>
* ci: fix windows build * ci: publish sdk docker image with the new name * update automerge status
…foundation#9) ci: removed unused s3 upload in Windows build
* rename geyser-plugin-interface * rename cargo registry * rename watchtower * rename ledger tool * rename validator * rename install * rename geyser plugin interface when patch
jito-foundation#69) * Make inactive_stake consistent * Add rpc_deprecated_v1_18 module * Move get_stake_activation to deprecated list * Fix typo
This reverts commit 3f9a7a5.
jito-foundation#9)" This reverts commit 91e3dd2.
This reverts commit 58e9a19.
This reverts commit b0022d7.
This reverts commit 9355518.
Signed-off-by: gcmutator <[email protected]>
This reverts commit 556a749.
When viewing in various tools such as gdb and perf, it is not easy to distinguish which threads are serving which function (TPU or TPU FWD)
- solTvuFetchPmod ==> solTvuPktMod + solTvuRepPktMod - solSigVerifier ==> solSigVerTpu + solSigVerTpuVot
* Simplify vote-authority display * Add handling for new vote authority * Add proper None handling, because unit test (shouldn't happen IRL, though) * Unwrap->expect
* assert simple vote tx const cost
… against a constant instead of VecDeque::capacity() (jito-foundation#587)
… slack during any failures or success.
Fixes the following bugs in the periodic rebase: Sends multiple messages on failure instead of one Cancels entire job if one branch fails
… of #600) (#614) * Show staked vs nonstaked packets sent down/throttled (#600) * Show staked vs nonstaked packets sent down * add metrics on throttled staked vs non-staked (cherry picked from commit b443cfb) # Conflicts: # streamer/src/quic.rs * fix merge conflicts --------- Co-authored-by: Lijun Wang <[email protected]> Co-authored-by: HaoranYi <[email protected]>
… of #600) (#613) * Show staked vs nonstaked packets sent down/throttled (#600) * Show staked vs nonstaked packets sent down * add metrics on throttled staked vs non-staked (cherry picked from commit b443cfb) # Conflicts: # streamer/src/quic.rs * fix merge conflicts --------- Co-authored-by: Lijun Wang <[email protected]> Co-authored-by: HaoranYi <[email protected]>
299676f
to
0c8aca0
Compare
rpc/src/rpc.rs
Outdated
pre_tx_accounts, | ||
account_encoding, | ||
bank, | ||
Some(&account_overrides), |
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.
do you need to use account overrides here? you should have access to the accounts in the execution results
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.
It comes from the post accounts, but needs to be converted to the shape get_encoded_account
expects, which is exactly your AccountOverrides
type. Upstream doesn't have that type, but it's the same shape.
Are you suggesting writing a version of get_encoded_account
that takes the Jito post_accounts: Vec<(Pubkey, AccountSharedData)>
directly? I thought it'd be a smaller change to re-use get_encoded_account
from upstream by reshaping the post_accounts
to match it.
I think I'd also need to write upsert logic to combine the outputs of the transactions in the bundle since we encode the accounts after each transaction and not just at the end. I thought it was better to re-use AccountOverrides::upsert_account_overrides
instead of writing custom logic for that.
* Show staked vs nonstaked packets sent down * add metrics on throttled staked vs non-staked
7bc716a
to
b8605f2
Compare
6a0aa5b
to
8d53d7b
Compare
Rewrite of #592 on latest master
Problem
If you call
simulateBundle
and pass a token account inpre/postExecutionAccountsConfigs
, then the token accounts are never returned in JSON. You will always get the base64 encoded data.This is caused by attempting to encode the data without fetching the number of decimals for the mint, which causes a fallback to base64 data.
This was fixed for
simulateTransaction
upstream, butsimulateBundle
has the same issue.Upstream issue (with more details of the code path causing this): solana-labs/solana#34693
Upstream fix to
simulateTransaction
: solana-labs/solana#34619Summary of Changes
The changes are based on the upstream changes in
simulateTransaction
.Instead of directly encoding the post-account data, we call
get_encoded_account
(added in the upstream PR), which will correctly parse a token account. As this function was written for transaction post-accounts it also takesoverwrite_accounts: Option<&HashMap<Pubkey, AccountSharedData>>
, so that account state can be overridden if a transaction has changed it.In order to provide this, we now maintain a
AccountOverrides
object inrpc_bundle_result_from_bank_result
. This is the same data structure, but has some useful helper functions and I think makes sense to use here. After each transaction, this is updated (usingupsert_account_overrides
) with thepost_accounts
from the transaction. This is then passed when we encode the post-accounts for that transaction.The result is that
rpc_bundle_result_from_bank_result
(and thesimulateBundle
RPC call) now correctly JSON encodes token accounts, using data from the transactions, or the bank if required.End-to-end test on localhost
Build this branch:
cargo build
Create a directory
/Users/username/scratch/solana-validator-tokens
with the following files:wallet.json
token-mint.json
receive-token.json
send-token.json
Run the local validator:
./target/debug/solana-test-validator --account-dir /Users/username/scratch/solana-validator-tokens
Run the following
curl
command:curl command
Or, just the JSON RPC body
You'll get back JSON parsed details for the token accounts, before and after.
If you do the same on the current
master
branch then you'll get base64 encoded token accounts.Note that
simulateTransaction
works correctly because my equivalent upstream fix is already merged into Jito.