Commit Graph

67 Commits

Author SHA1 Message Date
Jack May 851958f77a
Disallow deployment of deprecated _sol_alloc_free syscall (#25179) 2022-05-20 13:19:41 -07:00
Dmitri Makarov 3c70220142 Remove obsolete string C header input file
string.h doesn't contain any syscall declarations that need to be
processed by the gen-headers C header file generating utility.
2022-05-13 10:37:25 -07:00
Jack May 8902a66b20
Revert "Disallow deployment of deprecated _sol_alloc_free syscall (#24986)" (#25170)
This reverts commit 8f1d4c1665.
2022-05-12 17:58:17 -05:00
Jack May 8f1d4c1665
Disallow deployment of deprecated _sol_alloc_free syscall (#24986)
* Disallow deployment of deprecated _sol_alloc_free syscall

* remove cli argument
2022-05-11 05:22:49 +00:00
Dmitri Makarov 66366615bb Generate syscall headers 2022-05-05 19:50:54 -07:00
Dmitri Makarov 6bf58572ca Update llvm include path in C toolchain makefile 2022-04-19 21:38:36 -07:00
Dmitri Makarov f58ebff44e Update C toolchain linker script to match the rust toolchain script 2022-04-18 17:35:38 -07:00
HaoranYi 0b7d0476c8
fix a typo (#24070) 2022-04-01 15:16:51 -07:00
Jon Cinque 923720f529
SDK: Add stdlib.h include to pull in `abort()` (#21700) 2021-12-08 17:00:16 +01:00
Dmitri Makarov 4287bf6b8b
Bump bpf-tools to v1.18 (#20991)
- added newlib standard C library to clang toolchain
- fixed BPF backend bug that accidentally deleted code, issue #20538
2021-10-26 22:51:44 +00: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
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 04c0c608a3
Split solana_sdk.h (#19172) 2021-08-13 09:49:24 -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
Trent Nelson 7ee39fcb0f sdk: ensure `ld` can find criterion when running BPF tests 2021-06-24 22:14:54 -06: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
Dmitri Makarov 6f193bf357 Add separate rules to generate dependencies files for C BPF build 2021-06-08 05:34:40 -07:00
Dmitri Makarov 47861fc373 Bump BPF tools to v1.9 2021-06-03 17:06:49 -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
Dmitri Makarov 3ae4806dae
Fix missing builtins in C programs linking with compiler_builtins (#17475) 2021-05-25 17:11:02 +00:00
Christian Machacek 8758e9ed82
Remove const qualifier from syscall out-parameters (#17382) 2021-05-21 12:09:22 -07:00
Dmitri Makarov ab871ed4b7 Bump bpf-tools version to 1.8 2021-05-18 08:10:57 +02:00
Christian Machacek e02b4e1192
Fix a bug in input deserialization in the C SDK (#17217)
When the input contains more accounts than the user has requested to be deserialized, and one of the excess ones is a dup, the input pointer is not adjusted correctly.

Compare the lines added by this commit to line 401: "input += 7; // padding". Since the input data layout does not depend on the number of accounts the user wants to deserialize, this adjustment by 7 bytes must happen in both branches.
2021-05-14 16:41:55 -06:00
Jack May 8eb05d6ed4
Add Keccak256 syscall and sdk support (#16498) 2021-05-10 16:16:58 -07:00
Jack May 82fb6712e7
fix c program deploy help (#17152) 2021-05-10 15:38:01 -07:00
Christian Machacek ff95e2aaa6 Add a make target to run the readelf utility on a compiled program
The readelf utility (already shipped with the solana tools) shows meta-information about ELF files, such as symbol tables. It is useful for investigating "unresolved symbol" errors that crop up at runtime.

This commit also fixes the objdump flags (two dashes are required and there is no "color" option) as well as a few typos.
2021-05-08 18:49:14 -07:00
Christian Machacek 6927d0c77e
Fix syscalls in the C SDK failing at runtime when compiled as C++ (#17124)
Some syscalls are wrongly declared "static" in solana_sdk.h, which makes clang++ assume they are local to the compilation unit. It therefore ignores the extern "C" {} block and mangles their names. While that doesn't break C++ compilation, the syscall fails at runtime with something along the lines of "ELF error: Unresolved symbol (_ZL26sol_create_program_addressPK13SolSignerSeediPK9SolPubkeyS4_)".
2021-05-08 16:31:50 +00:00
Dmitri Makarov db3bca7edd
Add llvm feature option to compile for Solana BPF target (#16495) 2021-04-13 07:20:18 +00:00
Dmitri Makarov c5a5d7457e
Bump bpf-tools to v1.1 (#15776) 2021-03-10 18:13:38 +01:00
Jack May 48785b507b
Bump Rust-BPF to v1.46 (#15273) 2021-02-18 11:30:08 -08:00
Jack May bba1b49663
Generate keypair file for c program deployment (#15080)
* Generate keypair file for c program deployment

* Build and use solana-keygen in test-stable-perf
2021-02-04 13:56:12 -08:00
Jack May ab98c1f2d4
Add try_find_program_address syscall (#14118) 2020-12-15 08:15:01 -08:00
Jack May e390c8cb7f
Add stubs and heap region definitions (#13521)
* Add stubs and heap region definitions

* nudge
2020-11-11 05:50:16 +00:00
Jack May 9ca8e98525
Add printf declaration (#13514) 2020-11-10 23:40:48 +00:00
Jack May 23c558510a
add missing c logging stubs (#13511) 2020-11-10 22:19:54 +00:00
Michael Vines 66e51a7363 Add sol_log_compute_units syscall 2020-10-29 21:45:24 -07:00
Jack May 3f9e6a600b
program log pubkey as base58 (#12901) 2020-10-15 09:11:54 -07:00
Jack May 058bca6632
add sha256 syscall (#12569) 2020-09-29 23:29:20 -07:00
Jack May b8c4b88188
Cleanup names, fix line dependent test (#12477) 2020-09-25 09:00:06 -07:00
Jack May 5ab4109b7e
Add memory allocation support for C programs (#12254) 2020-09-15 16:42:20 -07:00
Jack May ae0fd3043a
Add support for deprecated loader (#11946) 2020-08-31 14:06:58 -07:00
Jack May e9b610b8df
Add SystemInstruction::CreateAccount support to CPI (#11649) 2020-08-17 13:38:42 -07:00
Jack May f1ba2387d3
More efficient padding (#11656) 2020-08-17 10:24:34 -07:00
Jack May 9290e561e1
Align host addresses (#11384)
* Align host addresses

* support new program abi

* update epoch rollout

* Enforce aligned pointers in cross-program invocations
2020-08-11 16:11:52 -07:00
Jack May 03263c850a
Force program address off the curve (#11323) 2020-08-05 16:35:54 -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 c5460e7fee
Remove inline from all BPF C functions (#10038) 2020-05-13 17:23:39 -07:00
Jack May 7678af6300
Cleanup BPF helper symbols (#9804) 2020-04-30 11:29:11 -07:00