272 Commits

Author SHA1 Message Date
4de5fff3ca Simplifies return_data accessors in InvokeContext. (#20290) 2021-09-29 19:11:06 +02:00
8fee9a2e1a Dont call precompiled programs (#19930) 2021-09-29 06:25:08 +00:00
2cd9dc99b6 Restore ability for programs to upgrade themselves (#20265)
* Make helper associated fn

* Add feature definition

* Add handling to preserve program-id write lock when upgradeable loader is present; restore bpf upgrade-self test

* Use single feature
2021-09-28 09:59:08 -06:00
4e27543415 Allow programs to realloc their accounts within limits (#19475) 2021-09-28 01:13:03 -07:00
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
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
fc2bf2d3b6 Cleanup and standardize precompiles (#19918) 2021-09-17 11:36:57 -07:00
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
38bbb77989 Return error if Transaction contains writable executable or ProgramData accounts (#19629)
* Return error if Transaction locks an executable as writable

* Return error if a ProgramData account is writable but the upgradable loader isn't present

* Remove unreachable clause

* Fixup bpf tests

* Review comments

* Add new TransactionError

* Disallow writes to any upgradeable-loader account when loader not present; remove is_upgradeable_loader_present exception for all other executables
2021-09-08 15:21:52 -06:00
decec3cd8b Demote write locks on transaction program ids (#19593)
* Add feature

* Demote write lock on program ids

* Fixup bpf tests

* Update MappedMessage::is_writable

* Comma nit

* Review comments
2021-09-04 03:05:30 +00:00
ac9a2522bd nit cleanups (#19534) 2021-08-31 17:23:32 -07:00
c50b01cb60 Store versioned transactions in the ledger, disabled by default (#19139)
* Add support for versioned transactions, but disable by default

* merge conflicts

* trent's feedback

* bump Cargo.lock

* Fix transaction error encoding

* Rename legacy_transaction method

* cargo clippy

* Clean up casts, int arithmetic, and unused methods

* Check for duplicates in sanitized message conversion

* fix clippy

* fix new test

* Fix bpf conditional compilation for message module
2021-08-17 15:17:56 -07:00
0b50bb2b20 Deprecate FeeCalculator returning APIs (#19120) 2021-08-13 09:08:20 -07:00
9dfeee2993 Add BPF Sanity program-test based test (#19159) 2021-08-11 12:07:15 -07:00
14361906ca for all tests, bank::new -> bank::new_for_tests (#19064) 2021-08-05 08:42:38 -05:00
cde1461555 Bump bpf-tools to v1.14 (#19023)
- improved memory operations performance
- minor fixes
2021-08-03 09:13:58 +00:00
dfbb0c559b deprecate fees sysvar (#18960) 2021-07-29 10:48:14 -07:00
7fc4cfebc8 Rename BpfComputeBudget (#18768) 2021-07-22 10:18:51 -07:00
6cf3c1ab8f tx wide compute budget (#18631) 2021-07-16 00:31:22 -07:00
d166b9856a Move transaction sanitization earlier in the pipeline (#18655)
* Move transaction sanitization earlier in the pipeline

* Renamed HashedTransaction to SanitizedTransaction

* Implement deref for sanitized transaction

* bring back process_transactions test method

* Use sanitized transactions for cost model calculation
2021-07-15 22:51:27 -05:00
79c811ef17 Make another insn count adjustment for failing test 2021-07-08 09:35:07 -07:00
8fcda6a2da Adjust insn count in assert_instruction_count (#18519) 2021-07-08 07:57:32 -07:00
1f288ce527 Add ecrecover syscall (#17720)
Co-authored-by: Anton Lisanin <lisanin.anton@gmail.com>
2021-07-07 13:15:14 -07:00
e752299ac5 Bump bpf-tools version
Update Rust BPF to version 1.53
2021-07-07 05:08:40 -07:00
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
5dd399dafa Fix transaction logs and inner ixs for leader nodes (#18395)
* Fix transaction logs and inner ixs for leader nodes

* Fix cpi log storage flag
2021-07-06 19:35:24 +00:00
ad53d2ef77 ci: bump bpf instruction counts 2021-06-30 19:01:51 -06:00
52fd10ce03 chore: bump byteorder from 1.3.4 to 1.4.3 (#18300)
* chore: bump byteorder from 1.3.4 to 1.4.3

Bumps [byteorder](https://github.com/BurntSushi/byteorder) from 1.3.4 to 1.4.3.
- [Release notes](https://github.com/BurntSushi/byteorder/releases)
- [Changelog](https://github.com/BurntSushi/byteorder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/byteorder/compare/1.3.4...1.4.3)

---
updated-dependencies:
- dependency-name: byteorder
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* [auto-commit] Update all Cargo lock files

* Bump expected instruction count

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-29 15:08:04 -06:00
2fbedd834f Don't update if already an executable 2021-06-26 19:19:26 -06:00
c1e03f3410 Updates BPF program assert_instruction_count tests. 2021-06-18 10:42:46 -07:00
1b1d34da59 Refactor stake program into solana_program (#17906)
* Move stake state / instructions into solana_program

* Update account-decoder

* Update cli and runtime

* Update all other parts

* Commit Cargo.lock changes in programs/bpf

* Update cli stake instruction import

* Allow integer arithmetic

* Update ABI digest

* Bump rust mem instruction count

* Remove useless structs

* Move stake::id() -> stake::program::id()

* Re-export from solana_sdk and mark deprecated

* Address feedback

* Run cargo fmt
2021-06-15 18:04:00 +02:00
d272468a14 Adjust assert_instruction_count expected insn count value (#17874) 2021-06-10 20:50:55 +00:00
2fe211c5e0 Remove O2 option for compiling BPF programs (#17865)
rustc default compiler optimization level is O3. This change removes
the option that overrides the default optimization level, because it
is safe to do so.  The code generation is incorrect in some cases
because of link-time optimizations, which remain disabled for
compiling BPF programs.  In addition, this commit updates the expected
instruction counts for assert_instruction_count test.
2021-06-10 05:04:17 +00:00
28fdfed1ba Blake3 syscall (#17358) 2021-06-08 11:04:10 -07:00
47861fc373 Bump BPF tools to v1.9 2021-06-03 17:06:49 -07:00
80e5b24b38 Fix CPI recursion depth (#17659)
* Fix CPI recursion depth
2021-06-02 11:15:19 +02:00
4e0db50e4e Fix test instruction count (#17655) 2021-06-01 22:59:35 -07:00
2b50529265 Add memory operation syscalls (#16447) 2021-06-01 15:33:17 -07:00
831e87c65d Add BPF rustc option to reduce the optimizations to safer level (#17590) 2021-05-28 23:14:53 +00:00
a3240aebde Always bail if program modifies a ro account (#17569) 2021-05-28 09:50:25 -07:00
2316ddb90a Revert bpf-tools to version 1.8 because of a codegen bug suspicion (#17568) 2021-05-28 09:36:46 +00:00
9541411c15 Plumb transaction-level rewards (aka "rent debits") into the getTransaction RPC method 2021-05-27 03:05:05 +00:00
3ae4806dae Fix missing builtins in C programs linking with compiler_builtins (#17475) 2021-05-25 17:11:02 +00:00
85b647d80f Bump solana_rbpf to version 0.2.11 (#17404) 2021-05-25 08:05:35 +00:00
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
2ae57c172a Bump bpf-tools version to 1.9
- upgrade rustc to 1.52.1 and clang to 12.0
2021-05-20 11:35:37 +02:00
ab871ed4b7 Bump bpf-tools version to 1.8 2021-05-18 08:10:57 +02:00
f15dd1b4ef Add C Serialization Tests for #17217 (#17294) 2021-05-17 16:33:58 -07:00
3f0480d060 Fix deprecated trait object without an explicit dyn warning (#17231) 2021-05-14 17:33:07 +00:00
4ed828e4ee Enable RBPF trace output for BPF tests that are not using bpf_loader 2021-05-11 23:50:42 +02:00