78 Commits

Author SHA1 Message Date
mergify[bot]
7427dafc36 feature: add new token program feature (backport #18780) (#18803)
* feature: add new token program feature (#18780)

* feature: add new token program feature

* Fixup test

* Update to spl-token v3.2.0

* Update Cargo.lock + fmt

* Update token program version in fetch-spl.sh

* Bump associated token program to 1.0.3

* Add aToken so

(cherry picked from commit 51f3b9aa7c)

# Conflicts:
#	Cargo.lock
#	account-decoder/Cargo.toml
#	accounts-cluster-bench/Cargo.toml
#	programs/bpf/Cargo.lock
#	rpc/Cargo.toml
#	sdk/src/feature_set.rs
#	tokens/Cargo.toml
#	transaction-status/Cargo.toml

* Fix merge issues

* Re-generate lock files

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-07-21 15:05:45 +00:00
Trent Nelson
19049ca91b Bump version to v1.7.7 2021-07-17 08:42:22 +00:00
sakridge
551dc0a74c Bump 1.7 version (#18723) 2021-07-16 09:43:18 -06:00
mergify[bot]
5321463892 Refactoring: Unify account_deps and accounts (backport #17898) (#18486)
* Refactoring: Unify account_deps and accounts (#17898)

* Changes ThisInvokeContext::get_account() to use accounts instead of pre_accounts.

* Adds explicit keys to accounts to make them symmetric to account_deps.

* Appends account_deps to accounts in transaction loading and removes account_deps everywhere else.

(cherry picked from commit 7462c27d07)

# Conflicts:
#	program-test/src/lib.rs
#	runtime/src/bank.rs
#	runtime/src/message_processor.rs

* fix conflicts

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
Co-authored-by: Justin Starry <justin@solana.com>
2021-07-07 17:14:39 +00:00
mergify[bot]
72ed4f28b1 Remove feature switch for demoting sysvar write locks (#18373) (#18454)
Co-authored-by: Justin Starry <justin@solana.com>
2021-07-06 23:25:28 +00:00
Trent Nelson
4466aa39c4 Bump version to v1.7.5 2021-06-30 22:55:01 -06:00
Trent Nelson
597429ab3e Bump version to v1.7.4 2021-06-22 19:57:34 +00:00
mergify[bot]
0e7512a225 Fix Nightly Clippy Warnings (backport #18065) (#18070)
* chore: cargo +nightly clippy --fix -Z unstable-options

(cherry picked from commit 6514096a67)

# Conflicts:
#	core/src/banking_stage.rs
#	core/src/cost_model.rs
#	core/src/cost_tracker.rs
#	core/src/execute_cost_table.rs
#	core/src/replay_stage.rs
#	core/src/tvu.rs
#	ledger-tool/src/main.rs
#	programs/bpf_loader/build.rs
#	rbpf-cli/src/main.rs
#	sdk/cargo-build-bpf/src/main.rs
#	sdk/cargo-test-bpf/src/main.rs
#	sdk/src/secp256k1_instruction.rs

* chore: cargo fmt

(cherry picked from commit 789f33e8db)

* Updates BPF program assert_instruction_count tests.

(cherry picked from commit c1e03f3410)

# Conflicts:
#	programs/bpf/tests/programs.rs

* Resolve conflicts

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
Co-authored-by: Michael Vines <mvines@gmail.com>
2021-06-18 20:02:48 +00:00
Stephen Akridge
d159ae9342 Bump version to v1.7.3 2021-06-17 15:34:50 -06:00
Jon Cinque
0c90307677 v1.7: Stake refactor (Manual backport of #17906) (#17978)
* 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

* Run cargo fmt post cherry-pick
2021-06-15 23:43:22 +02:00
Ryo Onodera
48e565038a Bump version to v1.7.2 (#17831) 2021-06-08 10:29:39 +00:00
mergify[bot]
6d5a4b5cce Document ProgramTest::new and fix ProgramTest::add_program (#17754) (#17768)
* document ProgramTest::new

* simplify ProgramTest::new doc-string

* make ProgramTest::add_program noisier

`add_program` (and `new`, implicitly) now prints a warning when the user
supplies a bogus program name to a ProgramTest and invokes `test-bpf`.

Additionally, it is now impossible to ask for a regular `test` and for
the generated ProgramTest to load BPF code instead of native code.
Previously, this was caused by a precedence issue: BPF code would always
be preferred over native if the program name was valid, regardless of
user choice.

(cherry picked from commit 2aaf55795f)

Co-authored-by: xuoe <alex@psi.io>
2021-06-06 07:03:13 +00:00
Michael Vines
975c942ea7 Bump version to v1.7.1 2021-06-02 05:21:14 +00:00
mergify[bot]
add3fd479d chore: bump chrono-humanize from 0.1.1 to 0.2.1 (#16895) (#17549)
* chore: bump chrono-humanize from 0.1.1 to 0.2.1

Bumps [chrono-humanize](https://gitlab.com/imp/chrono-humanize-rs) from 0.1.1 to 0.2.1.
- [Release notes](https://gitlab.com/imp/chrono-humanize-rs/tags)
- [Commits](https://gitlab.com/imp/chrono-humanize-rs/compare/0.1.1...0.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <anatoly+githubjenkins@solana.io>
(cherry picked from commit 4f74c77146)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-27 20:37:42 +00:00
Sebastian.Bor
6d11d5dd9f chore: conflate use statement 2021-05-04 08:34:35 -07:00
Sebastian.Bor
4ede5117f9 fix: add bpf_loader_upgradeable to ProgramTest default builtins 2021-05-04 08:34:35 -07:00
Jeff Washington (jwash)
59e19828ea set_lamports() (#16914) 2021-04-29 10:43:26 -05:00
Jeff Washington (jwash)
82e11588a5 lamports -> lamports() (#16915) 2021-04-28 14:55:55 -05:00
Jeff Washington (jwash)
ca14c18998 owner -> owner() (#16782) 2021-04-23 22:49:47 +00:00
Jon Cinque
f4214637a9 program-test: Add large bootstrap stake for realistic warmups (#16739) 2021-04-22 16:44:54 +02:00
Jack May
05fa7250b0 Selectable jit in program-test (#16685) 2021-04-20 15:02:54 -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
Jack May
fa83f3bd73 Return sysvars via syscalls (#16422) 2021-04-12 16:04:57 -07:00
Jeff Washington (jwash)
105a6bfb46 Replace RootsTracker HashSet (#16310)
* Replace RootsTracker HashSet

* use bitvec

* cleanup, add brenchmark test

* test cleanup

* add lots of tests

* get rid of demo

* change warp test constant

* get rid of unused function

* pr feedback

* reorder use

* rework get_all to remove range checks

* add tests, fix bugs
2021-04-12 12:11:33 -05:00
Justin Starry
278c125d99 Fix account copy step in program test message processor (#16469) 2021-04-11 07:59:43 +00:00
Michael Vines
43feef7362 Adjust tokio version to just "1" 2021-04-05 17:13:20 +00:00
Jack May
dee655df35 Cleanup use (#16327) 2021-04-02 08:54:09 -07: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
ce7f7c2b6c Align ProcessInstruction error handling (#16232) 2021-03-30 13:41:04 -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
Justin Starry
27ab415ecc Fix handling of invoked ix accounts in program-test (#16170) 2021-03-29 08:42:11 +08:00
Jon Cinque
6cc22e62d4 program-test: Fix warp and staking issue (#16002)
Since program-test creates a test genesis and then adds fees and rent,
some of the genesis accounts get rent-collected after warping.  Most
notably, `StakeConfig` gets rent-collected, causing any stake operations
to fail after warp.  This fix creates genesis with the `Rent` and
`FeeRateGovernor` actually used by the bank.
2021-03-19 14:37:13 +01:00
Michael Vines
03180b502d Avoid changing signature of ProgramTest::add_account 2021-03-17 13:21:43 -07:00
Michael Vines
a2eb655322 =1.7.0 2021-03-16 07:51:07 +00:00
Michael Vines
430ed6d774 Export tokio for program-test clients 2021-03-15 20:03:55 -07:00
Jeff Washington (jwash)
e50f284658 use Account for test since it borrows mut ref to data (#15852) 2021-03-15 21:56:48 -05:00
Michael Vines
0c9ca5522c Bump version to v1.7.0 2021-03-13 09:01:21 +00: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
Jack May
478518308d Share RO and Executable accounts within invocations (#15799) 2021-03-10 23:04:00 -08: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
b53cb8eb2d Deprecate Instruction::new (#15695) 2021-03-04 05:46:48 +00:00
Jack May
3cd00965a7 Enable BPF program instruction traces (#15613) 2021-03-01 23:11:58 -08:00
Michael Vines
5df36aec7d Pacify clippy 2021-02-19 20:08:41 -08:00
Michael Vines
995bd0cb6b Rename IOError to BorshIoError 2021-02-19 10:54:39 -08:00
Justin Starry
7b67a6d208 Load memo v2 into genesis for test validator (#15425)
* Load memo v2 into genesis for test validator

* feedback

* versions

* remove .so

* add .so
2021-02-19 15:59:31 +08: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