Commit Graph

251 Commits

Author SHA1 Message Date
Alexander Meißner c9eac2e6a1
Restore aliasing rules in BPF loader. (#27752) 2022-09-13 19:58:19 +02:00
Alexander Meißner 12d2147efa
Adds `IndexOfAccount` type (#27599)
Adds the type `IndexOfAccount`.
2022-09-06 11:31:40 +02:00
Brooks Prumo 757e46c3c7
Set cap for new allocations per transaction (#27385) 2022-08-29 14:30:48 -04:00
Alexander Meißner f76f8d5d41
Bumps solana_rbpf to v0.2.32 (#27059) 2022-08-15 16:04:48 +02:00
Justin Starry f8e9af5f1e
Cap the number of accounts passed to a bpf program ix (#26630)
* Cap the number of accounts passed to a bpf program ix

* update bank abi hash

* fix ci failures
2022-07-20 14:12:43 +02:00
Justin Starry 15d18a03e5
Clean up activated `reduce_required_deploy_balance` feature (#26557)
Clean up activated reduce_required_deploy_balance feature
2022-07-15 16:08:14 +01:00
Justin Starry 8e8c6e60ff
Allow extending upgradeable program data account length (#26386)
* Allow extending upgradeable program data account length

* Add is_writable check

* Fix cargo version

* System program fix, comment, and test

* Switch to u32 for serialized bytes value in ix
2022-07-11 22:46:32 +01:00
Jack May 4563bf40f6
cleanup feature: tx-wide-compute-cap (#26326) 2022-06-29 23:54:45 -07:00
Alexander Meißner c01a8f271e
Prepare built-in program tests to deal with stricter account modification checks (#26314)
* Fixes test_vote_state_withdraw().

* Set is_writable to true where needed.
2022-06-29 19:29:12 +02:00
Alexander Meißner bf9ca9827e
Refactor: instruction account index (#25825)
* Adds methods based on instruction_account_index to InstructionContext.
Removes methods which are based on index_in_instruction.

* Adjusts program-runtime.

* Adjusts runtime.

* Adjusts bpf loader.

* Adjusts built-in programs.

* Adjusts program-test and bpf tests.
2022-06-16 18:46:17 +02:00
Jack May 9fb0e76dc2
cleanup feature; do_support_realloc (#25882) 2022-06-10 15:33:19 -07:00
Jack May 363d8d1539
Bump rBPF (#25593) 2022-06-07 04:45:07 -07:00
Alexander Meißner b4a32f2e8d
Bumps solana_rbpf to v0.2.30 (#25755) 2022-06-03 16:22:23 +02:00
Michael Vines b05c7d91ed Fix derive_partial_eq_without_eq clippy lint 2022-05-22 22:22:21 -07:00
Alexander Meißner 7eae98c6d9
Introduces `Result` return types to mutable accessors of `BorrowedAccount` (#25380)
* Introduces result return types to get_data_mut(), set_data() and set_data_length() of BorrowedAccount.

* Introduces result return types to set_owner(), set_lamports() and set_executable() of BorrowedAccount.
2022-05-21 17:47:09 +02:00
Jack May 851958f77a
Disallow deployment of deprecated _sol_alloc_free syscall (#25179) 2022-05-20 13:19:41 -07:00
Jack May 83c0dd3637
Fix alignment check (#25351) 2022-05-19 15:14:28 -07:00
Jack May 8902a66b20
Revert "Disallow deployment of deprecated _sol_alloc_free syscall (#24986)" (#25170)
This reverts commit 8f1d4c1665.
2022-05-12 17:58:17 -05:00
Justin Starry 68800982ea
Add size_of const fns for upgradeable loader states (#25131) 2022-05-11 22:22:59 +08:00
Jack May 8f1d4c1665
Disallow deployment of deprecated _sol_alloc_free syscall (#24986)
* Disallow deployment of deprecated _sol_alloc_free syscall

* remove cli argument
2022-05-11 05:22:49 +00:00
Jack May 978a806a30
reproduceable loader test artifacts (#24950) 2022-05-03 17:10:28 -07:00
Alexander Meißner 7f987722bf
Bump solana_rbpf to v0.2.28 (#24800) 2022-04-30 10:58:12 +02:00
Jack May 224e0b27a1
Simplify register and bind (#24724)
* Revert "Bumps solana_rbpf to v0.2.27 (#24694)"

This reverts commit f3d27cc400.

* Simplify syscall register and bind (#24546)

* declare syscalls with macro (#24564)
2022-04-28 10:24:42 +02:00
Alexander Meißner f3d27cc400
Bumps solana_rbpf to v0.2.27 (#24694) 2022-04-26 17:58:55 +02:00
Jeff Washington (jwash) 6ff16b1728
revert #24546 (#24647)
* Revert "declare syscalls with macro (#24564)"

38bdb401a3

* Revert "Simplify syscall register and bind (#24546)"

28ed2a9df4

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
2022-04-25 15:37:43 -05:00
Jack May 28ed2a9df4
Simplify syscall register and bind (#24546) 2022-04-21 09:09:07 -07:00
Alexander Meißner 998cdd1c29
Remove `KeyedAccount` in builtin program "BPF loader" (#24381)
* Uses transaction_context.get_key_of_account_at_index() when only the key is needed.

* Uses "!instruction_context.is_signer()" instead of ".signer_key().is_none()".

* Uses instruction_context.get_index_in_transaction() to detect account aliasing.

* Makes sure that there is only one KeyedAccount at a time.
Everywhere except for DeployWithMaxDataLen and Upgrade.

* Makes sure that there is only one KeyedAccount at a time.
In DeployWithMaxDataLen and Upgrade.

* Replaces KeyedAccount by BorrowedAccount.

* Removes unused code.
2022-04-19 11:35:40 +02:00
Brooks Prumo f33ad34531
Add feature_set_override parameter to mock_process_instruction() (#24386) 2022-04-15 13:43:04 -05:00
Jack May 2e0bc89ec4
featurize rejection of callx r10 instructions (#24309) 2022-04-13 11:09:33 -07:00
Jack May 138f04a49f
featurize bpf function hash collision fix (#24262) 2022-04-12 17:52:32 -07:00
Jack May 4ac730944e
Use explicit configuration of RBPF (#24286) 2022-04-12 13:54:39 -07:00
Jack May 8a754d45b3
Singlular syscall context (#24204) 2022-04-11 16:05:09 -07:00
Jack May 85e5b1e902
Bump solana-rbpf to v0.2.25 (#24213) 2022-04-11 10:38:47 -07:00
Alexander Meißner 1b45c509c3
Refactor: Use `InstructionContext::get_instruction_data()` (#24014)
* Adds transaction_context and instruction_context where invoke_context.get_keyed_accounts() is used.

* Use instruction_context.get_instruction_data() instead of an explicit parameter.

* Removes instruction_data parameter from Executor::execute().

* Removes instruction_data parameter from ProcessInstructionWithContext.
2022-04-01 15:48:05 +02:00
Justin Starry cb5e67d327
Use Rent sysvar directly for stake split instruction (#24008)
* Use Rent sysvar directly for stake split ix

* Add feature to gate rent sysvar change

* fix tests

* cargo clippy
2022-03-31 16:46:35 +08:00
Alexander Meißner 83ef3fc53e
Refactor: Remove `KeyedAccount` in bpf_loader helper functions (#23986)
* Replaces KeyedAccount in create_executor().

* Refactors len to write_offset in write_program_data().

* Replaces KeyedAccount in write_program_data().

* Use transaction_context.get_key_of_account_at_index() in process_instruction_common().

* Renames next_first_instruction_account to program_account_index.

* Replaces program KeyedAccount by BorrowedAccount in process_instruction_common().

* Removes _program in process_instruction_common().

* Replaces first_account KeyedAccount by BorrowedAccount in process_instruction_common().

* Moves KeyedAccount lookup inside common_close_account().

* Replaces close_account, recipient_account and authority_account KeyedAccount by BorrowedAccount in common_close_account().
2022-03-30 09:17:55 +02:00
Alexander Meißner 794645d092
Adds check_number_of_instruction_accounts() to all builtin programs except for the address-lookup-table. (#23984) 2022-03-29 19:06:50 +02:00
Alexander Meißner 140c8dd01f
Refactor: Replaces KeyedAccount in_get_sysvar_with_account_check (#23905)
* Replaces all use sites of get_sysvar_with_account_check by get_sysvar_with_account_check2.

* Removes get_sysvar_with_account_check.

* Renames get_sysvar_with_account_check2 to get_sysvar_with_account_check.
2022-03-24 19:30:42 +01:00
Jack May 1f052c6234
disable deprecated BPF loader deploys (#23757) 2022-03-18 14:29:49 -07:00
Alexander Meißner 584ac80b1e
Revert: `KeyedAccount` refactoings in builtin programs (#23649)
* Revert "Replaces KeyedAccount by BorrowedAccount in the BPF loader. (#23056)"

6c56eb9663

* Revert "Replaces `KeyedAccount` by `BorrowedAccount` in `system_instruction_processor`. (#23217)"

ee7e411d68

* Revert "Replaces `KeyedAccount` by `BorrowedAccount` in `nonce_keyed_account`. (#23214)"

1a68f81f89

* Revert "Replaces KeyedAccount by BorrowedAccount in the config processor. (#23302)"

a14c7c37ee

* Revert "Replaces `KeyedAccount` by `BorrowedAccount` in vote processor (#23348)"

e2fa6a0f7a

* Revert "Refactor: Prepare stake_instruction.rs to remove `KeyedAccount`s (#23375)"

ee3fc39f1c
2022-03-16 11:30:01 +01:00
Jack May c68c0e881e
consolidate use-jit flag (#23652) 2022-03-14 15:00:00 -07:00
Jack May ddd9d5a5a5
deny slice indexing (#23565) 2022-03-10 11:48:33 -08:00
Brooks Prumo 3c6840050c
Ensure blocks do not exceed the max accounts data size during Replay Stage (#23422) 2022-03-10 10:24:31 -06:00
Alexander Meißner e23c6ce62b
Increases check_number_of_instruction_accounts() in BPF loader. (#23440) 2022-03-04 14:33:27 +01:00
Jack May e9912744ef
use saturating arithmetic (#23435) 2022-03-02 14:50:16 -08:00
Alexander Meißner 6c56eb9663
Replaces KeyedAccount by BorrowedAccount in the BPF loader. (#23056) 2022-03-01 22:55:26 +01:00
Alexander Meißner da00b39f4f
Cleanup: get_program_key() and get_loader_key() in TransactionContext (#23191)
* Moves TransactionContext::get_program_key() to InstructionContext::get_program_key().

* Removes TransactionContext::get_loader_key().

* Test full program and loader executable account chain in BPF loader.
2022-02-17 10:16:28 +01:00
Alexander Meißner 96c88d1a5e
Bumps solana_rbpf to version v0.2.22 (#22923)
* Bumps solana_rbpf to v0.2.22

* Adjusts vm::Config and feature gates.
2022-02-04 21:17:49 +01:00
Jack May ab02dba96f
Add get_processed_sibling_instruction syscall (#22859) 2022-02-02 16:45:57 -08:00
Jack May 551c24da57
nit: consistent name (#22857) 2022-02-01 07:46:04 +00:00