Commit Graph

330 Commits

Author SHA1 Message Date
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
Alexander Meißner 22a2537aac
Refactor: Cleanup program-runtime dyn Traits (#21395)
* Unifies dyn Trait ComputeMeter, ThisComputeMeter and TransactionComputeMeter.

* Unifies dyn Trait Logger and ThisLogger.

* Moves Logger to log_collector.rs

* Unifies Logger and LogCollector.

* Removes inner RefCell from LogCollector.

* Adds the log::debug!() message to ic_logger_msg!() again.
2021-11-23 13:23:40 +01:00
Alexander Meißner e540b1cf3c
Refactor: Move sdk::process_instruction in program-runtime-crate (#21180)
* Moves the Executor dyn Trait to instruction_processor.rs

* Moves the Logger dyn Trait as well as the ic_msg and ic_logger_msg macros to log_collector.rs,
and moves the stable_log to stable_log.rs

* Moves the ComputeMeter dyn Trait to invoke_context.rs

* Moves the InvokeContext dyn Trait and the ProcessInstructionWithContext type to invoke_context.rs

* Updates cargo files.

* Re-export InvokeContext in program-test

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-11-17 19:35:07 +01:00
Alexander Meißner 0661aa67ed
Adds a feature gate to reject the deployment of programs with unresolved syscall symbols. (#21298) 2021-11-16 18:21:16 +01:00
Alexander Meißner 7200c5106e
Replaces MockInvokeContext by ThisInvokeContext in tests (#20881)
* Replaces MockInvokeContext by ThisInvokeContext in BpfLoader, SystemInstructionProcessor, CLIs, ConfigProcessor, StakeProcessor and VoteProcessor.

* Finally, removes MockInvokeContext, MockComputeMeter and MockLogger.

* Adjusts assert_instruction_count test.

* Moves ThisInvokeContext to the program-runtime crate.
2021-11-04 21:47:32 +01:00
Jack May 4aa12a52b6
Feature cleanup (#21038) 2021-10-28 09:04:03 -07:00
Alexander Meißner e7c9b9329d
Fixes a bug in MockInvokeContext::get_compute_meter() and adjusts the test assert_instruction_count accordingly. (#20854)
The get_compute_meter() method created a reference to a clone instead of cloning the reference.
2021-10-22 09:46:47 +02:00
Jack May 58164517e4
Add program heap bump instruction (#20607) 2021-10-19 21:01:39 -07:00
Alexander Meißner 8955c76d24
Adds test coverage for #20669 (#20690) 2021-10-18 09:55:31 +02:00
Alexander Meißner bbc0bb4f02
Fix: #20598 (#20669)
* Makes argument / parameter interfaces more clear.

* Fixes the bug in #20598
2021-10-14 08:47:41 +02:00
Alexander Meißner 1d813ea078
Refactor: Make program_id always last in program chain (#20598)
* Replaces program_id field in InvokeContextStackFrame by index.

* Swaps order of program account and programdata account.

* Removes program_id parameter from InvokeContext::push().
2021-10-13 08:58:20 +02:00
Alexander Meißner f30f3bddbb
Refactor: Remove program_id from process_instruction() (#20540)
* Replaces usage of program_id parameter by invoke_context.get_caller()?.

* Removes "pubkey: &Pubkey" parameter from "process_instruction()".
2021-10-10 22:29:18 +02:00
Alexander Meißner 4e65487d2f
Refactor: process_instruction() (#20448)
* Adds first_instruction_account parameter to process_instruction().

* Removes InvokeContext::remove_first_keyed_account() from all BPF loaders.

* Removes InvokeContext::remove_first_keyed_account() from all builtin programs.

* Removes InvokeContext::remove_first_keyed_account() from all mock ups.

* Deprecates InvokeContext::remove_first_keyed_account().

* Documents index base of keyed_account_at_index().

* Adds dynamic offset to call sites of "keyed_account_at_index()".
2021-10-08 11:41:07 +02:00
Alexander Meißner 4de5fff3ca
Simplifies return_data accessors in InvokeContext. (#20290) 2021-09-29 19:11:06 +02:00
Jack May 8fee9a2e1a
Dont call precompiled programs (#19930) 2021-09-29 06:25:08 +00:00
Jack May 4e27543415
Allow programs to realloc their accounts within limits (#19475) 2021-09-28 01:13:03 -07:00
Sean Young d714cf659c Proposal: log binary data for Solidity
The program_id is not needed on "Program return data: " because it
always preceeded by the program invoke message, so no need to repeat
the program id. Also rename this to "Program return: " since "data"
is redundant.
2021-09-22 07:59:06 +01:00
Justin Starry ea34eb8a4b
Update feature switch for reduced required deploy balance (#19999) 2021-09-19 14:50:41 -05:00
Alexander Meißner 36f46e1c31
CPI Account Reuse (#19762)
* Removes two account copy steps from InstructionProcessor::native_invoke().

* Moves gathering of keyed_accounts, caller_write_privileges and program_indices into InstructionProcessor::create_message().

* Explicitly routes the serialized account lengths to enable sharing of existing account structures.

* Recycles existing account structs in CPI syscall.
2021-09-18 08:09:47 +02:00
Justin Starry efd024510a
Reduce payer balance needed to deploy programs (#19645)
* Reduce payer balance needed to deploy programs

* Fix test and unbalanced ix error

* fix test

* fix up tests
2021-09-17 19:49:53 -05:00
Sean Young 098585234d Add return data implementation
This consists of:
 - syscalls
 - passing return data from invoked to invoker
 - printing to stable log
 - rust and C SDK changes
2021-09-10 14:25:54 +01:00
Jack May 622a6fba7f
Add executor using the program's id during deploy (#19555) 2021-09-01 17:59:24 -07:00
Justin Starry 4305d4b7b1
Add missing owner check to bpf loader close ix (#19460) 2021-08-27 08:44:38 -07:00
Justin Starry 2d7f036afd
Add solana-program-runtime crate (#19438) 2021-08-27 00:30:36 +00:00
Jack May a89f180145
Allow closing upgradeable program accounts (#19319) 2021-08-24 10:05:54 -07:00
Jeff Washington (jwash) 14361906ca
for all tests, bank::new -> bank::new_for_tests (#19064) 2021-08-05 08:42:38 -05:00
Alexander Meißner 0a63f65c03
Bumps solana_rbpf to v0.2.14 (#18869)
* Bumps solana_rbpf to v0.2.14

* Feature gate for verify_mul64_imm_nonzero as discussed in #17520.
2021-08-04 09:50:28 +02:00
Jack May ef17cf3bdb
Cleanup loader features (#18977) 2021-07-29 15:03:00 -07:00
Jack May 718939b6a0
Reduce bpf_loader test dependencies (#18949) 2021-07-28 14:47:21 -07:00
Jack May 7fc4cfebc8
Rename BpfComputeBudget (#18768) 2021-07-22 10:18:51 -07:00
Ryo Onodera f96de208e2 Implement MockInvokeContext::is_feature_active properly 2021-07-09 09:08:38 -07:00
Ryo Onodera f029af0fca Remove sysvar special cases for rent and assign 2021-07-09 09:08:38 -07:00
Jack May 2867584985
Bump compute budget for neon evm (#17700) 2021-07-08 10:43:34 -07:00
Alexander Meißner 8d5c04e257
Bump solana_rbpf to version 0.2.13 (#18068)
* Moves syscall_registry into the rbpf Executable constructor.

* Adds the reject_unresolved_syscalls flag which is only set when deploying programs via the CLI.
2021-07-07 09:50:11 +02:00
Trent Nelson d3a7e22112 sdk: refactor pda generation 2021-06-30 19:01:51 -06:00
Alexander Meißner 6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
Jack May 83b9a046d1
Add missing ProgramError to InstructionError mappings (#16231)
* Add missing ProgramError to InstructionError mappings

* add note

* Clarify process of adding new program error
2021-06-03 21:59:04 +00:00
Jack May 89ee8778bc
Unify BPF verifiers (#17585) 2021-05-28 14:24:02 -07:00
Jack May a3240aebde
Always bail if program modifies a ro account (#17569) 2021-05-28 09:50:25 -07:00
Dmitri Makarov 85b647d80f
Bump solana_rbpf to version 0.2.11 (#17404) 2021-05-25 08:05:35 +00:00
Alexander Meißner 855ae79598
Fix InvokeContext::push() account_deps (#17350)
* Reverts aliasing of account_deps with the previous invocation stack frame in InvokeContext::push().
* Adds explicit assert of programdata account content in test_program_bpf_upgrade_via_cpi.
2021-05-21 22:34:07 +02:00
Jack May 477898f682
Optimize aligned memory used by the runtime (#17324) 2021-05-19 13:43:59 -07:00
Jeff Washington (jwash) 541aa5ad85
tests: lamports -> lamports() (#16982) 2021-05-03 10:45:54 -05:00
Jeff Washington (jwash) 763c04adf3
lamports = -> .set_lamports() (#16980) 2021-04-30 21:17:05 +00:00
Jeff Washington (jwash) ac87bc40ca
tests: .lamports -> .lamports() (#16976) 2021-04-30 18:16:58 +00:00
Jeff Washington (jwash) 59e19828ea
set_lamports() (#16914) 2021-04-29 10:43:26 -05:00
Jeff Washington (jwash) a7a671b3aa
AccountSharedData.set_executable() (#16881) 2021-04-28 14:07:43 +00:00
Jeff Washington (jwash) 2021255f91
executable() (#16880) 2021-04-28 08:53:54 -05:00
Jeff Washington (jwash) 69bfbf9e98
AccountSharedData.set_executable (#16836) 2021-04-27 09:56:50 -05:00
Jeff Washington (jwash) 4e7e675c07
lamports += -> checked_add_lamports (#16791) 2021-04-27 09:11:35 -05:00
Jeff Washington (jwash) aeff911c93
owner -> owner() (#16784) 2021-04-26 10:40:11 -05:00
Jeff Washington (jwash) 1a4a7059af
owner -> owner() (#16785) 2021-04-23 15:59:13 -05:00
Jeff Washington (jwash) fb0b76c1f3
account.owner = X -> account.set_owner(X) (#16754) 2021-04-23 12:34:22 -05:00
Jack May 08d5253651
Enforce host aligned memory for program regions (#16590) 2021-04-20 11:07:30 -07:00
Alexander Meißner 9dfcb921cf
Refactoring: Move KeyedAccounts to InvokeContext (#15410)
Collects all parametric occurrences and the construction of keyed_accounts and puts them into InvokeContext.
2021-04-19 18:48:48 +02:00
Michael Vines a911ae00ba clippy 2021-04-18 20:55:02 -07:00
Jack May dee655df35
Cleanup use (#16327) 2021-04-02 08:54:09 -07:00
Jeff Washington (jwash) 66c42f62d8
make AccountSharedData.data private to abstract storage (#16091)
* format

* 2 more tests

* use
2021-03-25 11:04:20 -05:00
Ryo Onodera 6d5c6c17c5
Simplify account.rent_epoch handling for sysvar rent (#16049)
* Add some code for special local testing

* Add comment to store_account_and_update_capitalization

* Simplify account.rent_epoch handling for sysvar rent

* Introduce *_for_test functions

* Add deprecation messages to existing api
2021-03-25 15:23:20 +09:00
Jeff Washington (jwash) 2d24d13046
AccountsSharedData: data copy on write (#15800)
* Arc<AccountData>

* try custom serializer

* adapt test from Behzad's change

* clippy

* simplify serialization

* remove abi example derive

* refactor 'take'

* remove serialization

* remove serialize calls

* remove account_data

* remove intos

* remove left over file
2021-03-23 15:19:31 -05:00
Jeff Washington (jwash) 64429104b1
account data.fill replacement (#16037) 2021-03-19 15:13:20 -05:00
Jack May 7f500d610c
Add Close instrruction and tooling to upgradeable loader (#15887) 2021-03-17 21:39:29 -07:00
Jeff Washington (jwash) d30c9ef351
refactor test truncate data (#15851)
* refactor test truncate data

* retain existing behavior
2021-03-17 15:09:26 -05:00
Jack May ad9901d7c6
Charge compute budget for bytes passed via cpi (#15874) 2021-03-15 22:41:44 -07:00
Jack May cc38ae72e7
Skip deserialization of readonly accounts (#15813) 2021-03-11 19:28:21 -08:00
Jeff Washington (jwash) 3419a5446e
AccountSharedData.set_data (#15781)
* account.set_data and resize_data

* remove data_resize
2021-03-11 16:40:45 -06:00
Jack May 478518308d
Share RO and Executable accounts within invocations (#15799) 2021-03-10 23:04:00 -08:00
Jeff Washington (jwash) 1135ffd595
mut data refs as slice (#15782) 2021-03-10 15:28:03 -06:00
Jack May 369e13b111
cleanup old runtime features (#15787) 2021-03-10 09:48:41 -08:00
Jeff Washington (jwash) 52e54e1100
account.data -> data() (#15778) 2021-03-09 22:31:33 +00:00
Jeff Washington (jwash) 8a3135d17b
Account->AccountSharedData (#15691) 2021-03-09 15:06:07 -06:00
Jack May b53cb8eb2d
Deprecate Instruction::new (#15695) 2021-03-04 05:46:48 +00:00
Jeff Washington (jwash) be35c1c1b7
add execute detail timings (#15638) 2021-03-03 17:07:45 -06:00
Jack May d73af9c1dd
cli: don't overallocate upgradeable buffer accounts (#15603) 2021-03-02 00:45:53 -08:00
Jack May 3cd00965a7
Enable BPF program instruction traces (#15613) 2021-03-01 23:11:58 -08:00
Michael Vines 5df36aec7d Pacify clippy 2021-02-19 20:08:41 -08:00
Jack May 02432a548f
Cleanup old features (#15391) 2021-02-18 09:56:11 -08:00
Trent Nelson 7f7370c306 Re-allow clippy::integer_arithmetic at crate-level 2021-02-17 13:55:08 -07:00
Jack May d24d5fba0e
Upgradeable loader max_data_len limit (#15039) 2021-02-03 09:16:25 -08:00
Jack May 07cef5a557
Buffer authority must match upgrade authority for deploys and upgrades (#14923) 2021-01-29 12:43:42 -08:00
Jack May 0b1015f7d3
Richer runtime failure logging (#14875) 2021-01-28 10:04:54 -08:00
Michael Vines 3c6dbd21d2 Add ic_msg()/ic_logger_msg() macros 2021-01-21 21:41:33 +00:00
Jack May a480b63234
Bail on small deploy buffers (#14677) 2021-01-20 01:56:44 +00:00
Jack May e3bd9e5300
Prevent the invoke and upgrade of programs in the same tx batch (#14653)
* Prevent the invoke and upgrade of programs in the same tx batch

* Pass program address as writable in the upgrade instruction
2021-01-19 16:24:44 -08:00
Jack May 9d53eca6e3
Report correct program id (#14486) 2021-01-08 14:43:24 -08:00
Jack May 58487c6360
Add buffer authority to upgradeable loader (#14482) 2021-01-08 09:37:57 -08:00
Jack May 0619805806
Upgradeable programs needs program account's address as program id (#14417) 2021-01-04 21:45:05 +00:00
Jack May 6c6095abe7
nit: clarify loader id (#14355) 2020-12-30 20:02:29 +00:00
Jack May 5524938a50
Limit CPI instruction size (#14317) 2020-12-29 01:14:17 +00:00
Jack May ee0a80a092
Prevent bpf loader impersonators (#14278) 2020-12-24 03:04:48 +00:00
Jack May ab205b682a
Upgradeable programs called same as non-upgradeable (#14239)
* Upgradeable programs called same as non-upgradeable

* nudge
2020-12-22 09:26:55 -08:00
Jack May 593ad80954
Fix program account rent exemption (#14176) 2020-12-17 09:02:31 +00:00
Jack May d513b0c4ca
Add Program loader/environment instruction errors (#14120) 2020-12-15 09:54:07 -08:00
Jack May 9e90394583
Upgradeable loader (#13689) 2020-12-14 15:35:10 -08:00
Alexander Meißner a706706572
Validator CLI option to enable just-in-time compilation of BPF (#13789)
* Adds a CLI option to the validator to enable just-in-time compilation of BPF.

* Refactoring to use bpf_loader_program instead of feature_set to pass JIT flag from the validator CLI to the executor.
2020-12-07 09:49:55 +01:00
Alexander Meißner c833ede4af
Rbpf v0.2.1 (#13732)
* Refactoring to match rbpf-v0.2.1 and add JIT compilation caching.

* Removes obsolete bpf-trace.py which has been replaced by the rbpf CLI tool.
2020-11-24 18:00:19 +01:00
Jack May 3a9dca0c67
Add back BPF error logging (#13633)
* Add back BPF error logging

* Update programs/bpf_loader/src/lib.rs

Co-authored-by: Michael Vines <mvines@gmail.com>
2020-11-17 08:10:14 +00:00
Michael Vines baa6b3a261 Add stable program logging for BPF and native programs 2020-11-14 08:26:01 -08:00
Jack May 30ef53cb13
fix bpf lddw check (#13554) 2020-11-12 13:13:42 -08:00
Alexander Meißner 4999fe298b
Rbpf v0.2.0 (#13365)
* Updates rbpf to v0.2.0,
which unifies the interfaces of the interpreter and the JIT.
However, the JIT is not enabled yet.
2020-11-04 18:46:26 +01:00
Michael Vines da9548fd12 de-mut some InvokeContext methods 2020-10-30 09:20:09 +00:00