* Add AsRef<AccountInfo> for AccountInfo
(cherry picked from commit 930465e67c)
* add test for AsRef
(cherry picked from commit d10e37a829)
Co-authored-by: Kirill Fomichev <fanatid@ya.ru>
* Fixing missing pubsub notification for programSubscribe and logsSubscribe (#19092)
#18587: programSubscribe is missing notifications randomly. The issue is because of two reasons
Not all rooted slots get OptimisticallyConfirmed notifications
The OptimisticallyConfirmed notifications can be out of order for slots: slot A and B with A < B can see notification for B first before A.
Summary of Changes
Changed OptimisticallyConfirmedBankTracker to send notifications for parent banks if they have not been notified yet. We use a new variable last_notified_slot to track that.
Tests:
With my validator running against testnet, before the fix, it was failing 75% of time, with the fix, it is passing consistently. Using the program mentioned in #18587.
(cherry picked from commit 1a372a792e)
* Use v1.7 api
Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
* Handle 0-lamport account in index generation
* rename duplicate to dirty keys
Co-authored-by: Carl Lin <carl@solana.com>
(cherry picked from commit 5a4979f25f)
Co-authored-by: sakridge <sakridge@gmail.com>
* Use last_valid_block_height in services and client apps (#19163)
* Add deprecated tag to Bank::get_blockhash_last_valid_slot
* Update SendTransactionService to use last_valid_block_height
* Update solana-tokens to use last_valid_block_height
* Remove dangling file
* Update solana program to use last_valid_block_height
* Update Banks crates to use last_valid_block_height
(cherry picked from commit 5970083b4d)
# Conflicts:
# cli/src/program.rs
* Fix conflict
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
* Add some docs for RpcClient and friends (#18748)
* Add some docs for RpcSender, HttpSender, MockSender
* Support SimulateTransaction in MockSender
* Add docs for RpcClient constructors
* Add some more RpcClient examples
* rustfmt
* Reflow docs in rpc_client and friends
(cherry picked from commit 5dcfd7ce74)
# Conflicts:
# client/src/mock_sender.rs
* Fix conflicts
Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
* Fix serialization of parameters in RpcClient::get_block_production_with_config (#18998)
Params must be an array or null.
(cherry picked from commit 58f395257b)
# Conflicts:
# client/src/mock_sender.rs
* Fix conflict
Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
* Auto-generate shell completions for solana-cli (issue #8879 and #14005)
Implement `completion` SubCommand for solana-cli, which outputs
completion script to stdout and exits the process. The script generation
handled completely by clap.
In order to implement the generation, one minor design change was
necessary regarding the creation of clap `App`.
Previously: One part of App initialization was in the `app` function,
and some other arguments and subcommands were added later directly in
the `main` function.
Now: The whole construction of App was moved to `get_clap_app` function.
P.S. I wasn't sure if constructing App separately had visual importance,
so both constructing parts are still separate in `base_clap_app` and
`final_clap_app` functions. But they sure could be in one single
function.
* Dereplicode match expr, fix clippy warning.
* Move clap App construction into separate module
Also join two parts of the construction into a single function
* Fix tests
* Apply rustfmt lints
(cherry picked from commit 9d0a937a05)
Co-authored-by: theonekeyg <34949189+theonekeyg@users.noreply.github.com>
* filters crds values in parallel when responding to gossip pull-requests (#18877)
When responding to gossip pull-requests, filter_crds_values takes a lot of time
while holding onto read-lock:
https://github.com/solana-labs/solana/blob/f51d64868/gossip/src/crds_gossip_pull.rs#L509-L566
This commit will filter-crds-values in parallel using rayon thread-pools.
(cherry picked from commit f1198fc6d5)
# Conflicts:
# gossip/src/cluster_info.rs
# gossip/src/crds_gossip_pull.rs
* removes backport merge conflicts
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
* backport new column families from master to 1.6 (#18743)
* backporting bank_hash and program_costs column families from master to 1.6 for rocksdb backward compatibility
* missed a line to allow dead code
* include code for purge
* Exclude stubbed ProgramCosts column from compaction (#18840)
Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
This feature requires clang to support -march=native on M1. Before this change,
cargo build would output a build error when building for aarch64.
(cherry picked from commit 8a9b7f5ef2)
# Conflicts:
# ledger/Cargo.toml
* Refactor account encoding to povide helper w/out querying Bank
* Use new method in get_program_accounts to properly return length err
(cherry picked from commit 3eecb6f4ae)
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>