Commit Graph

330 Commits

Author SHA1 Message Date
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
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
Brooks 0c36e4c82d
Adds stable layout types to pass to the runtime (#30192) 2023-02-16 08:16:25 -05:00
Pankaj Garg a9ad0f2b5a
Code to load a program from its account (#30282) 2023-02-15 09:05:26 -08: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
Alexander Meißner f7dfe8337a
Moves `if use_jit` outside of `#[cfg()]`. (#30202) 2023-02-09 09:14:26 +01:00
Alexander Meißner d387f15587
Refactor - Remove redundant `use_jit` flag from `BpfExecutor` (#30116) 2023-02-07 10:05:54 +01:00
Alexander Meißner dad1610742
Extends `enable_program_redeployment_cooldown` to closing programs (#29981) 2023-02-01 18:07:34 +01:00
Alexander Meißner 9d1a0c52f8
Cleanup - `disable_deprecated_loader` (#29653)
* Removes the gating of disable_deprecated_loader.

* Adds create_program().
Renames create_deprecated_program() -> load_program().
Renames load_and_finalize_deprecated_program() -> load_and_finalize_program().

* Fixes test_sol_alloc_free_no_longer_deployable().
2023-01-14 13:02:10 +01:00
Brennan Watt 830ccb9bff
Fix compile warning for some targets (#29258)
* Fix compile warning for some targets

* Reduce redundant code
2022-12-14 20:40:13 +01:00
Alexander Meißner 721496b900
Feature - Program redeployment cooldown (#29136)
* Registers the feature enable_program_redeployment_cooldown.

* Adds redeployment slot constraint.

* Adds test to assert that closed programs can not be reopened.

* Ensure that program close truncates the account data.

* Adds set_sysvar_for_tests() to SBF program tests.
2022-12-13 22:54:24 +01:00
Alexander Meißner 025b35af40
Cfg disable JIT code on systems where it is not supported (#29208)
Cfg disable JIT code on systems where it is not supported.
2022-12-12 15:29:38 +01:00
Alexander Meißner 013f784e92
Bump solana_rbpf to v0.2.38 (#29137)
* Refactor register_syscalls() => create_loader().

* Bumps solana_rbpf to v0.2.38

* Replaces Config::encrypt_environment_registers by Config::runtime_environment_key.

* Adds pc parameter to MemoryMapping::map()

* Removes debugger from rbpf CLI.

* Adds debugger to rbpf CLI again.

* Renames vm.context_object => vm.env.context_object_pointer.

* Renames SyscallRegistry => BuiltInProgram.
Renames SyscallFunction => BuiltInFunction.
Renames register_syscall_by_name() => register_function_by_name().

* Removes ContextObject from Analysis.

* Renames Config::error_on_syscall_bpf_function_hash_collisions => Config::external_internal_function_hash_collision.
2022-12-12 08:47:09 +01:00
behzad nouri 9524c9dbff patches errors from clippy::uninlined_format_args
https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
2022-12-06 19:32:15 +00:00
Alexander Meißner ff1ff587d1
Bump solana_rbpf to 0.2.36 (#28794)
* Bumps solana_rbpf to v0.2.36

* Removes ThisInstructionMeter.

* Removes one "unsafe" expression.

* Removes redundant call to solana_rbpf:🧝:register_bpf_function().

* Adjusts SyscallFunction and SyscallRegistry.

* Inlines ProgramEnvironment into EbpfVm.

* Refactors trait SyscallConsume into fn consume_compute_meter().

* Inlines ComputeMeter into InvokeContext.

* Removes solana-metrics dependency from bpf_loader.

* Replaces RBPF tracer functionality by the debugger.

* Take compute_units_consumed from execute_program().

* Merges execute_program_interpreted() and execute_program_jit().
2022-11-15 15:21:11 +01:00
Alexander Meißner 4142f42319
Refactor - Move `Executor` in program-runtime crate (#28782)
* Moves CreateMetrics into the program-runtime crate.

* Moves the Executor trait into executor.rs

* Removes the first_instruction_account parameter from Executor::execute().
2022-11-10 21:11:00 +01:00
0xripleys 5de4dd8f9b
Add SetAuthorityChecked instruction to bpf loader (#28424)
* SetAuthorityChecked

* restore old logic for loader

* add more upgrade authority checked test cases

* setBufferAuthority checked tests

* format

* add set_buffer_authority_checked instruction to sdk

* Update transaction-status/src/parse_bpf_loader.rs

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>

* add is_set_authority_checked function

* fix set_buffer_authority_checked sdk instruction

* feature gate setAuthorityChecked

* add bpf loader tests for setAuthorityChecked ixs

* test that you can set to same authority

* allow set_authority_checked to be called via cpi (if feature is enabled)

* fix ci

* fmt

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
Co-authored-by: Justin Starry <justin@solana.com>
2022-11-01 08:34:04 +00:00
Dmitri Makarov 34865d032c chore: update Solana docs and code comments that specify "BPF" to "SBF" 2022-10-31 14:14:25 -04:00
Trent Nelson c68fb5f68d ci: remove stale clippy allows 2022-10-20 11:25:48 -07:00
Alexander Meißner 5aca7df232
Bank::create_executor() (#28474)
* Moves the integration test test_bpf_loader_upgradeable_deploy_with_max_len() from the bpf_loader into the runtime.

* Adds Bank::create_executor().

* Adds a test for Bank::create_executor().
2022-10-19 22:28:57 +02:00
Alexander Meißner 547f07526b
Refactor - create_executor() to be usable outside of bpf_loader (#28369)
* Moves disable_deploy_of_alloc_free_syscall parameter inside create_executor().

* Lets register_syscalls() take &FeatureSet only instead of the entire InvokeContext.

* Uses ic_logger_msg!() instead of ic_msg!() inside create_executor().
Inlines map_ebpf_error().

* Adds register_syscalls_us to executor_metrics::CreateMetrics.

* Moves timings accumulation into executor_metrics::CreateMetrics::submit_datapoint().

* Moves &invoke_context.feature_set into a variable.

* Lets create_executor() return executor_metrics::CreateMetrics via a mutable parameter.

* Dissolves invoke_context parameter in create_executor().

* Pulls assignment of create_executor_metrics.program_id outside of create_executor().

* Makes create_executor() take a byte slice instead of a BorrowedAccount.

* Adds create_executor_from_account().
2022-10-18 10:22:39 +02:00
Alexander Meißner 664339e239
Refactor - executor_cache (#28332)
* Renames CachedExecutors => BankExecutorCache.

* Renames TransactionExecutor => TransactionExecutorCacheEntry.

* Renames TransactionExecutorStatus => TxBankExecutorCacheDiff.

* Adds TransactionExecutorCache.

* Renames the items of TxBankExecutorCacheDiff.
2022-10-12 18:09:03 +02:00
Alexander Meißner 2fc8e533a2
Refactor - Move `executor_cache` to program-runtime crate (#28322)
* Moves CachedExecutors, related structs, consts and tests into the program-runtime crate.

* Moves TransactionExecutor, related enum and type defs into executor_cache mod.
2022-10-10 15:01:41 +02:00
Alessandro Decina f6fee4ac3a
Serialization refactor (#28251)
* Use infallible, unchecked methods to write into the serialization buffer

We serialize in two steps: first we compute the size of the buffer, then
we write into it. Therefore there's no need to check if each individual
write fits the buffer - we know it does we just computed the required
size.

* serialize_parameters: remove extra loop/borrows

Remove one extra loop over accounts to gather account lengths. Also
gather all accounts at once and avoid temporary borrows.

* Move creating MemoryRegions for serialized parameters from create_vm to serialize_parameters

This is in preparation of using multiple MemoryRegions once we land direct account mapping.

* bpf_loader: introduce internal API to build serialization buffer/regions

This is prep work for landing the direct_mapping feature, which maps account
data in their own memory regions.

* serialization: fix after API changes
2022-10-07 07:45:05 +01:00
Alexander Meißner 30b0a13ba9
Bump solana_rbpf to 0.2.34 (#28198)
* Bumps solana_rbpf to 0.2.34

* Removes generic UserError from EbpfError.

* Uses ProgramResult for syscalls.
Removes use sites of the question_mark! macro by wrapping the call method of SyscallObjects.

* Uses InvokeContext as syscall context object directly.

* Replaces bind_syscall_context_object() by a parameter in the constructor.

* Inlines bind_syscall_context_objects() at its only call site.
2022-10-06 20:31:58 +02:00
Alessandro Decina 7469ce7ba1
Bump solana_rbpf to 0.2.33 (#28121) 2022-09-28 19:52:19 +01:00
Alexander Meißner 71aee4fcaf
Feature: Explicitly limit `TransactionContext::instruction_trace_capacity` (#27938)
* Renames instruction_stack_capacity => instruction_stack_capacity.

* Replaces number_of_instructions_at_transaction_level by instruction_trace_capacity.

* Adds MaxInstructionTraceLengthExceeded.

* Adjusts TransactionContext::new() parameter.

* Adds feature gate limit_max_instruction_trace_length.

* Adds test_max_instruction_trace_length().
2022-09-26 10:47:16 +02:00
Justin Starry 108b245e6b
Require program account to be writable in extend program data ix (#27911)
* Require program account to be writable in extend program data ix

* feedback
2022-09-22 12:03:06 +08:00
Alexander Meißner 79f45da7d4
Tests for the patch in #27752 (#27784)
Adds tests for the two account aliasing restrictions of UpgradeableLoaderInstruction::Upgrade which can be triggered.
2022-09-16 10:54:20 +02:00
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
Alexander Meißner bc800a8d5a
Refactor: Unify `SysvarCache` (#22843)
* Unifies SysvarCache filling in the runtime and tests.
Removes new_mock_with_sysvars_and_features()
Removes mock_process_instruction_with_sysvars().
Replaces from_keyed_account() by SysvarCache in vote processor.

* Replaces from_keyed_account() by SysvarCache in BPF loader.
2022-01-31 17:53:50 +01:00
Alexander Meißner aadf4b9b63
Moves InvokeContext::return_data to TransactionContext. (#22411) 2022-01-10 18:26:51 +01:00
Trent Nelson 428575f9ae wrap create executor timings datapoint in a module 2022-01-09 05:01:17 +00:00
Trent Nelson 2f29ff1a3f add excutor creation trace timings 2022-01-08 11:18:37 +00:00
Trent Nelson 72fc6096a0 Use saturating_add_assign macro 2022-01-06 03:56:46 -07:00
Trent Nelson 848b6dfbdd Add metrics for executor creation 2022-01-06 03:56:46 -07:00
Carl Lin b25e4a200b Add execute metrics 2022-01-06 03:56:46 -07:00
Jack May 12e160269e
cache executors on failed transactions (#22308) 2022-01-05 22:09:03 -08:00
Alexander Meißner 73e6038986
Refactor: Remove `KeyedAccount` from program runtime (#22226)
* Makes error handling in BorrowedAccount optional.
Adds BorrowedAccount ::get_rent_epoch().
Exposes InstructionContext::get_index_in_transaction().
Turns accounts and account_keys into pinned boxed slices.

* Introduces "unsafe" to InvokeContext::push().

* Turns &TransactionContext into &mut TransactionContext in InvokeContext.

* Push and pop InstructionContext in InvokeContext.
Makes test_process_cross_program and test_native_invoke symmetric.
Removes the borrow check from test_invoke_context_verify.

* Removes keyed_accounts from prepare_instruction()

* Removes usage of invoke_stack.

* Removes keyed_accounts from program-test.

* Removes caller_write_privileges.

* Removes keyed_accounts from BPF parameter (de-)serialization.
2022-01-03 23:30:56 +01:00
Brooks Prumo 800472ddf5
Add AccountsDataMeter to InvokeContext (#21813) 2021-12-28 05:14:48 -06:00
carllin 37f6777ceb
Increment execution timings on errors as well (#22053) 2021-12-22 15:07:07 -05:00
Alexander Meißner 66fa8f9667
Refactor: Removes `Rc` from `Refcell<AccountSharedData>` in the program-runtime (#21927)
* Removes Rc from Rc<RefCell<AccountSharedData>> in the program-runtime.

* Adjusts tests in bpf_loader, system_instruction_processor, config_processor, vote_instruction and stake_instruction
2021-12-17 14:01:12 +01:00
Jack May 509bcd2e74
Bump rbpf to v0.2.19 (#21880)
* Bump rbpf to v0.2.19

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
2021-12-14 16:51:23 +01:00
Michael Vines b8837c04ec Reformat imports to a consistent style for imports
rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
2021-12-03 09:19:13 -08:00
Alexander Meißner 015250f96c
Feature gates for rbpf v0.2.16 (#21590)
- Adds feature reject_section_virtual_address_file_offset_mismatch.
- Adds feature start_verify_shift32_imm.
- Enables enable_symbol_and_section_labels only in the rbpf-cli.
2021-12-03 15:45:25 +01:00
Alexander Meißner a9d5ef2055
Cleanup: InvokeContext accessors (#21574)
* Removes blockhash accessors from InvokeContext.

* Removes lamports_per_signature accessors from InvokeContext.

* Removes return_data accessors from InvokeContext.

* Removes feature_set accessor from InvokeContext.

* Removes instruction_recorders and instruction_index accessors from InvokeContext.

* Moves get_sysvars() into InvokeContext.

* Removes compute_meter parameter from InvokeContext::new().

* Removes InvokeContext::new_mock_with_sysvars_and_features().

* Removes InvokeContext::update_timing().
2021-12-03 12:15:22 +01:00
Alexander Meißner bfdb775ffc
Unifies ThisInvokeContext and dyn trait InvokeContext. (#21563) 2021-12-02 18:47:16 +01:00
Alexander Meißner c825b0a84d
Fixes invoke_context.get_return_data() shadowing program_id. (#21562) 2021-12-02 13:12:11 +01:00
Alexander Meißner 6330cbcf33
Refactor: Use InvokeContext in all Syscalls (#21545)
* Adds ComputeMeter::mock_set_remaining().

* Adds InvokeContext::get_loader()

* Adds a LogCollector to InvokeContext::new_mock().

* Adds "invoke_context: Rc<RefCell<&'a mut dyn InvokeContext>>,"
to all SyscallObjects.

* Adds LogCollector::get_recorded_content().

* Removes loader_id parameter from bind_syscall_context_objects() and create_vm().
2021-12-02 08:58:02 +01:00
Alexander Meißner b78f5b6032
Refactor: Cleanup InstructionProcessor (#21404)
* Moves create_message(), native_invoke() and process_cross_program_instruction()
from the InstructionProcessor to the InvokeContext so that they can have a useful "self" parameter.

* Moves InstructionProcessor into InvokeContext and Bank.

* Moves ExecuteDetailsTimings into its own file.

* Moves Executor into invoke_context.rs

* Moves PreAccount into its own file.

* impl AbiExample for BuiltinPrograms
2021-12-01 08:54:42 +01:00
Alexander Meißner c9aa7ed5ca
Bumps solana_rbpf to v0.2.16 (#21492) 2021-11-30 16:26:36 +01:00