* Ledger-tool: only require ledger dir when necessary (#21575)
* Don't canonicalize ledger_path unless ledger_path will be used
* Single use statement
(cherry picked from commit 2b269dbe0e)
# Conflicts:
# ledger-tool/src/main.rs
* Fix conflicts
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
Otherwise getHealth fails if account hashes are not propagated.
(cherry picked from commit 9886366977)
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
For writing tests, it is often desirable to create a certain situation
that would be tedious, or even impossible to create by sending
individual transactions.
For example, a common attack vector on Solana is to create a copy of
some existing account that stores configuration data, but manipulate the
data stored there, and then to call a program and pass in the
manipulated account, instead of the real account.
If one wants to test this, one option is to write a program that you can
call to write arbitrary data into a new account account (and possibly
change its owner), then include that program in the test context, and
send a transaction to call it. This is extremely tedious, and developers
are not going to bother doing it. I myself would rather fork
solana-program-test to add this `set_account` method, than to write that
program. Having a “god mode” method to just write an account, lowers the
barrier to writing comprehensive tests.
A second reason for introducing this method, is defense in depth. There
may be states of the bank that are not reachable *yet* by only sending
transactions, but that you might want to test against either way. For
example, right now, the balance of a stake account cannot decrease
without going through the stake program. But what if Solana were to
introduce slashing in the future, and you want to ensure your program is
robust against decreases in stake account balance? Right now there is no
way to test this, but by introducing this “god mode” to write accounts,
the situation becomes testable.
(cherry picked from commit e7fa412465)
Using dashes prevents the code from building, which is annoying
if you quickly want to test some hack.
With underscore we get the same effect but the code still builds.
(cherry picked from commit 46aed1b7f9)
Co-authored-by: Benno Fünfstück <benno.fuenfstueck@gmail.com>
* bank: factor tx log getter out to method on `TransactionLogCollector`
(cherry picked from commit efedb55705)
# Conflicts:
# runtime/src/bank.rs
* bank: Add failing test for `TransactionLogCollector::get_logs_for_address()`
(cherry picked from commit dafdc15dfe)
# Conflicts:
# runtime/src/bank.rs
* bank: don't panic when getting logs from malformed TransactionLogCollector
(cherry picked from commit e558ad4c71)
* bank: `TransactionLogCollector` - only push address mappings after pushing a log message
(cherry picked from commit 41cc7af7cd)
Co-authored-by: Trent Nelson <trent@solana.com>
* Use max_complete_transaction_status_slot in BigTableUploadService
* Use node root to limit BigTableUploadService
(cherry picked from commit 9e043d2055)
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Moves syscall_registry into the rbpf Executable constructor.
* Adds the reject_unresolved_syscalls flag which is only set when deploying programs via the CLI.
(cherry picked from commit 8d5c04e257)
Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
* Add function for changing thread's nice value
Linux only.
* Add validator option to change niceness of snapshot packager thread
* Add validator option to change niceness of RPC server threads
Fixes https://github.com/solana-labs/solana/issues/14556
* Run `./scripts/cargo-for-all-lock-files.sh tree`