44 Commits

Author SHA1 Message Date
mergify[bot]
72d038ecd8 Remove const qualifier from syscall out-parameters (#17382) (#17395)
(cherry picked from commit 8758e9ed82)

Co-authored-by: Christian Machacek <39452430+machacekch@users.noreply.github.com>
2021-05-21 20:45:35 +00:00
mergify[bot]
9e42883d4b Fix a bug in input deserialization in the C SDK (#17217) (#17249)
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.

(cherry picked from commit e02b4e1192)

Co-authored-by: Christian Machacek <39452430+machacekch@users.noreply.github.com>
2021-05-15 00:10:02 +00:00
mergify[bot]
3303ead54d Add Keccak256 syscall and sdk support (backport #16498) (#17157)
* Add Keccak256 syscall and sdk support (#16498)

(cherry picked from commit 8eb05d6ed4)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	programs/bpf/rust/sha/Cargo.toml
#	programs/bpf/tests/programs.rs
#	programs/bpf_loader/Cargo.toml
#	sdk/program/Cargo.toml
#	sdk/program/src/lib.rs
#	sdk/src/feature_set.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-05-11 09:31:16 +00:00
mergify[bot]
ea3b783b63 fix c program deploy help (#17152) (#17156)
(cherry picked from commit 82fb6712e7)

Co-authored-by: Jack May <jack@solana.com>
2021-05-10 23:36:16 +00:00
mergify[bot]
efc3c0d65f Add a make target to run the readelf utility on a compiled program (#17131)
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.

(cherry picked from commit ff95e2aaa6)

Co-authored-by: Christian Machacek <39452430+machacekch@users.noreply.github.com>
2021-05-09 02:46:49 +00:00
mergify[bot]
0300eea0d6 Fix syscalls in the C SDK failing at runtime when compiled as C++ (#17124) (#17126)
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_)".

(cherry picked from commit 6927d0c77e)

Co-authored-by: Christian Machacek <39452430+machacekch@users.noreply.github.com>
2021-05-08 17:27:56 +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
Jack May
de9d8cd849 Rename BPF helper to syscall (#9819)
automerge
2020-04-30 01:43:11 -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
f192e4f08f Nit: Align Rust and C names (#8918) 2020-03-17 19:37:16 -07:00
Jack May
668dfc40c7 Align C and Rust handling of AccountInfos (#8906) 2020-03-17 12:34:14 -07:00
Jack May
25df95be6f Expose executable and rent_epoch in AccountInfo (#8619) 2020-03-04 10:52:09 -08:00
Jack May
059764586a Rename from account userdata to data (#8224) 2020-02-11 16:30:22 -08:00
Jack May
517fe73734 Non-conflicting account duplicate marker value (#8206) 2020-02-11 10:03:28 -08:00
Jack May
df782b93ae Add is_writable to AccountInfo (#8196) 2020-02-10 21:33:29 -08:00
Jack May
0fd795a676 Remove program error footgun and cleaner developer experience (#8042) 2020-01-31 10:58:07 -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
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
bb9649e18d Replacd todo with issue (#6823) 2019-11-08 11:48:07 -08: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
97ea75a890 Pull in solana_rbpf v0.1.14 (#5609) 2019-08-23 11:03:53 -07:00
Jack May
4177c56c51 Use real panic that reports file/line (#4758) 2019-06-20 19:10:03 -07:00
Jack May
2a7a9fdf03 Re-org SDK dir (#4690) 2019-06-17 11:04:38 -07:00