Commit Graph

186 Commits

Author SHA1 Message Date
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 22d8b3c3f8
Cleanup and feature gate instruction processing (#12359) 2020-09-20 10:58:12 -07:00
sakridge f561eb917f
Add way to look at tx instructions (#11943) 2020-09-19 12:17:46 -07:00
Jack May 5ab4109b7e
Add memory allocation support for C programs (#12254) 2020-09-15 16:42:20 -07:00
Jack May 555252f435
Make noop a real noop (#12196)
* Make noop a real noop

* nudge
2020-09-12 01:49:00 +00:00
Jack May ae0fd3043a
Add support for deprecated loader (#11946) 2020-08-31 14:06:58 -07:00
Jon Cinque 9a366281d3
sdk: Make PubKey::create_program_address available in program unit tests (#11745)
* sdk: Make PubKey::create_program_address available in program unit tests

This finishes the work started in #11604 to have
`create_program_address` available when `target_arch` is not `bpf` and
`program` is enabled.  Otherwise, there is an undefined reference error
to `sol_create_program_address`, which is only defined in `bpf`.

A small test to simply call the function has been added in order to catch
the problem in the future.

The default dependency to `solana-sdk/default` doesn't cause a problem with
existing programs since `build.sh` always specifies
`--no-default-features`, and programs in `solana-program-library` all
use it too.

* Add `default-features = false` for inter-program dependencies

Fix the build error found during CI.  The `--no-default-features` flag
only applies to the top-level package, and not to dependencies.  A program that
depends on another program, i.e. `128bit` which depends on `128bit_dep`,
must specify `default-features = false` when including that package,
otherwise the `bpf` build will try to pull in default packages, which
includes `std`.
2020-08-24 19:28:36 +02: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 750e5344f1
Return an error from create_program_address syscall (#11658) 2020-08-17 09:49:40 -07:00
Ryo Onodera 23fa84b322
Re-do rent collection check on rent-exempt account (#11349)
* wip: re-do rent collection check on rent-exempt account

* Let's see how the ci goes

* Restore previous code

* Well, almost all new changes are revertable

* Update doc

* Add test and gating

* Fix tests

* Fix tests, especially avoid to change abi...

* Fix more tests...

* Fix snapshot restore

* Align to _new_ with better uninitialized detection
2020-08-17 14:22:16 +09:00
Jack May 140b2392f6
Unified signature for create_program_address (#11460) 2020-08-10 10:24:11 -07:00
Jack May 03263c850a
Force program address off the curve (#11323) 2020-08-05 16:35:54 -07:00
Trent Nelson e12ab9d0dd Bump version to 1.4.0 2020-08-05 12:04:15 -06:00
Jack May 52526a9bc2
Prevent stub inclusion when building shared objects (#10875) 2020-07-01 13:15:30 -07: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 d77818c18b
Pull program stubs into SDK (#10704) 2020-06-18 23:23:28 -07:00
Jack May dac7dc2f10
Move types to more appropriate files (#10638) 2020-06-17 10:39:14 -07:00
R. M. Shea 48febf153b
Change documentation introduction to indicate Foundation IP transfer (#10440) 2020-06-13 14:41:05 -07:00
Michael Vines 9eefb2c929 Bump version to 1.3.0 2020-05-28 15:01:13 -07:00
Jack May 03abd3ddd7
Prevent privilege escalation (#10232)
automerge
2020-05-26 01:02:31 -07:00
Jack May 4a72c2b054
Support cross-program invocation to native programs (#10136) 2020-05-20 09:24:57 -07:00
Jack May eb1acaf927
Remove archiver and storage program (#9992)
automerge
2020-05-14 18:22:47 -07:00
Jack May 97e17f9b32 Programs can only sign their accounts 2020-05-11 09:06:05 -07:00
Jack May d836dfff14
Fix bpf unit test linkage (#9780)
automerge
2020-04-28 19:41:08 -07:00
Jack May 068f12fd6f
Add Cross-program invocations (#9582) 2020-04-28 14:33:56 -07:00
Michael Vines 47ae57610a Only build x86_64-unknown-linux-gnu on docs.rs 2020-04-16 19:06:17 -07:00
Jack May 268e04cb4a
Rename CustomError to Custom (#9207) 2020-04-01 09:01:11 -07:00
Michael Vines d7fa40087c
Bump version to 1.2.0 2020-03-28 09:44:13 -07:00
Jack May d087ed5bf6
Remove copypasta (#8912) 2020-03-17 15:59:09 -07:00
Jack May 5e3ce30d02
Pass the correct program_id to programs (#8630) 2020-03-05 10:57:35 -08:00
Grimes fc409d9262
Consistency nits and spelling (#8642)
automerge
2020-03-04 16:26:32 -08:00
Trent Nelson 90bedd7e06
Split signature throughput tracking out of `FeeCalculator` (#8447)
* SDK: Split new `FeeRateGovernor` out of `FeeCalculator`

Leaving `FeeCalculator` to *only* calculate transaction fees

* Replace `FeeCalculator` with `FeeRateGovernor` as appropriate

* Expose recent `FeeRateGovernor` to clients

* Move `burn()` back into `FeeCalculator`

Appease BPF tests

* Revert "Move `burn()` back into `FeeCalculator`"

This reverts commit f3035624307196722b62ff8b74c12cfcc13b1941.

* Adjust BPF `Fee` sysvar test to reflect removal of `burn()` from `FeeCalculator`

* Make `FeeRateGovernor`'s `lamports_per_signature` private

* rebase artifacts

* fmt

* Drop 'Recent'

* Drop _with_commitment variant

* Use a more portable integer for `target_signatures_per_slot`

* Add docs for `getReeRateCalculator` JSON RPC method

* Don't return `lamports_per_signature` in `getFeeRateGovernor` JSONRPC reply
2020-02-28 13:27:01 -07:00
Dan Albert 2d9d2f1e99
Update cargo versions from 1.0 to 1.1 (#8397) 2020-02-21 23:09:45 -08:00
Michael Vines 48f58a88bc Bump version to 1.0.0 2020-02-20 23:52:19 -07:00
Jack May 8436457e75
Rename program_utils.rs (#8127) 2020-02-05 12:48:30 -08:00
Jack May b6d09f1901
Add BPF program entrypoint return type (#8111) 2020-02-04 12:25:42 -08:00
Jack May 4e595e8e3c
Facilitate printing program errors from BPF programs (#8109) 2020-02-04 09:03:45 -08:00
Jack May 0fd795a676
Remove program error footgun and cleaner developer experience (#8042) 2020-01-31 10:58:07 -08:00
Jack May 2226c1b75c
Add Rust BPF RefCell borrow helpers (#8047) 2020-01-30 20:40:27 -08:00
Jack May dd276138c2
Add support for idiomatic error handling to BPF instruction processors (#7968) 2020-01-30 09:47:22 -08:00
Jack May b19f730527
Seperate RefCells lamports and data (#8021) 2020-01-29 21:15:04 -08:00
Jack May 1596c961d9
Rust BPF program cleanup (#7990) 2020-01-27 18:27:44 -08:00
Dan Albert c324e71768
Bump cargo toml versions to 0.24.0 (#7976) 2020-01-25 11:04:27 -06:00
Jack May 1b391dd36b
Add account accessor functions (#7966) 2020-01-24 14:34:59 -08:00
Jack May 917067741a
Cleanup BPF SDK (#7965) 2020-01-24 13:41:14 -08:00
Jack May 34ed93d57c
Optimize account copies and use RefCell to handle duplicate accounts in BPF programs (#7958) 2020-01-24 10:54:26 -08:00
Jack May 1a18f0ca55 Add rust duplicate account test program (#7897)
automerge
2020-01-21 10:59:19 -08:00
Jack May 09cff5e4cc
Cleanup usage of feature "program" (#7712) 2020-01-08 13:49:35 -08:00
Dan Albert ca10cf081f
Update cargo.toml files from 0.22.0 to 0.23.0 (#7596) 2019-12-20 21:45:42 -05:00
Justin Starry 7cfff75c3e Use procedural macro to generate static public keys (#7219)
automerge
2019-12-03 17:55:18 -08:00
Michael Vines 294662a1ce
Bump version to 0.22.0 2019-11-25 21:34:50 -07:00
Jack May dfc4d7cb50
Remove unsupported test (#6820) 2019-11-08 11:37:47 -08:00
Rob Walker efe260f12e
sysvar trait (#6667)
* sysvar trait

* get the new guy in on it
2019-11-04 12:31:24 -08:00
Rob Walker fa12a5f70b
kill rent calculator (#6625) 2019-10-30 16:25:12 -07:00
Dan Albert 73c31d873e
Update Cargo.toml versions from 0.20.0 to 0.21.0 (#6568) 2019-10-25 17:40:49 -06:00
Jack May b85996494b
BPF script nits (#6405) 2019-10-16 15:35:16 -07:00
Rob Walker 7cf90766a3
add epoch_schedule sysvar (#6256)
* add epoch_schedule sysvar

* book sheesh!
2019-10-08 22:34:26 -07:00
Dan Albert 9c9991db1d
Update cargo toml and lock files to v0.20.0 (#6016) 2019-09-22 21:45:56 -04:00
Jack May 0d16db2d1b
Remove bloat due to test symbols (#5965) 2019-09-18 19:54:10 -07:00
Jack May 958cbe688b
Dump debug version of BPF shared object (#5937) 2019-09-18 16:34:22 -07:00
Jack May c90595cba1
Cleanup nits (#5914) 2019-09-17 10:21:22 -07:00
Parth d63518a835
Rent tangential stuff (#5910)
* rename rent.rs to rent_calculator.rs

* add rent sysvar

* integrate rent_calculator with bank

* rent_calculator integration with genesis

* add test for rent sysvar
2019-09-17 17:12:55 +05:30
Jack May f5964b4f3c
unable to reproduce linkage issue (#5912) 2019-09-16 14:35:58 -07:00
Jack May 167adff22c
Strip ELF files (#5898) 2019-09-16 11:11:33 -07:00
Jack May 176c7d8b13
Pull all the Rust BPF tests into a single workspace so they share dependencies (#5878) 2019-09-11 14:55:58 -07:00
Jack May 1853771930
Add support for SDK sysvar types (#5876) 2019-09-10 18:53:02 -07:00
Jack May 008dcd71b9
BPF loader message nits (#5870) 2019-09-10 16:13:23 -07:00
Jack May 61fe1aa9cf
SDK cleanup to reduce featurization (#5856) 2019-09-09 16:38:52 -07:00
Jack May a317e9513f
Add sysvar support (#5838) 2019-09-09 10:55:35 -07:00
Jack May 1833db51a5
Cleanup program account def (#5833) 2019-09-06 17:32:14 -07:00
Justin Starry 81c36699c4
Add support for BPF program custom errors (#5743)
* Add support for BPF program custom errors

* Rename SOL_SUCCESS -> SUCCESS
2019-09-06 16:05:01 -07:00
Jack May 4c4b7d39b8
Cleanup program's ProcessInstruction (#5828) 2019-09-06 14:44:41 -07:00
Jack May d9817c153a
Switch programs to use Pubkey from SolPubkey (#5821) 2019-09-06 12:40:01 -07:00
Jack May e5f902369c
Rust BPF programs depend on Solana SDK (#5819) 2019-09-06 09:20:14 -07:00
Jack May 5fb2d7a98f
Add libstd support to Rust BPF (#5788) 2019-09-04 16:00:11 -07:00
Jack May 50214f059f
Pull in LLVM with stack location fixes (#5732) 2019-08-29 11:25:22 -07:00
Jack May 2803eb0d72
Use LLVM's C builtins for BPF (#5717) 2019-08-28 17:19:40 -07:00
Justin Starry bd20c5e791
Add test case for u128 panic (#5601)
* u128 panic

* Add test case for u128 memory out of bounds error

* Fix check
2019-08-26 16:31:06 -04:00
Michael Vines ba59741b60
Bump to 0.19.0-pre0 2019-08-25 21:47:29 -07:00
Justin Starry 19d16e75c6
Fix clippy and lint issues in BPF test program (#5607)
* Revert "Add test program for BPF memory corruption bug (#5603)"

This reverts commit 63d62c33c6.

* Revert "Revert "Add test program for BPF memory corruption bug (#5603)""

This reverts commit 9502082cdaf2be6b28b365be645c52e0f9c7da4d.

* Fix clippy and fmt issues
2019-08-22 15:38:46 -04:00
Justin Starry 63d62c33c6
Add test program for BPF memory corruption bug (#5603)
* Add test program for BPF memory corruption bug

* @jackcmay feedback
2019-08-22 14:25:23 -04:00
Michael Vines b1203da82c
Bump to 0.18.0-pre2 2019-08-20 16:56:00 -07:00
Michael Vines dd4640e1ed
Revert "Revert "Bump version to 0.18.0-pre1""
This reverts commit 42c7d57fc0.
2019-08-05 15:55:13 -07:00
Michael Vines 42c7d57fc0
Revert "Bump version to 0.18.0-pre1"
This reverts commit 14f6d5c82b.
2019-08-05 15:53:55 -07:00
Michael Vines 14f6d5c82b
Bump version to 0.18.0-pre1 2019-08-05 15:11:44 -07:00
Dan Albert b8835312bb
Update cargo.toml files to 0.18.0-pre0 (#5303) 2019-07-27 11:42:06 -06:00
Rob Walker 0d27515d09
tmp dirs target to farf (#5079) 2019-07-12 18:28:42 -07:00
Jack May 2860d2fe27
Pull in support for Rust-BPF stack argument passing (#5038) 2019-07-11 14:27:18 -08:00
Jack May bc8f435d45
Shell script nits (#4982) 2019-07-09 12:09:13 -08:00
Jack May 50c6b5d62d
Work around missing lib on linux (Issue #4972) (#4975) 2019-07-08 22:24:57 -08:00
Jack May f9a2254688
Split out Rust BPF no-std stuff (#4968) 2019-07-08 20:28:05 -08:00
Jack May 841e5e326c
Program mutable lamports (#4964) 2019-07-08 15:52:25 -08:00
Dan Albert 9911942dbd Increment cargo.toml files to v0.17.0 2019-06-22 04:35:25 +00:00
Jack May a38e1a81ef
Call do.sh from anywhere (#4771) 2019-06-21 12:26:17 -07:00
Jack May 407db65336 Add 128bit Rust BPF test (#4766)
automerge
2019-06-21 02:43:50 -07:00
Jack May e59b53dfa8
BPF rust language updates (#4752) 2019-06-20 16:07:12 -07:00
Jack May b430762a23
check rust programs (#4688) 2019-06-20 07:43:31 -07:00
Jack May fdb57bc5db
Add Rust BPF Tick Height test (#4718) 2019-06-18 15:56:24 -07:00