Commit Graph

46 Commits

Author SHA1 Message Date
Brian Anderson edd5f6f3be
Expand solana-sdk API docs. (#29063)
* Expand solana-sdk API docs.

* Update sdk/src/genesis_config.rs

Co-authored-by: Tyera <teulberg@gmail.com>

* Update sdk/src/hard_forks.rs

Co-authored-by: Tyera <teulberg@gmail.com>

* Update sdk/src/builtins.rs

Co-authored-by: Tyera <teulberg@gmail.com>

* Update sdk/src/builtins.rs

Co-authored-by: Tyera <teulberg@gmail.com>

* Update sdk/src/rpc_port.rs

Co-authored-by: Tyera <teulberg@gmail.com>

* Update sdk/src/lib.rs

Co-authored-by: Tyera <teulberg@gmail.com>

* Clarify derivation_path docs

* 'entry point' -> 'entrypoint'

Co-authored-by: Tyera <teulberg@gmail.com>
2022-12-22 08:58:06 +00:00
ananas-block afc3fee937
added alt_bn syscalls (#27961)
* added alt_bn128_syscalls

* increased regression build redundancy to > 10
2022-11-21 17:43:06 +01:00
Alexander Meißner 93fc4edef8
Refactor - derive `CloneZeroed` (#28771)
* Adds proc_macro_derive(CloneZeroed).

* Switches over all use sites of clone_zeroed() and copy_field().

* Removes clone_zeroed() and copy_field().

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-11-09 18:15:42 +01:00
Justin Starry 199398d5c4
Rename transaction v2 proposal (#28508)
Rename transactions v2 proposal to clear up versioning
2022-10-21 09:29:22 +08:00
behzad nouri f6fbc47b2d adds serde varint encoder/decoder
#[derive(Deserialize, Serialize)]
  struct Foo {
    #[serde(with = "serde_varint")]
    field: u64,
    ...
  }
2022-09-12 16:31:20 +00:00
Brian Anderson b6762fc2f9
Add more sysvar API docs (#26849)
* Add more sysvar API docs

* Remove println from examples

* Update sdk/program/src/clock.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/clock.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/clock.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/clock.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/clock.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/clock.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/clock.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/clock.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Fix docs for ACCOUNT_STORAGE_OVERHEAD

* Update sdk/program/src/epoch_schedule.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/sysvar/slot_hashes.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/sysvar/slot_history.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/sysvar/slot_history.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/sysvar/mod.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Fix docs for DEFAULT_LEADER_SCHEDULE_SLOT_OFFSET

* Fix recent_blockhash short description

* Fix whitespace

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-08-15 12:19:46 -06:00
Michael Vines ccfbc54195 Move vote program state and instructions to solana-program 2022-08-09 20:52:47 -07:00
Justin Starry 2335f6908a
Loosen CPI restrictions and charge compute for ix data len (#26653)
* Loosen CPI restrictions and charge compute for ix data len

* Address feedback

* use explicit casting

* more feedback
2022-07-24 20:20:16 +02:00
apfitzge 4940d530b8
Add static vector to get sdk ids (#25907)
* Add function to get all sdk program ids

* program_ids: use lazy_static instead of a function

* program_ids -> sdk_ids
2022-06-13 13:07:18 -05:00
Alessandro Decina 2c8a3f39a6
Consolidate syscalls under solana_program::syscalls, implement static syscalls (sbfv2) (#24188)
Move all syscall declarations under solana_program::syscalls. If the target
supports static syscalls (sbfv2), then actually define them statically to avoid
dynamic relocations.
2022-05-26 23:01:55 +10:00
Dmitri Makarov 569b00025c fix: replace rust cfg annotations that use bpf by target_os solana 2022-05-18 20:39:43 -07:00
Jack May 21e066ef26
Merge pull request from GHSA-wxrh-ff9f-fc6w 2022-05-16 12:30:37 -07:00
Brian Anderson 8dd7aa9b40
Update sysvar module short docs (#25070) 2022-05-09 05:51:17 +00:00
Brian Anderson 7206f894eb
Move solana_program::example_mocks declaration to appear last in source files (#24577) 2022-04-22 06:43:27 +00:00
Brian Anderson 658752cda7
And short descriptions to all solana-program modules and macros. (#24128)
* And short descriptions to all solana-program modules and macros.

Also fill out some of the docs within these modules.

* Update sdk/program/src/lib.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/sanitize.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/pubkey.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update hash module docs

* Make solana-program crate docs match Pubkey docs

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-04-20 19:20:17 -06:00
Ikko Ashimine ecfa1964ff
sdk: fix typo in lib.rs (#24240)
recieved -> received
2022-04-11 22:36:08 +08:00
ignassew 0c2d9194dd
Fix typo in solana-program lib.rs (#24170) 2022-04-07 11:23:54 -06:00
Justin Starry 88326533ed
Add SDK support for creating transactions with address table lookups (#23728)
* Add SDK support for creating transactions with address table lookups

* fix bpf compilation

* rename compile error variants to indicate overflow

* Add doc tests

* fix bpf compatibility

* use constant for overflow tests

* Use cfg_attr for dead code attribute

* resolve merge conflict
2022-03-31 17:44:20 +08:00
Brian Anderson c9b8977226
Add crate docs for solana-program (#23363)
* Add crate docs for solana-program

* Rework solana-program docs for pr feedback

* Clarify log module docs

* Remove address lookup table program from solana-program docs
2022-03-18 08:27:51 -07:00
Brian Anderson f7753ce85f
Document message APIs (#22873)
* Document message APIs

* Ignore clippy

* Update sdk/program/src/message/mod.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Fix new_with_blockhash example

* Rename nonce_account_address in example

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2022-02-11 11:47:36 -07:00
Michael Vines 4c577d7f8c `Bank::get_fee_for_message` is now nonce aware 2022-01-13 17:27:38 -08:00
Michael Vines 488dc37fec Add wasm bindings for `Pubkey` and `Keypair` 2021-12-09 15:53:58 -08:00
fee1-dead c4a9c8b5e9
Remove dependency on `hex` (#21567)
* Remove dependency on `hex`

* Update lock file

* Use `debug_struct` instead of own format

* Share code, add test, and fix rent_epoch spelling

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-12-03 20:53:35 -07:00
Jarred Nicholls 18a16ad956
Support building solana-program on 32-bit architectures that do not (#21577)
have 64-bit atomics by using a Mutex<u64> on 32-bit architectures.

Currently the usage of atomics are only in functions that support
tests and benchmarks.
2021-12-03 01:18:21 +00:00
Kirill Fomichev d8a392c20b
add new macro: `pubkey!` (#21245)
* add new macro: `pubkey!`

* fmt
2021-11-15 11:22:51 -08:00
Sean Young 8b9e472a6c feat: add ed25519 signature verify program
Solang requires a method for verify ed25519 signatures. Add a new
builtin program at address Ed25519SigVerify111111111111111111111111111
which takes any number of ed25519 signature, public key, and message.
If any of the signatures fails to verify, an error is returned.

The changes for the web3.js package will go into another commit, since
the tests test against a released solana node. Adding web3.js ed25519
testing will break CI.
2021-09-05 18:59:37 +01:00
Jack May eaeeffa5a3
Add macros for deprecacted ids (#18907) 2021-07-26 20:54:46 -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 d3a7e22112 sdk: refactor pda generation 2021-06-30 19:01:51 -06: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 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 8eb05d6ed4
Add Keccak256 syscall and sdk support (#16498) 2021-05-10 16:16:58 -07:00
Jeff Washington (jwash) 48c07d32f0
WritableAccount.add/subtract_lamports (#16750)
* add/sub lamports

* make add/sub return Result

* sample replacements

* cleanup

* fix up a few tests as examples

* move enum, cleanup, impl from

* fmt

* cleanup

* add lamports.rs
2021-04-23 20:20:48 +00:00
Trent Nelson 9ba9d2a8ae Allow incomplete features in frozen-abi 2021-03-30 02:32:53 +00:00
Trent Nelson 98d7673a03 sdk/program: switch allow to mod-level for integer_arithmetic lint 2021-03-17 22:23:18 -06:00
Trent Nelson 79ac1997de sdk: add macro for unchecked div with const denominator 2021-03-11 08:44:36 +00: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
Trent Nelson 7f7370c306 Re-allow clippy::integer_arithmetic at crate-level 2021-02-17 13:55:08 -07:00
Jack May 9e90394583
Upgradeable loader (#13689) 2020-12-14 15:35:10 -08:00
Michael Vines 4b65e32f22 Move Feature struct to solana-program 2020-10-30 17:57:51 -07:00
Jack May c458d4b213
move Account to solana-sdk (#13198) 2020-10-28 22:01:07 -07:00
Michael Vines dd711ab5fb Rename solana-program-sdk to solana-program 2020-10-24 08:37:55 -07:00
Michael Vines 63db324204 Initial population of solana-program-sdk 2020-10-24 08:37:55 -07:00
Michael Vines 3718771ffb Add solana-program-sdk boilerplate 2020-10-24 08:37:55 -07:00