Use num_partitions to find specific stake rewards in partitions (#1677)
* Add helper to find and filter rewards from a slot
* Check feature enabled for desired epoch
* Refactor existing rewards code to support vote-rewards after activation
* Append stake rewards from partitions
* Remove feature deactivation from TestValidator
* Improve comments
* Add comment about retaining feature activation slot logic
* Add custom error and use in getInflationReward
* Review nit
(cherry picked from commit 0496b06f89)
Co-authored-by: Tyera <tyera@anza.xyz>
* SVM: hoist `program_modification_slot` up from bank
* SVM: add `check_program_modification_slot` to processing config
* SVM: hoist `program_match_criteria` up from bank
* SVM: drop `get_program_match_critera` from callbacks
There is often a desire to examine/replay/etc older blocks. If the
blocks are recent enough, they can be pulled from an actively running
node. Otherwise, the blocks must be pulled down from warehouse node
archives. These archives are uploaded on a per-epoch basis so they are
quite large, and can take multiple hours to download and decompress.
With the addition of Entry data to BigTable, blocks can be recreated
from BigTable data. Namely, we can recreate the Entries with proper PoH
and transaction data. We can then shred them such that they are the
same format as blocks that are produced from the cluster.
This change introduces a new command that will read BigTable data and
insert shreds into a local Blockstore. The new command is:
$ agave-ledger-tool bigtable shreds ...
Several important notes about the change:
- Shred for some slot S will not be signed by the actual leader for
slot S. Instead, shreds will be signed with a "dummy" keypair. The
shred signatures does not affect the ability to replay the block.
- Entry PoH data does not go back to genesis in BigTable. This data
could be extracted and uploaded from the existing rocksdb archives;
however, that work is not planned as far as I know. --allow-mock-poh
can be passed to generate filler PoH data. Blocks created with this
flag are replayable by passing --skip-poh-verify to ledger-tool.
- A snapshot will be unpacked to determine items such as the shred
version, tick hash rate and ticks per slot. This snapshot must be in
the same epoch as the requested slots
The bank-hash command in ledger-tool was recently deprecated. However,
the command is used by some of the scripts that coordinate starting up
a fresh cluster. So, the deprecation of bank-hash broke those scripts.
This change fixes the scripts by doing the following:
- Makes --print-bank-hash support --output json
- Updates scripts to install jq on provisioned nodes
- Update remote-node.sh to parse the bank hash from json using jq
* Rename ComputeBudget::max_invoke_stack_height to max_instruction_stack_depth
The new name is consistent with the existing
ComputeBudget::max_instruction_trace_length.
Also expose compute_budget:MAX_INSTRUCTION_DEPTH.
* bpf_loader: use an explicit thread-local pool for stack and heap memory
Use a fixed thread-local pool to hold stack and heap memory. This
mitigates the long standing issue of jemalloc causing TLB shootdowns to
serve such frequent large allocations.
Because we need 1 stack and 1 heap region per instruction, and the
current max instruction nesting is hardcoded to 5, the pre-allocated
size is (MAX_STACK + MAX_HEAP) * 5 * NUM_THREADS. With the current
limits that's about 2.5MB per thread. Note that this is memory that
would eventually get allocated anyway, we're just pre-allocating it now.
* programs/sbf: add test for stack/heap zeroing
Add TEST_STACK_HEAP_ZEROED which tests that stack and heap regions are
zeroed across reuse from the memory pool.
* Adjust replay-related metrics for unified schduler
* Fix grammar
* Don't compute slowest for unified scheduler
* Rename to is_unified_scheduler_enabled
* Hoist uses to top of file
* Conditionally disable replay-slot-end-to-end-stats
* Remove the misleading fairly balanced text
* port join from itertools and use it in program_stubs.rs
* move itertools to dev-dependencies of solana-program
* add comment to join fn
* more concise replacement for join fn
Co-authored-by: Jon C <me@jonc.dev>
* remove join fn
---------
Co-authored-by: Jon C <me@jonc.dev>
* Removes ProgramTest from simulation tests.
* Removes ProgramTest from sysvar syscall tests.
* Workaround for rustc crash caused by 16 byte aligned memcpy.
* Deduplicates test_program_sbf_sanity.
* Moves mem and remaining_compute_units into test_program_sbf_sanity().
* Removes unused dev-dependencies in Cargo.toml.
* Removes crate-type = lib from Cargo.tomls.
* Adds SBF_OUT_DIR env to CI script.
* Adds "sysvar" to build.rs.