Current code only returns values which are expired based on the default
timeout. Example from the added unit test:
- value inserted at time 0
- pubkey specific timeout = 1
- default timeout = 3
Then at now = 2, the value is expired, but the function fails to return
the value because it compares with the default timeout.
(cherry picked from commit 57ed4e4657)
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
* Add service to track the most recent optimistically confirmed bank
* Plumb service into ClusterInfoVoteListener and ReplayStage
* Clean up test
* Use OptimisticallyConfirmedBank in RPC
* Remove superfluous notifications from RpcSubscriptions
* Use crossbeam to avoid mpsc recv_timeout panic
* Review comments
* Remove superfluous last_checked_slots, but pass in OptimisticallyConfirmedBank for complete correctness
(cherry picked from commit 89621adca7)
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Add copy-on-write executor cache (#12502)
* Add copy-on-write executor cache
* Add remove_executor function to the bank
(cherry picked from commit 965f653471)
# Conflicts:
# runtime/src/bank.rs
* rebase
Co-authored-by: Jack May <jack@solana.com>
Co-authored-by: Michael Vines <mvines@gmail.com>
* account-decoder: Add string format helpers to UiTokenAmount
(cherry picked from commit bb144bf758)
* cli-output: Add CliTokenAccount type
(cherry picked from commit d95bce2600)
Co-authored-by: Trent Nelson <trent@solana.com>
For crds_gossip_pull, we want to parallelize build_crds_filters, which
requires concurrent writes to bloom filters.
This commit implements a variant of the bloom filter which uses atomics
for its bits vector and so is thread-safe.
(cherry picked from commit bb183938d9)
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
* shards crds values based on their hash prefix (#12187)
filter_crds_values checks every crds filter against every hash value:
https://github.com/solana-labs/solana/blob/ee646aa7/core/src/crds_gossip_pull.rs#L432
which can be inefficient if the filter's bit-mask only matches small
portion of the entire crds table.
This commit shards crds values into separate tables based on shard_bits
first bits of their hash prefix. Given a (mask, mask_bits) filter,
filtering crds can be done by inspecting only relevant shards.
If CrdsFilter.mask_bits <= shard_bits, then precisely only the crds
values which match (mask, mask_bits) bit pattern are traversed.
If CrdsFilter.mask_bits > shard_bits, then approximately only
1/2^shard_bits of crds values are inspected.
Benchmarking on a gce cluster of 20 nodes, I see ~10% improvement in
generate_pull_responses metric, but with larger clusters, crds table and
2^mask_bits are both larger, so the impact should be more significant.
(cherry picked from commit 9b866d79fb)
* bumps indexmap to 1.6.0
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
* Record invoked instructions and store in transaction meta
* Enable cpi recording if transaction sender is some
* Rename invoked to innerInstructions
(cherry picked from commit 6601ec8f26)
Co-authored-by: Justin Starry <justin@solana.com>
* Submit a vote timestamp every vote (#10630)
* Submit a timestamp for every vote
* Submit at most one vote timestamp per second
* Submit a timestamp for every new vote
Co-authored-by: Tyera Eulberg <tyera@solana.com>
* Timestamp first vote (#11856)
* Cache block time in Blockstore (#11955)
* Add blockstore column to cache block times
* Add method to cache block time
* Add service to cache block time
* Update rpc getBlockTime to use new method, and refactor blockstore slightly
* Return block_time with confirmed block, if available
* Add measure and warning to cache-block-time
Co-authored-by: Michael Vines <mvines@gmail.com>
* Add blockstore column to store performance sampling data (#12251)
* Add blockstore column to store performance sampling data
* introduce timer and write performance metrics to blockstore
* introduce getRecentPerformanceSamples rpc
* only run on rpc nodes enabled with transaction history
* add unit tests for get_recent_performance_samples
* remove RpcResponse from rpc call
* refactor to use Instant::now and elapsed for timer
* switch to root bank and ensure not negative subraction
* Add PerfSamples to purge/compaction
* refactor to use Instant::now and elapsed for timer
* switch to root bank and ensure not negative subraction
* remove duplicate constants
Co-authored-by: Tyera Eulberg <tyera@solana.com>
(cherry picked from commit 65a6bfad09)
# Conflicts:
# core/src/validator.rs
# ledger/src/blockstore.rs
* merge cherry pick of 65a6bfad0
Co-authored-by: Josh <josh.hundley@gmail.com>