Commit Graph

1342 Commits

Author SHA1 Message Date
Jeff Washington (jwash)
a7070a5ca7 set_lamports() (#16921) 2021-04-28 21:30:06 +00:00
Jeff Washington (jwash)
8dc15f727c account.lamports -= (#16913) 2021-04-28 15:47:59 -05:00
Jeff Washington (jwash)
82e11588a5 lamports -> lamports() (#16915) 2021-04-28 14:55:55 -05:00
Jeff Washington (jwash)
a7a671b3aa AccountSharedData.set_executable() (#16881) 2021-04-28 14:07:43 +00:00
Jeff Washington (jwash)
2021255f91 executable() (#16880) 2021-04-28 08:53:54 -05:00
Trent Nelson
64fcb792c2 remote-wallet: Add helpers for locating remote wallets 2021-04-27 17:54:02 -06:00
Jack May
9b3a59f030 Retain alloc'd and updated data in cpi (#16850) 2021-04-27 13:36:42 -07:00
Jeff Washington (jwash)
1bd623cd15 private AccountSharedData.rent_epoch (#16844) 2021-04-27 13:51:13 -05:00
Jeff Washington (jwash)
69bfbf9e98 AccountSharedData.set_executable (#16836) 2021-04-27 09:56:50 -05:00
Jeff Washington (jwash)
3887169db0 lamports += to checked_add (#16841) 2021-04-27 09:56:18 -05:00
Jeff Washington (jwash)
998cba74b5 AccountSharedData.executable() (#16835) 2021-04-27 09:12:17 -05:00
Jeff Washington (jwash)
4e7e675c07 lamports += -> checked_add_lamports (#16791) 2021-04-27 09:11:35 -05:00
Jeff Washington (jwash)
603872685d private AccountSharedData.owner (#16760)
* private AccountSharedData.owner

* fix perf test
2021-04-26 14:59:17 -05:00
Jeff Washington (jwash)
f2ab0384e4 owner -> owner() (#16783) 2021-04-26 17:06:40 +00:00
Jeff Washington (jwash)
aeff911c93 owner -> owner() (#16784) 2021-04-26 10:40:11 -05:00
Jeff Washington (jwash)
6d160768d7 delete vest program (#16795) 2021-04-26 08:50:46 -05:00
Jeff Washington (jwash)
ca14c18998 owner -> owner() (#16782) 2021-04-23 22:49:47 +00:00
Jeff Washington (jwash)
1a4a7059af owner -> owner() (#16785) 2021-04-23 15:59:13 -05: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
Jeff Washington (jwash)
fb0b76c1f3 account.owner = X -> account.set_owner(X) (#16754) 2021-04-23 12:34:22 -05:00
Jeff Washington (jwash)
87e2e07d34 AccountSharedData.copy_into_owner_from_slice (#16755) 2021-04-23 09:34:08 -05:00
Jack May
be4df39a4c Remove unactivated ristretto syscall (#16727) 2021-04-22 09:29:42 -07:00
Sebastian Bor
1a658c7f31 Allow SetUpgradeAuthority instruction in CPI calls (#16676)
* feat: allow SetAuthority in CLI calls

* chore: clippy match_like_matches_macro

* chore: clippy match_like_matches_macro

* chore: rename CLI to CPI

* chore: move check for cpi authorised instruction to syscalls

* chore: add set_upgrade_authority cpi test

* chore: assert upgrade authority was changed

* feat: gate set_upgrade_authority via cpi with a feature

* chore: move feature to the end of the list

* chore: remove white spaces

* chore: remove white spaces

* chore: update comment to rerun build
2021-04-22 00:06:59 +01:00
Jeff Washington (jwash)
03f7b251b8 ReadableAccount.data returns slice (#16686)
* ReadAbleAccount.data returns slice

* more slice fixup

* more slice

* slice
2021-04-20 16:41:16 -05:00
Jack May
08d5253651 Enforce host aligned memory for program regions (#16590) 2021-04-20 11:07:30 -07:00
Tyera Eulberg
185bbf2db5 Wrap derivation_path::DerivationPath (#16609)
* Replace custom DerivationPath impl

* Add method to parse full-path from str with hardening

* Convert Bip44 to trait

* Hoist more work on derivation-path

* Privatize Bip44 trait
2021-04-19 20:57:43 +00:00
Jack May
2409bb18f3 Remove unwrap from bpf_loader serialization (#16645) 2021-04-19 13:30:31 -07:00
Alexander Meißner
9dfcb921cf Refactoring: Move KeyedAccounts to InvokeContext (#15410)
Collects all parametric occurrences and the construction of keyed_accounts and puts them into InvokeContext.
2021-04-19 18:48:48 +02:00
Michael Vines
a911ae00ba clippy 2021-04-18 20:55:02 -07:00
Trent Nelson
5d1ef5d01d clap-utils: Use uriparse crate to parse SignerSource 2021-04-16 13:56:12 -06:00
Jack May
74f58376f8 Expand and update instruction count tests (#16522) 2021-04-13 16:23:42 -07:00
Michael Vines
f7eadd9d70 bump solana_rbpf from 0.2.5 to 0.2.7 (#16515) 2021-04-13 14:49:09 -07:00
Dmitri Makarov
db3bca7edd Add llvm feature option to compile for Solana BPF target (#16495) 2021-04-13 07:20:18 +00:00
Justin Starry
85eb37fab0 Merge pull request from GHSA-8v47-8c53-wwrc
* Track transaction check time separately from account loads

* banking packet process metrics

* Remove signature clone in status cache lookup

* Reduce allocations when converting packets to transactions

* Add blake3 hash of transaction messages in status cache

* Bug fixes

* fix tests and run fmt

* Address feedback

* fix simd tx entry verification

* Fix rebase

* Feedback

* clean up

* Add tests

* Remove feature switch and fall back to signature check

* Bump programs/bpf Cargo.lock

* clippy

* nudge benches

* Bump `BankSlotDelta` frozen ABI hash`

* Add blake3 to sdk/programs/Cargo.lock

* nudge bpf tests

* short circuit status cache checks

Co-authored-by: Trent Nelson <trent@solana.com>
2021-04-13 00:28:08 -06:00
Jack May
fa83f3bd73 Return sysvars via syscalls (#16422) 2021-04-12 16:04:57 -07:00
carllin
dc7030ffaa Allow fork choice to support multiple versions of a slot (#16266) 2021-04-12 01:00:59 -07:00
Christian Drappi
54a04bac3d Apple M1 compatibility (#16346)
Co-authored-by: Christian Drappi <christiandrappi@Christians-MacBook-Pro.local>
2021-04-09 17:21:01 -07:00
François Garillot
b08cff9e77 Simplify some pattern-matches (#16402)
When those match an exact combinator on Option / Result.

Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust).
2021-04-08 12:40:37 -06:00
Jack May
476fd40948 Add program-test tests to bpf programs (#16407) 2021-04-07 01:47:15 -07:00
Jack May
92f4018b07 Cleanup unsupported sysvars (#16390)
* Cleanup unsupported sysvars

* fix ser description
2021-04-06 00:08:03 -07:00
Tyera Eulberg
03d3ae1cb9 Faucet: repurpose cap and slice args to apply to single IPs (#16381)
* Single use stmt

* Log request IP

* Switch cap and slice to apply per IP

* Use SOL in logs, error msgs

* Use thiserror instead of overloading io::Error

* Return memo transaction for requests that exceed per-request-cap

* Handle faucet memos in cli

* Add some docs, esp about memo transaction

* Use SOL symbol & standardize memo

Co-authored-by: Michael Vines <mvines@gmail.com>

* Differentiate faucet tx-length errors

* Populate signature in cli airdrop memo case

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-04-06 07:01:05 +00:00
Tyera Eulberg
ae7bc8299d Use spl-memo v3.0.1 (#16384)
* Use memo v3.0.1, which simplifies id imports

* tree
2021-04-06 02:06:44 +00:00
Michael Vines
9360e57816 Fix build 2021-04-05 17:12:31 -07:00
Michael Vines
a4f0d8636a RpcClient no longer panics in a tokio multi-threaded runtime 2021-04-05 16:50:03 -07:00
bji
364af3a3e0 issue #10831: added --with-memo option to all cli commands that submit (#16291)
* issue #10831: added --with-memo option to all cli commands that submit
transactions.  Also, improve the block command to show UTF-8 string instead
of integer values for memo program data.

* Fixed tests and changed some syntax according to feedback.

* Use spl_memo id (all versions where applicable) instead of hardcoding id.

* Update Cargo.toml in programs/bpf.

* Update formatting via cargo fmt.

* Update to use spl_memo version 3.0.1, which simplifies package imports
2021-04-05 20:53:50 +00:00
Dmitri Makarov
1359bceb5d Bump bpf-tools to version v1.5 (#16331)
The new version of bpf-tools eliminates the separate
rust-bpf-sysroot. The Rust standard libraries for the BPF target are
built in tree when the compiler is built.  The standard libraries code
is slightly more optimized and some reduction of compute budget can be
expected with this version of bpf-tools.
2021-04-04 13:04:22 +00:00
Jack May
dee655df35 Cleanup use (#16327) 2021-04-02 08:54:09 -07:00
Tyera Eulberg
a902505810 Parse SPL associated-token-account instructions (#16318) 2021-04-01 22:48:05 +00:00
behzad nouri
3f63ed9a72 removes OrderedIterator and transaction batch iteration order (#16153)
In TransactionBatch,
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/transaction_batch.rs#L4-L11
lock_results[i] is aligned with transactions[iteration_order[i]]:
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/bank.rs#L2414-L2424
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/accounts.rs#L788-L817

However load_and_execute_transactions is iterating over
  lock_results[iteration_order[i]]
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/bank.rs#L2878-L2889
and then returning i as for the index of the retryable transaction.

If iteratorion_order is [1, 2, 0], and i is 0, then:
  lock_results[iteration_order[i]] = lock_results[1]
which corresponds to
  transactions[iteration_order[1]] = transactions[2]
so neither i = 0, nor iteration_order[i] = 1 gives the correct index for the
corresponding transaction (which is 2).

This commit removes OrderedIterator and transaction batch iteration order
entirely. There is only one place in blockstore processor which the
iteration order is not ordinal:
https://github.com/solana-labs/solana/blob/e50f59844/ledger/src/blockstore_processor.rs#L269-L271
It seems like, instead of using an iteration order, that can shuffle entry
transactions in-place.
2021-03-31 23:59:19 +00:00
Jack May
ad7f8e7f23 Use more performant copy (#16282) 2021-03-31 16:52:58 -07:00