* Improve program-test process_transaction() speed by reducing sleep duration in banks-server (#20508)
* banks_server: Reduce sleep duration for local server
This speeds up process_transaction_with_commitment_and_context()
and thus most program tests by a lot.
* Plumb tick duration through poh config and signature polling
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
(cherry picked from commit bea181eba9)
# Conflicts:
# banks-server/src/banks_server.rs
# program-test/src/lib.rs
* Fix merge issues
Co-authored-by: Christian Kamm <ckamm@delightful-solutions.de>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
* Add stable_log output when a program is loaded as native code instead of BPF
(cherry picked from commit 34f5020457)
* Add ProgramTest::add_builtin_program()
This permits the unit testing of builtin programs in the ProgramTest environment
(cherry picked from commit 830ca369f1)
Co-authored-by: Michael Vines <mvines@gmail.com>
* stake: Advance `credits_observed` on activation epoch (#19309)
* stake: Advance `credits_observed` on activation epoch
* Add test for merging stakes just after activation
(cherry picked from commit 2c3bdedea3)
# Conflicts:
# runtime/src/bank.rs
* Fix merge issues
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
* stake: Remove v2 program references (#19308)
* stake: Remove v2 program references
* Remove stake v2 feature, along with stake rewrite
(cherry picked from commit 73aa004c59)
# Conflicts:
# runtime/src/bank.rs
* Fix merge conflict
* Fix uses of old `stake` function
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
* Refactoring: Unify account_deps and accounts (#17898)
* Changes ThisInvokeContext::get_account() to use accounts instead of pre_accounts.
* Adds explicit keys to accounts to make them symmetric to account_deps.
* Appends account_deps to accounts in transaction loading and removes account_deps everywhere else.
(cherry picked from commit 7462c27d07)
# Conflicts:
# program-test/src/lib.rs
# runtime/src/bank.rs
# runtime/src/message_processor.rs
* fix conflicts
Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
Co-authored-by: Justin Starry <justin@solana.com>
* Refactor stake program into solana_program (#17906)
* Move stake state / instructions into solana_program
* Update account-decoder
* Update cli and runtime
* Update all other parts
* Commit Cargo.lock changes in programs/bpf
* Update cli stake instruction import
* Allow integer arithmetic
* Update ABI digest
* Bump rust mem instruction count
* Remove useless structs
* Move stake::id() -> stake::program::id()
* Re-export from solana_sdk and mark deprecated
* Address feedback
* Run cargo fmt
* Run cargo fmt post cherry-pick
* document ProgramTest::new
* simplify ProgramTest::new doc-string
* make ProgramTest::add_program noisier
`add_program` (and `new`, implicitly) now prints a warning when the user
supplies a bogus program name to a ProgramTest and invokes `test-bpf`.
Additionally, it is now impossible to ask for a regular `test` and for
the generated ProgramTest to load BPF code instead of native code.
Previously, this was caused by a precedence issue: BPF code would always
be preferred over native if the program name was valid, regardless of
user choice.
(cherry picked from commit 2aaf55795f)
Co-authored-by: xuoe <alex@psi.io>
* Replace RootsTracker HashSet
* use bitvec
* cleanup, add brenchmark test
* test cleanup
* add lots of tests
* get rid of demo
* change warp test constant
* get rid of unused function
* pr feedback
* reorder use
* rework get_all to remove range checks
* add tests, fix bugs