* Add failing test
* Add config struct for vote-account creation
* Add create-vote-account ix builders that use CreateVoteAccountConfig
* Test now passes; add case to demonstrate failure after activation
* Deprecate existing ix builders
* Use new builders in solana-cli
* Query feature status to use correct VoteState size in solana-cli
* Fix tests and clippy warnings
* Improve ugly conditional block
* Add find-program-address solana cli command
* clippy
* clippy after rebase
* rename find-program-address -> find-program-derived-address
* rename is_complex_seed -> is_structured_seed
* add validator is_structured_seed to clap-v3-utils
* return CliError::BadParameter for PROGRAM_ID arg in case of incorrect parsing
* improve help for SEEDS arg
* extend About for create-address-with-seed command
* fix SEED help
Dynamic dispatch forces heap allocation and adds extra overhead.
Dynamic casting as in the ones below, lacks compile-time type safety:
https://github.com/solana-labs/solana/blob/eeb622c4e/quic-client/src/lib.rs#L172-L175https://github.com/solana-labs/solana/blob/eeb622c4e/udp-client/src/lib.rs#L52-L55
The commit removes all instances of Any, Box<dyn ...>, and Arc<dyn ...>,
and instead uses generic and associated types.
There are only two protocols QUIC and UDP; and the code which has to
work with both protocols can use a trivial thin enum wrapper.
With respect to connection-cache specifically:
* connection-cache/ConnectionCache is a single protocol cache which
allows to use either QUIC or UDP without any build dependency on the
other protocol.
* client/ConnectionCache is an enum wrapper around both protocols and
can be used in the code which has to work with both QUIC and UDP.
Co-authored-by: Tyera Eulberg <tyera@solana.com>
Removed implementation in client/tpu_client and make it a thin wrapper to forward calls to the backend TpuClient. There is some minor change to coerce the client/ConnectionCache to connection-cache/ConnectionCache.
tpu-client/tpu_connection_cache is refactored out the module and moved to connection-cache/connection_cache and the logic in client/connection_cache is consolidated to connection-cache/connection_cache as well. client/connection_cache only has a thin wrapper which forward calls to connection-cache/connection_cache and deal with constructions of quic/udp connection cache for clients using them both.2.
The TpuConnection is refactored to ClientConnection to make it generic and functions renamed to be proper for other workflows. eg. tpu_addr -> server_addr, send_transaction --> send_data and etc...
The enum dispatch is removed so that we can make the bulk of code of quic and udp agnostic of each other. The client is possible to load quic or udp only into its runtime.
The generic type parameter in the tpu-client/tpu_connection_cache is removed in order to create both quic and udp connection cache and use the object to send transactions with multiple branching when sending data. The generic type parameters and associated types are dropped in other types in order to make the trait "object safe" for this purpose.
I have annotated the code explaining the reasoning and the refactoring source -> destination.
There is no functional changes
bench-tps has been performed for rpc-client, thin-client and tpu-client. And it is found the performance number largely match the ones before the refactoring.
* Move ConnectionCache back to solana-client, and duplicate ThinClient, TpuClient there
* Dedupe thin_client modules
* Dedupe tpu_client modules
* Move TpuClient to TpuConnectionCache
* Move ThinClient to TpuConnectionCache
* Move TpuConnection and quic/udp trait implementations back to solana-client
* Remove enum_dispatch from solana-tpu-client
* Move udp-client to its own crate
* Move quic-client to its own crate
* Bumps solana_rbpf to v0.2.36
* Removes ThisInstructionMeter.
* Removes one "unsafe" expression.
* Removes redundant call to solana_rbpf:🧝:register_bpf_function().
* Adjusts SyscallFunction and SyscallRegistry.
* Inlines ProgramEnvironment into EbpfVm.
* Refactors trait SyscallConsume into fn consume_compute_meter().
* Inlines ComputeMeter into InvokeContext.
* Removes solana-metrics dependency from bpf_loader.
* Replaces RBPF tracer functionality by the debugger.
* Take compute_units_consumed from execute_program().
* Merges execute_program_interpreted() and execute_program_jit().
* Moves disable_deploy_of_alloc_free_syscall parameter inside create_executor().
* Lets register_syscalls() take &FeatureSet only instead of the entire InvokeContext.
* Uses ic_logger_msg!() instead of ic_msg!() inside create_executor().
Inlines map_ebpf_error().
* Adds register_syscalls_us to executor_metrics::CreateMetrics.
* Moves timings accumulation into executor_metrics::CreateMetrics::submit_datapoint().
* Moves &invoke_context.feature_set into a variable.
* Lets create_executor() return executor_metrics::CreateMetrics via a mutable parameter.
* Dissolves invoke_context parameter in create_executor().
* Pulls assignment of create_executor_metrics.program_id outside of create_executor().
* Makes create_executor() take a byte slice instead of a BorrowedAccount.
* Adds create_executor_from_account().
* Bumps solana_rbpf to 0.2.34
* Removes generic UserError from EbpfError.
* Uses ProgramResult for syscalls.
Removes use sites of the question_mark! macro by wrapping the call method of SyscallObjects.
* Uses InvokeContext as syscall context object directly.
* Replaces bind_syscall_context_object() by a parameter in the constructor.
* Inlines bind_syscall_context_objects() at its only call site.
--tpu-enable-udp is introduced. And when this is on, the transaction receive and transaction forward is enabled using udp.
Except for a few tests which was hard-coded sending transactions using udp, most tests are being done with udp based tpu disabled.
* Relax authority signer check for lookup table creation
* cli: support creating lookup tables without authority signer
* add another create lookup table ix function
* improve help message
Update subcommand text to warn deploy deprecated
Update the about text for `solana deploy` to warn this is only for non-upgradeable deploys. Fixes#27228
* add compute-unit-price trait to insert compute_budget instruction to set priorization fee
* add clap arg for compute-unit-price
* add compute-unit-price arg to commands that send transactions
* add and update tests