1265 Commits

Author SHA1 Message Date
mergify[bot]
3eee222667 Return error if Transaction contains writable executable or ProgramData accounts (backport #19629) (#19729)
* Return error if Transaction contains writable executable or ProgramData accounts (#19629)

* Return error if Transaction locks an executable as writable

* Return error if a ProgramData account is writable but the upgradable loader isn't present

* Remove unreachable clause

* Fixup bpf tests

* Review comments

* Add new TransactionError

* Disallow writes to any upgradeable-loader account when loader not present; remove is_upgradeable_loader_present exception for all other executables

(cherry picked from commit 38bbb77989)

# Conflicts:
#	programs/bpf/tests/programs.rs
#	runtime/src/accounts.rs
#	runtime/src/bank.rs
#	sdk/src/transaction.rs
#	storage-proto/proto/transaction_by_addr.proto
#	storage-proto/src/convert.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-09 03:06:02 +00:00
mergify[bot]
53f8e58300 Demote write locks on transaction program ids (backport #19593) (backport #19633) (#19637)
* Demote write locks on transaction program ids (backport #19593) (#19633)

* Demote write locks on transaction program ids (#19593)

* Add feature

* Demote write lock on program ids

* Fixup bpf tests

* Update MappedMessage::is_writable

* Comma nit

* Review comments

(cherry picked from commit decec3cd8b)

# Conflicts:
#	core/src/banking_stage.rs
#	core/src/cost_model.rs
#	core/src/cost_tracker.rs
#	ledger-tool/src/main.rs
#	program-runtime/src/instruction_processor.rs
#	programs/bpf/tests/programs.rs
#	programs/bpf_loader/src/syscalls.rs
#	rpc/src/transaction_status_service.rs
#	runtime/src/accounts.rs
#	runtime/src/bank.rs
#	runtime/src/message_processor.rs
#	sdk/benches/serialize_instructions.rs
#	sdk/program/src/message/mapped.rs
#	sdk/program/src/message/sanitized.rs
#	sdk/src/transaction/sanitized.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
(cherry picked from commit fcda5d4a7d)

# Conflicts:
#	cli-output/src/display.rs
#	core/src/transaction_status_service.rs
#	program-test/src/lib.rs
#	programs/bpf_loader/src/syscalls.rs
#	runtime/src/accounts.rs
#	runtime/src/bank.rs
#	runtime/src/message_processor.rs
#	sdk/benches/serialize_instructions.rs
#	sdk/program/src/message.rs
#	sdk/src/feature_set.rs
#	transaction-status/src/parse_accounts.rs

* Replace feature and fix conflicts

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-04 09:10:57 +00:00
sakridge
715c5e64c4 Bump version to 1.6.23 (#19447) 2021-08-26 18:09:15 +00:00
Trent Nelson
011fe72aa2 Bump version to v1.6.22 2021-08-18 22:08:12 -06:00
Tyera Eulberg
4d77ac1688 Bump version to v1.6.21 (#18953) 2021-07-28 23:47:03 +00:00
Jon Cinque
007c49ff2b feature: add new token program feature (v1.6 backport of #18780) (#18804)
* feature: add new token program feature

* Fixup test

* Cargo fmt

* Add back whitespace for cargo fmt

* Revert file totally
2021-07-21 21:58:28 +02:00
Jon Cinque
ba8426e0fd 1.6: Bump crates to 1.6.20 (#18805) 2021-07-21 17:44:41 +02:00
Trent Nelson
d7b381c90c Bump version to v1.6.19 2021-07-17 08:57:44 +00:00
Trent Nelson
3dbdaa5341 Bump version to v1.6.18 2021-07-16 09:57:58 +00:00
Trent Nelson
49ac17a595 nonce: Unify NonceError with SystemError 2021-07-16 01:35:38 -06:00
mergify[bot]
63d7fdb4bd Gate libsecp256k1 update (backport #18656) (#18700)
* hijack secp256k1 enablement feature plumbing for libsecp256k1 upgrade

* Bump libsecp256k1 to v0.5.0

* gate libsecp256k1 upgrade to v0.5.0

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-16 03:34:13 +00:00
mergify[bot]
88c5d6b10c featurize_policy_update (backport #18492) (#18501)
* featurize_policy_update (#18492)

(cherry picked from commit ccdf93e2b8)

# Conflicts:
#	runtime/benches/message_processor.rs
#	runtime/src/message_processor.rs

* fix conflicts

* nudge

Co-authored-by: Jack May <jack@solana.com>
2021-07-08 22:21:37 +00:00
mergify[bot]
9a7ea1229b Add vote/stake checked instructions (backport #18345) (#18456)
* Add vote/stake checked instructions

(cherry picked from commit ee219ffa47)

# Conflicts:
#	programs/stake/src/stake_instruction.rs
#	sdk/program/src/stake/instruction.rs
#	sdk/src/feature_set.rs

* Fix set-lockup custodian index

(cherry picked from commit 544f62c92f)

* Add parsing for new stake instructions; clean up confusing test args

(cherry picked from commit 9b302ac0b5)

# Conflicts:
#	transaction-status/src/parse_stake.rs

* Add parsing for new vote instructions

(cherry picked from commit 39bac256ab)

* Add VoteInstruction::AuthorizeChecked test

(cherry picked from commit b8ca2250fd)

* Add Stake checked tests

(cherry picked from commit 74e89a3e3e)

# Conflicts:
#	programs/stake/src/stake_instruction.rs

* Fix conflicts and accommodate old apis in backport

Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-07-07 03:14:54 +00:00
Trent Nelson
6859516126 sdk: add is_interactive() method Signer trait
(cherry picked from commit 2af5ec4f57)
2021-07-06 11:13:53 -07:00
mergify[bot]
9a5a9ff633 SDK: Add test for illegal Pubkey::create_with_seed owners (#18401)
(cherry picked from commit 216983c50e)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-03 01:10:39 +00:00
sakridge
06b1c980d4 Bump version to v1.6.17 (#18393) 2021-07-02 19:40:37 +00:00
Trent Nelson
31dc79a4f9 Bump version to v1.6.16 2021-06-30 22:53:51 -06:00
mergify[bot]
df8cf37b89 test-validator: hold rent constant with --slots-per-epoch (#18317)
(cherry picked from commit 02b14caa5f)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-06-30 08:30:39 +00:00
mergify[bot]
6b9a529cda Bump borsh from 0.8.1 to 0.9.0 (backport #18230) (#18237)
* Bump borsh from 0.8.1 to 0.9.0 (#18230)

(cherry picked from commit 7ed2cf30a5)

# Conflicts:
#	programs/bpf/Cargo.lock

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-25 23:10:01 +00:00
mergify[bot]
12eea11f93 Add entrypoint to run CI locally (backport #18131) (#18216)
* ci: use versioned cargo wrapper for crate ordering

(cherry picked from commit 554002b73c)

* ci: nvidia persistence mode isn't a hard requirement

(cherry picked from commit f213e48067)

* sdk: ensure `ld` can find criterion when running BPF tests

(cherry picked from commit 7ee39fcb0f)

* ci: give localnet nodes a more time to startup

(cherry picked from commit 278a241db3)

* ci: add downstream build wrapper

(cherry picked from commit 761e324982)

* ci: add wrapper script for running ci locally

Linux only for now

(cherry picked from commit 0bc38153ca)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-06-25 05:18:15 +00:00
Trent Nelson
37f618fc62 programs/config: Disallow duplicate signers 2021-06-22 23:04:24 -06:00
mergify[bot]
86ff6f82f8 chore(pubkey): remove dead code (#18161)
(cherry picked from commit 755b7c7aee)

Co-authored-by: hrls <viktor.kharitonovich@gmail.com>
2021-06-23 03:12:30 +00:00
mergify[bot]
57baf7f79b Add memory operation syscalls (backport #16447) (#18149)
* Add memory operation syscalls (#16447)

(cherry picked from commit 2b50529265)

# Conflicts:
#	programs/bpf/Cargo.lock
#	programs/bpf/rust/sysvar/tests/lib.rs
#	programs/bpf/tests/programs.rs
#	programs/bpf_loader/src/syscalls.rs
#	sdk/src/feature_set.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-06-22 19:57:51 +00:00
mergify[bot]
e259388069 Move stake_weighted_timestamp module (backport #18114) (#18119)
* Move stake_weighted_timestamp module (#18114)

* Move timestamp module into runtime

* Less public

* Remove unused enum

(cherry picked from commit 19fe1dd463)

# Conflicts:
#	runtime/src/bank.rs
#	runtime/src/lib.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-22 00:28:02 +00:00
Trent Nelson
06d6e357ae Bump version to v1.6.15 (#18108) 2021-06-21 14:23:43 -06:00
Trent Nelson
0ed9f7144c sdk: refactor pda generation 2021-06-21 10:16:49 -06:00
mergify[bot]
4aedc086e5 fix loader instruction checker (#18047) (#18073)
(cherry picked from commit d18e02ef44)

Co-authored-by: Jack May <jack@solana.com>
2021-06-18 21:06:23 +00:00
Tyera Eulberg
1201ef172e Bump version to v1.6.14 (#18050) 2021-06-17 20:42:10 +00:00
Ryo Onodera
337de51088 Bump version to v1.6.13 (#17972) 2021-06-15 23:47:22 +09:00
mergify[bot]
b777bbf7db system-program: Remove zero lamport check on transfers (backport #17726) (#17763)
* system-program: Remove zero lamport check on transfers (#17726)

* system-program: Move lamports == 0 check on transfers

* Address feedback

* Update stake split to explicitly allocate + assign

* Update stake tests referring to split instruction

* Revert whitespace

* Update split instruction index in test

* Remove unnecessary `assign_with_seed` from `split_with_seed`

* Fix stake instruction parser

* Update test to allow splitting into account with lamports

(cherry picked from commit 8f5e773caf)

# Conflicts:
#	runtime/src/system_instruction_processor.rs
#	sdk/src/feature_set.rs

* Resolve merge conflicts

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-06-07 12:55:57 +00:00
Tyera Eulberg
3a3454d788 Bump version to v1.6.12 (#17651) 2021-06-01 21:40:36 -06:00
Jack May
6a2377dd50 Disable read-only optimization features (#17583)
* Disable RO optimization features

* nudge
2021-05-28 21:55:37 +00:00
Tyera Eulberg
ae1687bc0a Bump version to v1.6.11 (#17484) 2021-05-25 15:35:50 -06:00
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]
3f6964d264 InvokeContext: Add get_sysvar() helper to sdk (backport #17360) (#17368)
* Add get_sysvar() helper to sdk

(cherry picked from commit 2c99b23ad7)

# Conflicts:
#	runtime/src/message_processor.rs
#	sdk/src/process_instruction.rs

* Resolve conflicts

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-21 03:42:20 +00:00
mergify[bot]
b1d294de75 Add stake_program_v4 feature (#17356)
(cherry picked from commit a1a0d6f84b)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-20 22:32:30 +00:00
Tyera Eulberg
409ac4dcfa Bump version to v1.6.10 (#17250) 2021-05-15 01:47:56 +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]
9753f1a6ca Add bip32 support to solana-keygen recover (#17180) (#17189)
* Fix spelling

* Add validator for  SignerSources

* Add helper to generate Keypair from supporting SignerSources

* Add bip32 support to solana-keygen recover

* Make SignerSourceKind const strs, use for Debug impl and URI schemes

(cherry picked from commit b437b0a49d)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-12 20:48:53 +00:00
mergify[bot]
21d41b976b Move Signer types out of the signature module (backport #17099) (#17177)
* sdk: Move `Signer` trait to own module

(cherry picked from commit af6f3d776e)

* sdk: Move `Keypair` to `signer` module

(cherry picked from commit 0eba6eb401)

* sdk: Move `Presigner` to `signer` module

(cherry picked from commit 12bf6c06c3)

* sdk: Move `NullSigner` to `signer` module

(cherry picked from commit b71e4bdc61)

* sdk: Move `signers` module into `signer` module

(cherry picked from commit 967840aed6)

* sdk: keypair - drop superfluous iter()

(cherry picked from commit dbac38702a)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-11 20:44:54 +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]
f91d7da5a4 sdk: Add get_instance_packed_len for variable-size types (#17092) (#17153)
* sdk: Add get_instance_packed_len for variable-size types

* Add comment for get_packed_len

* Add more tests

(cherry picked from commit 4b60b2863e)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-05-11 09:16:14 +00:00
mergify[bot]
a7b2939bc8 SignerSource: rename input scheme to prompt, default to bip44 solana base key (#17154) (#17159)
* Rename ask to prompt

* Default to Solana bip44 base if no derivation-path

* Add SignerSource legacy field, support legacy ASK

* Update docs

* Fix docs: validator current doesn't support uri SignerSources

(cherry picked from commit a5ec3a0547)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-11 02:43:49 +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
Michael Vines
65e1b881f9 Bump version to v1.6.9 2021-05-08 06:28:08 +00:00
mergify[bot]
7600be946a SDK: Factor out pubkey on-curve test to a helper (#16935)
(cherry picked from commit cfc1cb1aee)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-05 06:19:19 +00:00
Michael Vines
524b380a71 Bump version to 1.6.8 2021-05-04 12:46:57 -07:00
Ruud van Asseldonk
e8fff4561e Document that Transaction::sign might panic (#17026)
(cherry picked from commit 9abfa65920)
2021-05-04 09:06:36 -07:00