Commit Graph

1299 Commits

Author SHA1 Message Date
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
Jack May
f84e88f0a2 Cleanup nits (#16211) 2021-03-30 12:16:21 -07:00
sakridge
54c68ea83f Drop write lock on sysvars (#15497)
* Drop write lock on sysvars

* adds env var for demoting sysvar write lock demotion

* moves demote logic to is_writable

* feature gates sysvar write lock demotion

* adds builtins to write lock demotion

* adds system program id to builtins

* adds Feature111...

* adds an abi-freeze test

* mvines set of builtin program keys

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

* update tests

* adds bpf loader keys

* Add test sysvar

* Plumb demote_sysvar to is_writable

* more plumbing of demote_sysvar_write_locks to is_writable

* patches test_program_bpf_instruction_introspection

* hard codes demote_sysvar_write_locks to false for serialization/encoding methods

* Revert "hard codes demote_sysvar_write_locks to false for serialization/encoding methods"

This reverts commit ae3e2d2e777437bddd753933097a210dcbc1b1fc.

* change the hardcoded ones to demote_sysvar_write_locks=true

* Use data_as_mut_slice

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Co-authored-by: Michael Vines <mvines@gmail.com>
2021-03-30 10:05:09 -07:00
Jeff Washington (jwash)
f4f2e781ff get rid of data copy (#16210)
* get rid of data copy

* format
2021-03-30 10:33:46 -05:00
Dmitri Makarov
658ddd1c9c Bump bpf-tools to version v1.4 (#16152) 2021-03-26 19:21:41 +00:00
Justin Starry
e817a6db00 Add timeout for local cluster partition tests (#16123)
* Add timeout for local cluster partition tests

* fix optimistic conf test logs

* Bump instruction count assertions
2021-03-25 13:27:07 -06:00
Jeff Washington (jwash)
66c42f62d8 make AccountSharedData.data private to abstract storage (#16091)
* format

* 2 more tests

* use
2021-03-25 11:04:20 -05:00
Ryo Onodera
6d5c6c17c5 Simplify account.rent_epoch handling for sysvar rent (#16049)
* Add some code for special local testing

* Add comment to store_account_and_update_capitalization

* Simplify account.rent_epoch handling for sysvar rent

* Introduce *_for_test functions

* Add deprecation messages to existing api
2021-03-25 15:23:20 +09:00
Dmitri Makarov
664ed76523 Bump bpf-tools to version v1.3 (#16068)
* Bump bpf-tools to version v1.3

This brings in the fix for increased compute budget that wasn't caught
when bpf-tools v1.2 were released.

* Adjust BPF test programs instruction counts
2021-03-24 07:16:38 +00:00
Jeff Washington (jwash)
2d24d13046 AccountsSharedData: data copy on write (#15800)
* Arc<AccountData>

* try custom serializer

* adapt test from Behzad's change

* clippy

* simplify serialization

* remove abi example derive

* refactor 'take'

* remove serialization

* remove serialize calls

* remove account_data

* remove intos

* remove left over file
2021-03-23 15:19:31 -05:00
Jeff Washington (jwash)
6f5d8d18e9 remove new alloc on deserialization (#15636) 2021-03-23 14:52:59 -05:00
Jeff Washington (jwash)
64429104b1 account data.fill replacement (#16037) 2021-03-19 15:13:20 -05:00
Dmitri Makarov
14e45155e4 Bump bpf-tools to v1.2 and get rid of xargo 2021-03-19 12:09:15 +01:00
Michael Vines
02b81dd05d Update to reqwest 0.11.2 2021-03-18 11:59:41 -07:00
Jack May
7f500d610c Add Close instrruction and tooling to upgradeable loader (#15887) 2021-03-17 21:39:29 -07:00
Jeff Washington (jwash)
d30c9ef351 refactor test truncate data (#15851)
* refactor test truncate data

* retain existing behavior
2021-03-17 15:09:26 -05:00
Trent Nelson
672e9c640f CLI: Support dumping the TX message in sign-only mode 2021-03-16 19:20:54 -06:00
Jeff Washington (jwash)
806bfdd67b set_data_from_slice (#15854)
* data_ensure_equal_to_slice

* rename and change to copy
2021-03-16 16:56:26 -05:00
Michael Vines
a2eb655322 =1.7.0 2021-03-16 07:51:07 +00:00
Jack May
ad9901d7c6 Charge compute budget for bytes passed via cpi (#15874) 2021-03-15 22:41:44 -07:00
Michael Vines
0c9ca5522c Bump version to v1.7.0 2021-03-13 09:01:21 +00:00
Jack May
cc38ae72e7 Skip deserialization of readonly accounts (#15813) 2021-03-11 19:28:21 -08:00
Jeff Washington (jwash)
952c3bcbb7 AccountSharedData construction (#15790) 2021-03-11 18:09:04 -06:00
Jeff Washington (jwash)
3419a5446e AccountSharedData.set_data (#15781)
* account.set_data and resize_data

* remove data_resize
2021-03-11 16:40:45 -06:00
Michael Vines
1061d021c9 Unpack snapshot AppendVecs directly into account paths 2021-03-11 08:25:24 -08:00
Trent Nelson
24d18b3cf2 docs: add docs links for crates published to crates.io 2021-03-11 08:38:18 +00:00
Jack May
478518308d Share RO and Executable accounts within invocations (#15799) 2021-03-10 23:04:00 -08:00
Jeff Washington (jwash)
1135ffd595 mut data refs as slice (#15782) 2021-03-10 15:28:03 -06:00
Jack May
369e13b111 cleanup old runtime features (#15787) 2021-03-10 09:48:41 -08:00
Dmitri Makarov
c5a5d7457e Bump bpf-tools to v1.1 (#15776) 2021-03-10 18:13:38 +01:00
Jeff Washington (jwash)
52e54e1100 account.data -> data() (#15778) 2021-03-09 22:31:33 +00:00
Jeff Washington (jwash)
8a3135d17b Account->AccountSharedData (#15691) 2021-03-09 15:06:07 -06:00
Jack May
efcb58092e Add more duplicate account tests (#15746) 2021-03-05 20:36:27 -08:00
dependabot-buildkite
ee621878b0 [auto-commit] Update all Cargo lock files 2021-03-05 09:06:36 -08:00
Jack May
fb3837260c Add BPf loader finalize test via inner instruction (#15708) 2021-03-04 20:34:36 +00:00
Jack May
b53cb8eb2d Deprecate Instruction::new (#15695) 2021-03-04 05:46:48 +00:00
Jeff Washington (jwash)
be35c1c1b7 add execute detail timings (#15638) 2021-03-03 17:07:45 -06:00
Yang Hau
6acb06f8d8 refactor: Use UINT64_MAX to replace hardcoded number (#15676) 2021-03-03 17:16:18 +00:00
Jack May
d73af9c1dd cli: don't overallocate upgradeable buffer accounts (#15603) 2021-03-02 00:45:53 -08:00
Tyera Eulberg
acf5e4e219 Update Cargo.lock 2021-03-02 00:53:14 -07:00
Jack May
3cd00965a7 Enable BPF program instruction traces (#15613) 2021-03-01 23:11:58 -08:00
Trent Nelson
ef63ffce7d Bump ed25519-dalek to 1.0.1 2021-03-01 21:10:46 +00:00
sakridge
8399851d11 check program owners (#15495)
* check program owners

* BankSlotDelta should change because InstructionError variant added

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-02-26 22:21:34 +00:00
Tyera Eulberg
d521dfe63c Implement OutputFormat for confirm in Cli and ledger-tool bigtable (#15528)
* Add CliTransaction struct

* Impl DisplayFormat for decode-transaction

* Add block-time to transaction println, writeln

* Impl DisplayFormat for confirm

* Use DisplayFormat in ledger-tool bigtable confirm
2021-02-25 14:15:52 -07:00