Alexander Meißner
a6ad37f3ad
Cleanup - `load_and_get_programs_from_cache()` ( #30959 )
...
* Replaces assign_program() by replenish() in load_and_get_programs_from_cache().
* Replaces LoadedProgramEntry by a boolean.
* Only lock the global cache once all missing programs have been loaded
* Factors out call of self.rc.accounts.filter_executable_program_accounts().
2023-03-29 16:11:14 +02:00
Pankaj Garg
aebc191c38
Stop loading program accounts if program exists in cache ( #30703 )
...
* Stop loading program accounts if program exists in cache
* load accounts for upgradeable programs
* revert loader change to conditionally use program data account
* load instruction accounts
* generate TransactionExecutorCache from loaded programs
* cleanup account_found_and_dep_index variable
* address review comments
* handle tombstones in loader
* unify tombstone constructor
* handle multiple tombstones
2023-03-28 11:49:56 -07:00
Pankaj Garg
0df28f6d51
Increment usage count for loaded programs and call eviction ( #30900 )
2023-03-27 06:48:05 -07:00
Tao Zhu
3e500d9e92
Feature gate builtin consumes static units during processing instruction ( #30702 )
...
* add feature gate
* builtins consume statically defined units at beginning of process_instruction()
* Add new instructionError; return error if builtin did not consume units to enforce builtin to consume units;
* updated related tests
* updated ProgramTest with deactivated native_programs_consume_cu feature to continue support existing mock/test programs that do not consume units
2023-03-24 11:31:01 -05:00
Tao Zhu
21c287a64f
include loaded accounts data size limit in transaction fee calculation ( #30659 )
...
* include loaded accounts data size limit in transaction base fee calculation
* citing compute_budget for heap cost;
* update sbf tests
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2023-03-21 18:41:41 -05:00
HaoranYi
d646820a6e
Do not log detailed epoch stakes ( #30825 )
...
* do not log detailed epoch stakes
* allow dead code
* log stake details at trace level
* no need dead_code
* Update runtime/src/bank.rs
Co-authored-by: Brooks <brooks@prumo.org>
---------
Co-authored-by: Brooks <brooks@prumo.org>
2023-03-21 14:43:06 -05:00
Brooks
836494fc5f
Cleans *up to* the last full snapshot slot in verify_snapshot_bank() ( #30818 )
...
Cleans up to the last full snapshot slot in verify_snapshot_bank()
2023-03-21 15:49:49 +00:00
Brooks
989c80342b
Adds plumbing and tests for verify_snapshot_bank() with Incremental Accounts Hash ( #30789 )
2023-03-19 21:44:38 -04:00
Brooks
d3273ba118
Removes unused `ancestors` param from `get_snapshot_storages` ( #30773 )
2023-03-18 17:17:41 -04:00
Ryo Onodera
05ee06814e
Fix wrongly swapped parent slot and block height ( #30744 )
2023-03-17 20:07:52 +09:00
Tao Zhu
17ba051e1f
Revert "add default_cost as mandatory field for Builtin ( #30639 )" ( #30749 )
...
This reverts commit 7b95c8e698
.
2023-03-16 11:21:06 -05:00
Brooks
8be99c1c7d
Verifies incremental accounts hash in verify_accounts_hash_and_lamports ( #30735 )
2023-03-16 09:48:06 -04:00
Brooks
65cd55261a
Makes Bank::get_snapshot_hash() aware of incremental accounts hashes ( #30719 )
2023-03-14 18:03:38 -04:00
Brooks
5e5b7f00a2
Stores capitalization in account hashes map ( #30635 )
2023-03-13 10:50:45 -04:00
Brooks
17b48edd7b
Renames types to be consistent with verify_accounts_hash ( #30674 )
2023-03-10 20:02:14 -05:00
Brooks
63623e4df2
Renames fns to verify_accounts_hash ( #30672 )
2023-03-10 18:11:47 -05:00
Brooks
64f583b37d
Improves logs in bank verification at startup ( #30671 )
...
* Improves logs in bank verification at startup
* pr: should_clean
2023-03-10 21:01:49 +00:00
Tao Zhu
7b95c8e698
add default_cost as mandatory field for Builtin ( #30639 )
...
* add default_cost as mandatory field for Builtin
* updated tests
* set zkp program default to VerifyTransfer CUs
---------
Co-authored-by: Jon Cinque <joncinque@pm.me>
2023-03-10 14:02:24 -06:00
Alessandro Decina
13107b4eb6
Enable JIT in Bank::new_with_config_for_tests() ( #30661 )
...
The most common validator configuration is JIT on, so test that. On
platforms that don't support JIT we'll still fallback on the
interpreter.
2023-03-10 22:52:33 +11:00
Ryo Onodera
0b9c040fcf
Add .codecov.yml with checks disabled ( #30666 )
...
* Add .codecov.yml with checks disabled
* Trigger test-coverage.sh...
2023-03-10 20:11:22 +09:00
Tao Zhu
3b9438fd49
Replace hardcoded loaded accounts size limit with compute budget instruction ( #30506 )
...
1. replace hardcoded loaded accounts data size limit with compute budget instruction;
2. new transaction error for invalid account data size limit
3. test requested limit with combination of features and transactions
2023-03-08 19:41:45 -06:00
Jeff Washington (jwash)
85eaf1e7ab
improve BankCreationFreezingProgress and add tests ( #30513 )
2023-02-27 07:54:08 -08:00
Tao Zhu
9ec5e9b866
refactor to remove additional is_simple_vote check ( #30521 )
2023-02-24 23:49:04 -06:00
Brooks
64c7b401cd
BankIncrementalSnapshotPersistence uses strong accounts hash types ( #30502 )
2023-02-24 18:15:23 -05:00
Tao Zhu
66ea750182
add compute budget instruction to set loaded accounts data size limit ( #30377 )
...
* add compute budget instruction to set accounts data size limit
* changes names to explicitly for loaded accounts data size
2023-02-24 09:27:49 -06:00
Brooks
b7d31e134c
Refactors Accounts::new_from_parent() ( #30475 )
2023-02-23 16:50:51 -05:00
Jeff Washington (jwash)
c032dc2754
add bank progress stats ( #30405 )
...
* add bank progress stats
* handle more bank creation code paths
* use wrapping sub
2023-02-23 06:29:02 -08:00
Pankaj Garg
0e13dcca00
Replenish executor cache eagerly during transaction processing ( #30425 )
2023-02-23 05:13:39 -08:00
Pankaj Garg
b1f5b0d790
Find and load missing programs in LoadedPrograms cache ( #30275 )
...
* Find and load missing programs in LoadedPrograms cache
- filter program accounts in a transaction batch
- filter the accounts that are missing in LoadedPrograms cache
- load the programs before processing the transactions
- unit tests
* address review comments
* fix clippy
* address review comments
* fix test
* fix more tests
2023-02-21 12:53:35 -08:00
Brooks
35328ca63d
Makes AccountsHash an enum ( #30416 )
2023-02-21 15:20:51 -05:00
Pankaj Garg
3a4ba72daf
Remove executors trait and replace with LoadedProgram ( #30348 )
...
* Remove executors trait and replace with LoadedProgram
* fill in deployment slot
* address review comments
* fix clippy warnings
* address review comments
* fix failures caught by sbf tests
2023-02-17 12:47:45 +01:00
HaoranYi
615d1a8b69
Extract BankHashLamportsVerifyConfig ( #30320 )
...
* refactor BankHashLamportsVerifyConfig
* clippy
* comments
* fix bench
2023-02-15 16:03:50 -06:00
Alexander Meißner
6558c8fdc9
Refactor - Delay visibility of program un-/re-/deployment ( #29654 )
...
* Use three separate HashMaps instead of the enum TxBankExecutorCacheDiff.
* Replaces all places which deploy programs by a macro.
* Adds a feature gate.
* Adjust tests.
* Makes undeployment visible immediately.
2023-02-11 11:18:25 +01:00
Brooks
b3c2256799
Refactors a sort's comparator fn ( #30243 )
2023-02-10 15:41:55 -05:00
Brooks
d27c860249
Replaces stable sort with unstable sort ( #30223 )
2023-02-10 09:56:11 -05:00
Ryo Onodera
3e6162e69e
Add address lookup tables to minimized snapshot ( #30158 )
...
* Add address lookup tables to minimized snapshot
* Add comment for future posterity
* Add reference to the issue
* Adjust comment a bit
Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
---------
Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2023-02-10 14:46:02 +09:00
Pankaj Garg
375f9ae41d
LoadedPrograms cache implementation and tests ( #30139 )
2023-02-08 13:24:44 -08:00
HaoranYi
3f913e49fc
refactor rent payment order cmp ( #30132 )
2023-02-07 09:30:48 -06:00
Tyera
a14473eb54
Prevent Rent-reward recipients from ending up RentPaying ( #30130 )
2023-02-06 12:16:36 -07:00
Tao Zhu
4293f11cf1
feature gate to enable compute_budget::request_heap_frame on mainnetBeta ( #30077 )
2023-02-03 09:21:57 -06:00
Brennan
8312141f87
Move bank tests to separate file ( #29912 )
2023-02-02 16:32:22 -08:00
Tao Zhu
090b990e15
remove congestion multiplier from transaction fee calculation ( #29828 )
2023-02-01 16:26:50 -06:00
Jeff Washington (jwash)
1c4e84b8ca
impl default version of contains_multiple_slots ( #30055 )
2023-02-01 13:01:01 -08:00
Brooks
d048a1903f
Splits up AccountsDb::bank_hashes ( #30024 )
2023-02-01 14:32:35 -05:00
Tao Zhu
a5af54669a
Limit loaded data per transaction to a fixed cap ( #29743 )
2023-01-31 22:51:35 -06:00
Jeff Washington (jwash)
5e35823b66
add test_stake_account_consistency_with_rent_epoch_max_feature ( #29915 )
...
* add test_stake_account_consistency_with_rent_epoch_max_feature
* create_stake_account takes id
* use test_case
* reformat panic message
2023-01-27 11:50:33 -08:00
Brooks
867d2581a6
Moves impl of bank_hash_info_at() into hash_internal_state() ( #29913 )
2023-01-25 22:24:51 -05:00
Brooks
655345728b
Use saturating_add_signed() ( #29867 )
2023-01-24 17:07:50 -05:00
Brooks
a06f8e68a5
Tests wait for initial accounts hash verification to complete ( #29840 )
2023-01-24 14:44:39 -05:00
Tyera
b35d173c04
Remove bank_transaction_count_fix logic ( #29695 )
...
* Remove bank_transaction_count_fix logic
* Fix test and add comment
2023-01-22 15:59:35 +08:00