Commit Graph

304 Commits

Author SHA1 Message Date
Jack May 6cf3c1ab8f
tx wide compute budget (#18631) 2021-07-16 00:31:22 -07:00
Justin Starry 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
Dmitri Makarov 79c811ef17 Make another insn count adjustment for failing test 2021-07-08 09:35:07 -07:00
Dmitri Makarov 8fcda6a2da
Adjust insn count in assert_instruction_count (#18519) 2021-07-08 07:57:32 -07: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
Dmitri Makarov e752299ac5 Bump bpf-tools version
Update Rust BPF to version 1.53
2021-07-07 05:08:40 -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 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
Trent Nelson ad53d2ef77 ci: bump bpf instruction counts 2021-06-30 19:01:51 -06:00
dependabot[bot] 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
Jack May 2fbedd834f Don't update if already an executable 2021-06-26 19:19:26 -06:00
Alexander Meißner c1e03f3410 Updates BPF program assert_instruction_count tests. 2021-06-18 10:42:46 -07:00
Jon Cinque 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
Dmitri Makarov d272468a14
Adjust assert_instruction_count expected insn count value (#17874) 2021-06-10 20:50:55 +00:00
Dmitri Makarov 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
Arthur Greef 28fdfed1ba
Blake3 syscall (#17358) 2021-06-08 11:04:10 -07:00
Dmitri Makarov 47861fc373 Bump BPF tools to v1.9 2021-06-03 17:06:49 -07:00
Jack May 80e5b24b38
Fix CPI recursion depth (#17659)
* Fix CPI recursion depth
2021-06-02 11:15:19 +02:00
Jack May 4e0db50e4e
Fix test instruction count (#17655) 2021-06-01 22:59:35 -07:00
Jack May 2b50529265
Add memory operation syscalls (#16447) 2021-06-01 15:33:17 -07:00
Dmitri Makarov 831e87c65d
Add BPF rustc option to reduce the optimizations to safer level (#17590) 2021-05-28 23:14:53 +00:00
Jack May a3240aebde
Always bail if program modifies a ro account (#17569) 2021-05-28 09:50:25 -07:00
Dmitri Makarov 2316ddb90a
Revert bpf-tools to version 1.8 because of a codegen bug suspicion (#17568) 2021-05-28 09:36:46 +00:00
Michael Vines 9541411c15 Plumb transaction-level rewards (aka "rent debits") into the `getTransaction` RPC method 2021-05-27 03:05:05 +00:00
Dmitri Makarov 3ae4806dae
Fix missing builtins in C programs linking with compiler_builtins (#17475) 2021-05-25 17:11:02 +00: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
Dmitri Makarov 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
Dmitri Makarov ab871ed4b7 Bump bpf-tools version to 1.8 2021-05-18 08:10:57 +02:00
Jack May f15dd1b4ef
Add C Serialization Tests for #17217 (#17294) 2021-05-17 16:33:58 -07:00
Dmitri Makarov 3f0480d060
Fix deprecated trait object without an explicit dyn warning (#17231) 2021-05-14 17:33:07 +00:00
Dmitri Makarov 4ed828e4ee Enable RBPF trace output for BPF tests that are not using bpf_loader 2021-05-11 23:50:42 +02:00
Jack May 8eb05d6ed4
Add Keccak256 syscall and sdk support (#16498) 2021-05-10 16:16:58 -07:00
Jack May 9b3a59f030
Retain alloc'd and updated data in cpi (#16850) 2021-04-27 13:36:42 -07:00
Jeff Washington (jwash) 603872685d
private AccountSharedData.owner (#16760)
* private AccountSharedData.owner

* fix perf test
2021-04-26 14:59:17 -05: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
Jack May 74f58376f8
Expand and update instruction count tests (#16522) 2021-04-13 16:23:42 -07:00
Dmitri Makarov db3bca7edd
Add llvm feature option to compile for Solana BPF target (#16495) 2021-04-13 07:20:18 +00:00
Justin Starry 85eb37fab0
Merge pull request from GHSA-8v47-8c53-wwrc
* Track transaction check time separately from account loads

* banking packet process metrics

* Remove signature clone in status cache lookup

* Reduce allocations when converting packets to transactions

* Add blake3 hash of transaction messages in status cache

* Bug fixes

* fix tests and run fmt

* Address feedback

* fix simd tx entry verification

* Fix rebase

* Feedback

* clean up

* Add tests

* Remove feature switch and fall back to signature check

* Bump programs/bpf Cargo.lock

* clippy

* nudge benches

* Bump `BankSlotDelta` frozen ABI hash`

* Add blake3 to sdk/programs/Cargo.lock

* nudge bpf tests

* short circuit status cache checks

Co-authored-by: Trent Nelson <trent@solana.com>
2021-04-13 00:28:08 -06:00
Jack May 476fd40948
Add program-test tests to bpf programs (#16407) 2021-04-07 01:47:15 -07:00
Jack May 92f4018b07
Cleanup unsupported sysvars (#16390)
* Cleanup unsupported sysvars

* fix ser description
2021-04-06 00:08:03 -07:00
Dmitri Makarov 1359bceb5d
Bump bpf-tools to version v1.5 (#16331)
The new version of bpf-tools eliminates the separate
rust-bpf-sysroot. The Rust standard libraries for the BPF target are
built in tree when the compiler is built.  The standard libraries code
is slightly more optimized and some reduction of compute budget can be
expected with this version of bpf-tools.
2021-04-04 13:04:22 +00:00
behzad nouri 3f63ed9a72
removes OrderedIterator and transaction batch iteration order (#16153)
In TransactionBatch,
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/transaction_batch.rs#L4-L11
lock_results[i] is aligned with transactions[iteration_order[i]]:
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/bank.rs#L2414-L2424
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/accounts.rs#L788-L817

However load_and_execute_transactions is iterating over
  lock_results[iteration_order[i]]
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/bank.rs#L2878-L2889
and then returning i as for the index of the retryable transaction.

If iteratorion_order is [1, 2, 0], and i is 0, then:
  lock_results[iteration_order[i]] = lock_results[1]
which corresponds to
  transactions[iteration_order[1]] = transactions[2]
so neither i = 0, nor iteration_order[i] = 1 gives the correct index for the
corresponding transaction (which is 2).

This commit removes OrderedIterator and transaction batch iteration order
entirely. There is only one place in blockstore processor which the
iteration order is not ordinal:
https://github.com/solana-labs/solana/blob/e50f59844/ledger/src/blockstore_processor.rs#L269-L271
It seems like, instead of using an iteration order, that can shuffle entry
transactions in-place.
2021-03-31 23:59:19 +00: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
Justin Starry e817a6db00
Add timeout for local cluster partition tests (#16123)
* Add timeout for local cluster partition tests

* fix optimistic conf test logs

* Bump instruction count assertions
2021-03-25 13:27:07 -06: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
Dmitri Makarov 664ed76523
Bump bpf-tools to version v1.3 (#16068)
* Bump bpf-tools to version v1.3

This brings in the fix for increased compute budget that wasn't caught
when bpf-tools v1.2 were released.

* Adjust BPF test programs instruction counts
2021-03-24 07:16:38 +00:00
Jack May cc38ae72e7
Skip deserialization of readonly accounts (#15813) 2021-03-11 19:28:21 -08:00
Dmitri Makarov c5a5d7457e
Bump bpf-tools to v1.1 (#15776) 2021-03-10 18:13:38 +01:00
Jeff Washington (jwash) 8a3135d17b
Account->AccountSharedData (#15691) 2021-03-09 15:06:07 -06:00
Jack May efcb58092e
Add more duplicate account tests (#15746) 2021-03-05 20:36:27 -08:00
Jack May fb3837260c
Add BPf loader finalize test via inner instruction (#15708) 2021-03-04 20:34:36 +00:00
Jack May b53cb8eb2d
Deprecate Instruction::new (#15695) 2021-03-04 05:46:48 +00:00
Tyera Eulberg d521dfe63c
Implement OutputFormat for confirm in Cli and ledger-tool bigtable (#15528)
* Add CliTransaction struct

* Impl DisplayFormat for decode-transaction

* Add block-time to transaction println, writeln

* Impl DisplayFormat for confirm

* Use DisplayFormat in ledger-tool bigtable confirm
2021-02-25 14:15:52 -07:00
Jack May 48785b507b
Bump Rust-BPF to v1.46 (#15273) 2021-02-18 11:30:08 -08:00
Jack May 02432a548f
Cleanup old features (#15391) 2021-02-18 09:56:11 -08:00
Jon Cinque 0f6f6080f3
sdk: Add Borsh support for types and utilities (#15290)
* sdk: Add Borsh to Pubkey

* Add serialization error for easier borsh integration

* Add Borsh usage to banks-client and sdk

* Rename SerializationError -> IOError

* Add new errors to proto

* Update Cargo lock

* Update Cargo.lock based on CI

* Clippy

* Update ABI on bank

* Address review feedback

* Update sanity program instruction count test
2021-02-18 11:14:56 +01:00
Jack May 02a5f7104a
Fix which shared object the test uses (#15060) 2021-02-03 13:31:55 -08:00
Trent Nelson a2aea0ca33 cli-output: Add option sigverify status to `println_transaction()` output 2021-02-02 18:44:22 +00:00
Jack May 07cef5a557
Buffer authority must match upgrade authority for deploys and upgrades (#14923) 2021-01-29 12:43:42 -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 63429507b2
Add syscall feature activation test (#14890) 2021-01-27 17:21:25 -08:00
Jack May e57b9c3b02
Add more upgradeable tests (#14846) 2021-01-25 21:04:59 -08:00
Jack May 77572a7c53
Track account writable deescalation (#14626) 2021-01-22 15:28:01 -08:00
behzad nouri d52c94a366
adds missing block_time field (#14743) 2021-01-21 18:29:48 +00:00
Jack May aa96ad042b
Add signer/writable de/escalation tests (#14726) 2021-01-21 09:19:46 +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
sakridge 907f518f6d
Add load/execute/store timings (#14561) 2021-01-14 14:14:16 -08:00
Jack May 6e8a1ba7de
Load executable accounts from invoke context (#14574) 2021-01-14 00:19:22 -08:00
Jack May ec48631fc5
Bail on all CPI errors (#14500)
* Bail on all CPI errors

* whitespace
2021-01-09 02:27:39 +00:00
Jack May 5eacc5d08d
Enable program upgrades via CPI (#14449) 2021-01-06 14:31:14 -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 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 b1d702a618
Don't use caller passed executable account (#14276) 2020-12-23 14:34:14 -08:00
Jack May 0b479ab180
Limit CPI from calling loader or native programs (#14252) 2020-12-23 10:44:34 -08: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 e8cc0bef6c
Add CPI support for upgradeable loader (#14193) 2020-12-17 15:39:49 -08:00
Jack May 593ad80954
Fix program account rent exemption (#14176) 2020-12-17 09:02:31 +00:00
Jack May 025f886e10
check for resize access violations (#14142) 2020-12-15 23:21:08 -08: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
Jack May 5ea80e673f
Fix priv escalation test (#14046) 2020-12-10 22:36:33 +00:00
Jack May e1a4251b07
Cap CPI signers (#14021) 2020-12-09 02:14:53 -08:00
Jack May 882d033233
Don't use stale executor cache (#13966) 2020-12-05 05:54:42 +00:00
Jack May 661ca52135
Cap seeds not signers (#13941) 2020-12-03 09:58:25 -08:00
Jack May 1c51711c75
Invoke with empty account slice (#13931) 2020-12-03 07:06:26 -08:00
Jack May 85bec37be4
Translate data length and owner as writable (#13914) 2020-12-02 09:05:42 -08:00
Alexander Meißner aebc3a17ce
Fix undefined symbol "custom panic" in BPF test programs (#13840)
* Implements missing "custom_panic" symbol
2020-12-01 16:52:20 +01:00
Jack May 733fcbaa6c
Check that the program was granted access to program_id (#13890) 2020-12-01 07:35:07 -08:00
Jack May b47bd0a296
Add program id spoof tests (#13866) 2020-11-30 21:06:11 +00: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 461ae40eea
provide full Rust panic messages in BPF and add memory optimizations (#13455) 2020-11-09 13:40:26 -08:00
Jack May 84b139cc94
Add builtin mem tests (#13429) 2020-11-05 22:20:54 -08:00
Justin Starry c24fbb6f8b
Fix duplicate records of inner instructions (#13380)
* Fix duplicate records of inner instructions

* fix tests

* fix clippy

* Remove bad_inner_instructions
2020-11-05 15:23:52 +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 da361afbb9 Revert "Updates rbpf to v0.2.0, (#12951)"
This reverts commit 6606590b81.
2020-10-29 21:45:24 -07:00
Michael Vines 7d686b72a0 Add Bank::set_bpf_compute_budget() 2020-10-29 21:45:24 -07:00
Michael Vines 225bed11c7 Remove Entrypoint type 2020-10-29 21:45:24 -07:00
Michael Vines df8dab9d2b Native/builtin programs now receive an InvokeContext 2020-10-29 21:45:24 -07:00
Alexander Meißner 6606590b81
Updates rbpf to v0.2.0, (#12951)
which unifies the interfaces of the interpreter and the JIT.
However, the JIT is not enabled yet.
2020-10-29 11:34:52 -07:00
Alexander Meißner 65ee3a6bdd
Refactors the common code of test and bench targets into the solana_runtime::bpf_test_utils module. (#13203) 2020-10-29 10:04:47 +01:00
Michael Vines 1b343665a1 Move KeyedAccount out of solana-program. Native programs are not supported by solana-program 2020-10-26 18:54:54 -07:00
Michael Vines b169d9cfbe Add --bpf-out-dir argument to control where the final build products land 2020-10-23 04:57:03 +00:00
Michael Vines 7bc073defe Run `codemod --extensions rs Pubkey::new_rand solana_sdk::pubkey::new_rand` 2020-10-21 19:08:13 -07:00
Jack May 969f7b015b
Respect RefCell when calling invoke (#12858)
* Respect RefCell when calling invoke

* nudge
2020-10-15 01:06:41 +00:00
Jack May 56211378d3
terminology update, nonce to bump seed (#12840) 2020-10-13 10:11:08 -07:00
Jack May c3907be623
Add adjustable stack size and call depth (#12728) 2020-10-09 13:07:09 -07:00
Jack May 2cd7cd3149
Bump max invoke depth to 4 (#12742) 2020-10-09 10:33:12 -07:00
Josh 8f5431551e
Store program logs in blockstore / bigtable (TransactionWithStatusMeta) (#12678)
* introduce store program logs in blockstore / bigtable

* fix test, transaction logs created for successful transactions

* fix test for legacy bincode implementation around log_messages

* only api nodes should record logs

* truncate transaction logs to 100KB

* refactor log truncate for improved coverage
2020-10-08 12:06:15 -07:00
Jack May 973f0965e1
Add ristretto multiply syscall (#12699) 2020-10-06 23:52:13 -07:00
Jack May 630eb3b907
Local program allocator (#12679) 2020-10-06 11:03:51 -07:00
Jack May d0aa8a6446
Fix zero-len slice translations (#12642) 2020-10-02 17:45:39 -07:00
Jack May adeb06e550
Check CPI program is executable (#12644) 2020-10-02 13:55:22 -07:00
Jack May 058bca6632
add sha256 syscall (#12569) 2020-09-29 23:29:20 -07:00
Jack May 777342a1ef
Add rand dependency test (#12566)
* Add rand dependency test

* nudge
2020-09-30 00:25:51 +00:00
Jack May 74fcb184b2
Pipe FeatureSet though InvokeContext (#12536)
* Pipe FeatureSet though InvokeContext

* gate program size cap

* nit
2020-09-29 21:36:30 +00:00
Jack May 2ff983647f
Move process_instruction defs to runtime (#12507) 2020-09-29 01:36:46 -07:00
Michael Vines aa5c008fa8 Add pico-inflation feature 2020-09-28 08:25:00 -07:00
Jack May 7c4822efb1
Nit: bpf test cleanup (#12401) 2020-09-25 17:02:48 -07:00
Jack May d326512121
Add ComputeBudget tuner (#12476) 2020-09-25 09:01:22 -07:00
Justin Starry 6601ec8f26
Record and store invoked instructions in transaction meta (#12311)
* Record invoked instructions and store in transaction meta

* Enable cpi recording if transaction sender is some

* Rename invoked to innerInstructions
2020-09-24 22:36:22 +08:00
sakridge f561eb917f
Add way to look at tx instructions (#11943) 2020-09-19 12:17:46 -07:00
sakridge 3930cb865a
Add keccak-secp256k1 instruction (#11839)
* Implement keccak-secp256k1 instruction

Verifies eth addreses with ecrecover function

* Move secp256k1 test
2020-09-15 18:23:21 -07:00
Jack May 5ab4109b7e
Add memory allocation support for C programs (#12254) 2020-09-15 16:42:20 -07:00
Jack May 3278d78f08
Cache re-usable work performed by the loader (#12135) 2020-09-14 17:42:37 -07:00
Jack May ae7b15f062
Gate pointer alignment enforcement (#12176) 2020-09-11 11:07:03 -07:00
Jack May fab2d44abd
Add BPF test program instruction monitoring (#11984) 2020-09-01 17:25:55 -07:00
Jack May ae0fd3043a
Add support for deprecated loader (#11946) 2020-08-31 14:06:58 -07:00
Jack May 8d362f682b
The constraints on compute power a program can consume is limited only to its instruction count (#11717) 2020-08-21 15:31:19 -07:00
Jack May e9b610b8df
Add SystemInstruction::CreateAccount support to CPI (#11649) 2020-08-17 13:38:42 -07:00
Jack May 7c736f71fe
Make BPF Loader static (#11516) 2020-08-14 12:32:45 -07:00
Jack May 03263c850a
Force program address off the curve (#11323) 2020-08-05 16:35:54 -07:00
Greg Fitzgerald 7ade330b23
Rename Client methods to match proposed BanksClient (#10793) 2020-06-25 03:35:38 +00:00
Greg Fitzgerald 1c498369b5
Remove fee-payer guesswork from Message and Transaction (#10776)
* Make Message::new_with_payer the default constructor

* Remove Transaction::new_[un]signed_instructions

These guess the fee-payer instead of stating it explicitly
2020-06-24 14:52:38 -06:00
Jack May db4a18ada4
Add PubkeyError for ProgramError (#10748) 2020-06-23 11:19:27 -07:00
Jack May 73586c1aad
Use &[u8] for program address seeds rather then &str (#10744) 2020-06-22 16:51:43 -07:00
Jack May 03abd3ddd7
Prevent privilege escalation (#10232)
automerge
2020-05-26 01:02:31 -07:00
Kristofer Peterson b7a32f01c0
Multi-version snapshot support (#9980)
* Multi-version snapshot support

* rustfmt

* Remove CLI options and runtime support for selection output snapshot version.
Address some clippy complaints.

* Muzzle clippy type complexity warning.

Despite clippy's suggestion, it is not currently possible to create type aliases
for traits and so everything within the 'Box<...>' cannot be type aliased.

This then leaves creating full blown traits, and either implementing
said traits by closure (somehow) or moving the closures into new structs
implementing said traits which seems a bit of a palaver.

Alternatively it is possible to define and use the type alias 'type ResultBox<T> = Result<Box<T>>'
which does seems rather pointless and not a great reduction in complexity but is enough to keep clippy happy.

In the end I simply went with squelching the clippy warning.

* Remove now unused Serialize/Deserialize trait implementations for AccountStorageEntry and AppendVec

* refactor versioned de/serialisers

* rename serde_utils to serde_snapshot

* move call to accounts_db.generate_index() back down to context_accountsdb_from_stream()

* update version 1.1.1 to 1.2.0
remove nested use of serialize_bytes

* cleanups

* Add back measurement of account storage entry serialization.
Remove construction of Vec and HashMap temporaries during serialization.

* consolidate serialisation test cases into serde_snapshot.
clean up leakage of implementation details in serde_snapshot.

* move short term / legacy snapshot code into child module

* add serialize_iter_as_tuple

* preliminary integration of following commit

commit 6d58b73c47294bfb93465d5a83cd2175660b6e6d
Author: Ryo Onodera <ryoqun@gmail.com>
Date:   Wed May 20 14:02:02 2020 +0900

    Confine snapshot 1.1 relic to versioned codepath

* refactored serde_snapshot, rustfmt
legacy accounts_db format now "owns" both leading u64s, legacy bank_rc format has none

* reduce type complexity (clippy)
2020-05-23 02:54:24 +09:00
Jack May 4a72c2b054
Support cross-program invocation to native programs (#10136) 2020-05-20 09:24:57 -07:00
Jack May 97e17f9b32 Programs can only sign their accounts 2020-05-11 09:06:05 -07:00
Jack May 84885d79d5
Pull in hardened BPF virtual machine (#9931) 2020-05-08 12:37:04 -07:00
Jack May 068f12fd6f
Add Cross-program invocations (#9582) 2020-04-28 14:33:56 -07:00
Jack May d08517db8c
Nit picks (#9580) 2020-04-18 22:39:08 -07:00
Jack May 241a05fc52
Add native loader entry points (#9486) 2020-04-15 09:41:29 -07:00