Commit Graph

129 Commits

Author SHA1 Message Date
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
77861e2d40 Feature disable fees sysvar (#18981)
* Feature disable fees sysvar

* nudge
2021-08-02 00:31:11 +00:00
Jack May
ef17cf3bdb Cleanup loader features (#18977) 2021-07-29 15:03:00 -07:00
Jack May
dfbb0c559b deprecate fees sysvar (#18960) 2021-07-29 10:48:14 -07:00
Jack May
7fc4cfebc8 Rename BpfComputeBudget (#18768) 2021-07-22 10:18:51 -07:00
Trent Nelson
abe5a0a349 gate libsecp256k1 upgrade to v0.5.0 2021-07-15 18:43:55 +00:00
s-medvedev
1f288ce527 Add ecrecover syscall (#17720)
Co-authored-by: Anton Lisanin <lisanin.anton@gmail.com>
2021-07-07 13:15:14 -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
Justin Starry
100fabf469 Remove feature switch for demoting sysvar write locks (#18373) 2021-07-06 21:22:22 +00:00
Alexander Meißner
7462c27d07 Refactoring: Unify account_deps and accounts (#17898)
* Changes ThisInvokeContext::get_account() to use accounts instead of pre_accounts.

* Adds explicit keys to accounts to make them symmetric to account_deps.

* Appends account_deps to accounts in transaction loading and removes account_deps everywhere else.
2021-07-05 13:49:37 +02:00
Sebastian Bor
3a4176aa3e feat: remove set_upgrade_authority_via_cpi_enabled feature (#17933) 2021-06-22 10:05:33 +01:00
Alexander Meißner
6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
Dmitri Makarov
361c1bdd57 Fix file permissions (#17910) 2021-06-12 02:03:32 +00:00
Arthur Greef
28fdfed1ba Blake3 syscall (#17358) 2021-06-08 11:04:10 -07:00
Jack May
2b50529265 Add memory operation syscalls (#16447) 2021-06-01 15:33:17 -07:00
Jack May
a3240aebde Always bail if program modifies a ro account (#17569) 2021-05-28 09:50:25 -07:00
Michael Vines
2c99b23ad7 Add get_sysvar() helper to sdk 2021-05-21 01:30:12 +00:00
Jack May
477898f682 Optimize aligned memory used by the runtime (#17324) 2021-05-19 13:43:59 -07:00
Tao Zhu
0781fe1b4f Upgrade Rust to 1.52.0 (#17096)
* Upgrade Rust to 1.52.0
update nightly_version to newly pushed docker image
fix clippy lint errors
1.52 comes with grcov 0.8.0, include this version to script

* upgrade to Rust 1.52.1

* disabling Serum from downstream projects until it is upgraded to Rust 1.52.1
2021-05-19 09:31:47 -05:00
Jack May
8eb05d6ed4 Add Keccak256 syscall and sdk support (#16498) 2021-05-10 16:16:58 -07:00
Jeff Washington (jwash)
82e11588a5 lamports -> lamports() (#16915) 2021-04-28 14:55:55 -05:00
Jack May
9b3a59f030 Retain alloc'd and updated data in cpi (#16850) 2021-04-27 13:36:42 -07:00
Jeff Washington (jwash)
998cba74b5 AccountSharedData.executable() (#16835) 2021-04-27 09:12:17 -05:00
Jeff Washington (jwash)
ca14c18998 owner -> owner() (#16782) 2021-04-23 22:49:47 +00:00
Jack May
be4df39a4c Remove unactivated ristretto syscall (#16727) 2021-04-22 09:29:42 -07:00
Sebastian Bor
1a658c7f31 Allow SetUpgradeAuthority instruction in CPI calls (#16676)
* feat: allow SetAuthority in CLI calls

* chore: clippy match_like_matches_macro

* chore: clippy match_like_matches_macro

* chore: rename CLI to CPI

* chore: move check for cpi authorised instruction to syscalls

* chore: add set_upgrade_authority cpi test

* chore: assert upgrade authority was changed

* feat: gate set_upgrade_authority via cpi with a feature

* chore: move feature to the end of the list

* chore: remove white spaces

* chore: remove white spaces

* chore: update comment to rerun build
2021-04-22 00:06:59 +01: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
f7eadd9d70 bump solana_rbpf from 0.2.5 to 0.2.7 (#16515) 2021-04-13 14:49:09 -07:00
Jack May
fa83f3bd73 Return sysvars via syscalls (#16422) 2021-04-12 16:04:57 -07:00
François Garillot
b08cff9e77 Simplify some pattern-matches (#16402)
When those match an exact combinator on Option / Result.

Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust).
2021-04-08 12:40:37 -06:00
Jack May
ad7f8e7f23 Use more performant copy (#16282) 2021-03-31 16:52:58 -07:00
Jack May
f84e88f0a2 Cleanup nits (#16211) 2021-03-30 12:16:21 -07:00
sakridge
54c68ea83f Drop write lock on sysvars (#15497)
* Drop write lock on sysvars

* adds env var for demoting sysvar write lock demotion

* moves demote logic to is_writable

* feature gates sysvar write lock demotion

* adds builtins to write lock demotion

* adds system program id to builtins

* adds Feature111...

* adds an abi-freeze test

* mvines set of builtin program keys

Co-authored-by: Michael Vines <mvines@gmail.com>

* update tests

* adds bpf loader keys

* Add test sysvar

* Plumb demote_sysvar to is_writable

* more plumbing of demote_sysvar_write_locks to is_writable

* patches test_program_bpf_instruction_introspection

* hard codes demote_sysvar_write_locks to false for serialization/encoding methods

* Revert "hard codes demote_sysvar_write_locks to false for serialization/encoding methods"

This reverts commit ae3e2d2e777437bddd753933097a210dcbc1b1fc.

* change the hardcoded ones to demote_sysvar_write_locks=true

* Use data_as_mut_slice

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Co-authored-by: Michael Vines <mvines@gmail.com>
2021-03-30 10:05:09 -07:00
Jack May
ad9901d7c6 Charge compute budget for bytes passed via cpi (#15874) 2021-03-15 22:41:44 -07:00
Jeff Washington (jwash)
952c3bcbb7 AccountSharedData construction (#15790) 2021-03-11 18:09:04 -06:00
Jack May
478518308d Share RO and Executable accounts within invocations (#15799) 2021-03-10 23:04:00 -08: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
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
Jack May
6650fbf443 Add per-byte logging cost (#15279) 2021-02-12 00:55:17 +00:00
Mrmaxmeier
ebbaa1f8ea Fix integer overflow in degenerate invoke_signed BPF syscalls (#15051) 2021-02-03 13:32:38 -08:00
Jack May
73d9186502 More rich runtime logging (#14938) 2021-02-01 11:40:49 -08:00
Alexander Meißner
d026da4a1b Ignore syscalls which are not registered in cached rbpf executable. (#14898) 2021-01-29 12:30:10 +01:00
Jack May
0b1015f7d3 Richer runtime failure logging (#14875) 2021-01-28 10:04:54 -08:00
Jack May
77572a7c53 Track account writable deescalation (#14626) 2021-01-22 15:28:01 -08:00
Jack May
6e8a1ba7de Load executable accounts from invoke context (#14574) 2021-01-14 00:19:22 -08:00