Commit Graph

15216 Commits

Author SHA1 Message Date
43e7368f3a Add more reporting for invalid stake cache members and prune them (backport #21654) (#21740)
* Add more reporting for invalid stake cache members and prune them (#21654)

* Add more reporting for invalid stake cache members

* feedback

(cherry picked from commit 6fc329180b)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	runtime/Cargo.toml
#	runtime/src/bank.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-12-10 14:13:33 -05:00
87471ed7fb reports bpf execution units without tx-wide-compute-cap feature (#21731) 2021-12-09 14:51:44 -06:00
7ac43b16d2 simulateTransaction now returns the correct error code if accounts are provided as input (#21715)
(cherry picked from commit 824994db69)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-12-09 02:19:07 +00:00
69027e3f7e Bump version to v1.8.9 (#21703) 2021-12-08 18:33:05 +01:00
32f507dc51 SDK: Add stdlib.h include to pull in abort() (backport #21700) (#21704)
* SDK: Add stdlib.h include to pull in `abort()` (#21700)

(cherry picked from commit 923720f529)

# Conflicts:
#	sdk/bpf/c/inc/sol/assert.h

* Fix merge conflict

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
v1.8.8
2021-12-08 17:26:31 +00:00
387d5af52e Bumps solana_rbpf to v0.2.17 (#21672) (#21679)
(cherry picked from commit 31b8fd3109)

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
2021-12-07 23:36:40 +00:00
eeb2bef63e Ensure we have keys to activate these features (#21669) (#21673)
(cherry picked from commit 45e56c599d)

Conflicts:
	sdk/src/feature_set.rs

Co-authored-by: Sean Young <sean@mess.org>
2021-12-07 21:15:43 +00:00
83e01442a7 Reject vote withdraws that create non-rent-exempt accounts (backport #21639) (#21644)
* Reject vote withdraws that create non-rent-exempt accounts (#21639)

* Reject vote withdraws that create non-rent-exempt accounts

* fix mocked instruction test

(cherry picked from commit e123883b26)

# Conflicts:
#	program-runtime/src/invoke_context.rs
#	programs/vote/src/vote_instruction.rs
#	sdk/src/feature_set.rs

* resolve conflicts

* fix old rust issue

Co-authored-by: Justin Starry <justin@solana.com>
2021-12-07 11:28:40 -05:00
922c74caea Fixup flaky tests (backport #21617) (#21646)
* Fix fork race condition in optimistic violation tower tests (#19192)

* Fix fork race condition in optimistic violation tower tests

* clippy

* pr comments

* Fixup flaky tests (#21617)

* Fixup flaky tests

* Fixup listeners

Co-authored-by: Ashwin Sekar <ashwin@solana.com>
Co-authored-by: carllin <carl@solana.com>
2021-12-07 05:00:49 +00:00
1ab8c01ab7 Add offline and fee-payer utilities to CLI vote module (backport #21579) (#21648)
* Add offline and fee-payer utilities to CLI vote module (#21579)

* create-vote-account: add offline, nonce, fee_payer capabilities

* vote-authorize: add offline, nonce, fee-payer

* vote-update-things: add offline, nonce, fee-payer

* withdraw-vote: add offline, nonce, fee-payer

* close-vote-acct: add fee-payer

* Allow WithdrawVoteAccount to empty account, since offline operations cannot perform account state queries as in CloseVoteAccount

* Fix lint

* Update offline-signing docs

* Add some parse unit tests

* Add offline integration test

(cherry picked from commit 873fe81bc0)

# Conflicts:
#	cli/src/cli.rs
#	cli/src/vote.rs
#	cli/tests/vote.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-12-07 02:07:26 +00:00
9959ede9ce Remove activated feature for filtering invalid stakes from rewards (#21641) (#21650)
(cherry picked from commit a1adcb23b6)

Co-authored-by: Justin Starry <justin@solana.com>
2021-12-07 00:54:41 +00:00
6d1e1287bc adds back position field to coding-shred-header (backport #21600) (#21619)
* adds back position field to coding-shred-header (#21600)

https://github.com/solana-labs/solana/pull/17004
removed position field from coding-shred-header because as it stands the
field is redundant and unused.
However, with the upcoming changes to erasure coding schema this field
will no longer be redundant and needs to be populated.

(cherry picked from commit cd17f63d81)

# Conflicts:
#	core/src/window_service.rs
#	ledger/src/blockstore.rs
#	ledger/src/shred.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-12-05 17:12:12 +00:00
b8306a99d8 Bump version to v1.8.8 (#21609) 2021-12-04 10:00:35 -07:00
6777ca244f Feature gates for rbpf v0.2.16 (#21590)
- Adds feature reject_section_virtual_address_file_offset_mismatch.
- Adds feature start_verify_shift32_imm.
- Enables enable_symbol_and_section_labels only in the rbpf-cli.
v1.8.7
2021-12-04 00:41:04 -07:00
f04e06e0c2 Bumps solana_rbpf to v0.2.16 (#21492) 2021-12-04 00:41:04 -07:00
e52b3fd1d8 Bump solana_rbpf to version v0.2.15 (#21289)
Bumps [solana_rbpf](https://github.com/solana-labs/rbpf) from 0.2.14 to 0.2.15.
- [Release notes](https://github.com/solana-labs/rbpf/releases)
- [Commits](https://github.com/solana-labs/rbpf/compare/v0.2.14...v0.2.15)

---
updated-dependencies:
- dependency-name: solana_rbpf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-04 00:41:04 -07:00
06a3e9b178 Adds a feature gate to reject the deployment of programs with unresolved syscall symbols. (#21298) 2021-12-04 00:41:04 -07:00
9d66458a40 Bump solana_rbpf to version v0.2.14 (#18869)
* Feature gate for verify_mul64_imm_nonzero as discussed in #17520.
2021-12-04 00:41:04 -07:00
765fbc9a8c Bump solana_rbpf to version 0.2.13 (#18068)
* Moves syscall_registry into the rbpf Executable constructor.

* Adds the reject_unresolved_syscalls flag which is only set when deploying programs via the CLI.
2021-12-04 00:41:04 -07:00
231a3bda8e Bump solana_rbpf to version 0.2.12 (#17585)
Unify BPF verifiers.
2021-12-04 00:41:04 -07:00
8d6b54837c Use gnu tar 2021-12-03 23:33:33 -08:00
0cefd46d9d solana-test-validator no longer limits the size of the genesis archive
When using `--clone` with a large number of accounts it is possible to
surpass the default 10MB limit

(cherry picked from commit 4dcf594856)
2021-12-03 13:52:58 -08:00
585695445f Unvendor OpenSSL for Windows to avoid CI troubles with perl.exe
(cherry picked from commit c9bfc99c72)
2021-12-03 13:03:30 -08:00
b6d040b0d7 Remove deprecated slow epoch boundary methods (backport #21568) (#21595)
* Remove deprecated slow epoch boundary methods (#21568)

(cherry picked from commit 1430b58a6d)

# Conflicts:
#	core/src/replay_stage.rs
#	core/src/tvu.rs
#	core/src/validator.rs
#	local-cluster/src/validator_configs.rs
#	runtime/src/bank.rs
#	runtime/src/stakes.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-12-03 15:54:33 -05:00
4d3352e0e0 Update OSX build to XCode 12
Vendored OpenSSL is failing to build on the Travis default OS X image
2021-12-03 10:03:15 -08:00
139d15cd84 Reformat imports to a consistent style for imports
rustfmt.toml configuration:
        imports_granularity = "One"
         group_imports = "One"
2021-12-03 09:41:09 -08:00
5a7b487e3d Ledger-tool: only require ledger dir when necessary (backport #21575) (#21578)
* Ledger-tool: only require ledger dir when necessary (#21575)

* Don't canonicalize ledger_path unless ledger_path will be used

* Single use statement

(cherry picked from commit 2b269dbe0e)

# Conflicts:
#	ledger-tool/src/main.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-12-03 03:25:56 +00:00
416fccfc01 exempts AccountsHashes from stake check (#21565) (#21570)
Otherwise getHealth fails if account hashes are not propagated.

(cherry picked from commit 9886366977)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-12-02 20:42:27 +00:00
fe923bc56c cli: always print feature version info with status query (#21554)
(cherry picked from commit 04c0f124c4)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-12-02 05:12:55 +00:00
b3904d80e6 Add missing InstructionError::IllegalOwner conversion (backport #21524) (#21548)
* Add missing InstructionError::IllegalOwner conversion (#21524)

* Add missing InstructionError code

* Add test that will fail on missing conversion

* Move enum-iterator to dev-only

(cherry picked from commit 0fc1c2e1fb)

# Conflicts:
#	Cargo.lock

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-12-02 04:19:15 +00:00
e368de5f9c Build OpenSSL statically (backport #21533) (#21541)
* Remove unused bpfloader openssl dependency

(cherry picked from commit 0212a71d3e)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	programs/bpf_loader/Cargo.toml

* Build openssl statically

(cherry picked from commit 3d21b062cc)

* rebase

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-12-01 22:05:35 +00:00
008139f506 Bump version to v1.8.7 2021-12-01 11:44:18 -08:00
e5aa5efbac Fix more BPF alignment issues on arm64 v1.8.6 2021-11-30 17:26:01 -08:00
a54fa45d5a Update builtins.rs 2021-11-30 00:55:07 -08:00
713b61677e Quash M1 build warning
(cherry picked from commit e31b469f56)

# Conflicts:
#	ledger/src/builtins.rs
2021-11-30 00:55:07 -08:00
b1bf420524 fix checks in process_vote_authorize (backport #21465) (#21486)
* fix checks in process_vote_authorize (#21465)

(cherry picked from commit 09799590ac)

# Conflicts:
#	cli/src/vote.rs

* resolve conflicts

Co-authored-by: DimAn <diman@diman.io>
Co-authored-by: Justin Starry <justin@solana.com>
2021-11-29 21:06:13 +00:00
6293b9d218 Add set_account to solana-program-test (#21415)
For writing tests, it is often desirable to create a certain situation
that would be tedious, or even impossible to create by sending
individual transactions.

For example, a common attack vector on Solana is to create a copy of
some existing account that stores configuration data, but manipulate the
data stored there, and then to call a program and pass in the
manipulated account, instead of the real account.

If one wants to test this, one option is to write a program that you can
call to write arbitrary data into a new account account (and possibly
change its owner), then include that program in the test context, and
send a transaction to call it. This is extremely tedious, and developers
are not going to bother doing it. I myself would rather fork
solana-program-test to add this `set_account` method, than to write that
program. Having a “god mode” method to just write an account, lowers the
barrier to writing comprehensive tests.

A second reason for introducing this method, is defense in depth. There
may be states of the bank that are not reachable *yet* by only sending
transactions, but that you might want to test against either way. For
example, right now, the balance of a stake account cannot decrease
without going through the stake program. But what if Solana were to
introduce slashing in the future, and you want to ensure your program is
robust against decreases in stake account balance? Right now there is no
way to test this, but by introducing this “god mode” to write accounts,
the situation becomes testable.

(cherry picked from commit e7fa412465)
2021-11-28 22:25:20 -08:00
90f791a6a9 Use underscore for hacky rust-analyzer script (#21386) (#21445)
Using dashes prevents the code from building, which is annoying
if you quickly want to test some hack.
With underscore we get the same effect but the code still builds.

(cherry picked from commit 46aed1b7f9)

Co-authored-by: Benno Fünfstück <benno.fuenfstueck@gmail.com>
2021-11-26 12:43:42 +00:00
484856e4d4 Fix transaction log collector indexing (backport #21420) (#21423)
* bank: factor tx log getter out to method on `TransactionLogCollector`

(cherry picked from commit efedb55705)

# Conflicts:
#	runtime/src/bank.rs

* bank: Add failing test for `TransactionLogCollector::get_logs_for_address()`

(cherry picked from commit dafdc15dfe)

# Conflicts:
#	runtime/src/bank.rs

* bank: don't panic when getting logs from malformed TransactionLogCollector

(cherry picked from commit e558ad4c71)

* bank: `TransactionLogCollector` - only push address mappings after pushing a log message

(cherry picked from commit 41cc7af7cd)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-11-25 08:57:37 +00:00
26f32a3288 Fix typo: a -> an (#21422) (#21424)
(cherry picked from commit 88f8c89f18)

Co-authored-by: Aiham <aiham@users.noreply.github.com>
2021-11-25 06:35:12 +00:00
6e656deb59 init: Check all releases (#21417) (#21419)
(cherry picked from commit 69e1b68fbb)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-11-25 01:45:49 +00:00
b030d4be7c Add bank drop service (#21322) (#21360)
(cherry picked from commit 0bda0c3e0c)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-11-24 16:58:42 +00:00
002693ab7d Add timing for accounts add_root (backport #21379) (#21391)
* Add timing for accounts add_root (#21379)

(cherry picked from commit c4d68063c7)

# Conflicts:
#	runtime/src/accounts.rs
#	runtime/src/accounts_db.rs

* Resolve conflicts

Co-authored-by: sakridge <sakridge@gmail.com>
Co-authored-by: Carl Lin <carl@solana.com>
2021-11-24 16:00:45 +00:00
73d469991f Use max_complete_transaction_status_slot in BigTableUploadService (#21401) (#21411)
* Use max_complete_transaction_status_slot in BigTableUploadService

* Use node root to limit BigTableUploadService

(cherry picked from commit 9e043d2055)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-11-24 02:35:42 +00:00
d4192e3ac4 Accept only decimal digits in file names inside snapshot (#21213) (#21281)
This also should make snapshot validation a bit faster.

(cherry picked from commit 9b1bf98aa2)

Co-authored-by: Ivan Mironov <mironov.ivan@gmail.com>
2021-11-23 22:36:52 +00:00
04cc50126b Bump bpf-tools to v1.20 (#21361) 2021-11-23 18:24:08 +00:00
27b2561650 Add BigTable query logs and counter (backport #21394) (#21398)
* Add BigTable query logs and counter (#21394)

* Add LedgerStorage logs

* Add storage-bigtable metric

(cherry picked from commit f3f8d2e4f3)

# Conflicts:
#	storage-bigtable/Cargo.toml

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-11-23 01:17:17 +00:00
85302d6d17 Add timing metrics to bank creation and rewards calculation (#21066) (#21378)
(cherry picked from commit cd6f931223)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-11-21 21:00:12 +00:00
42a67d30fc spl-token: New program feature flag (backport #21354) (#21376)
* spl-token: New program feature flag (#21354)

* spl-token: Add feature flag for new release

* Remove all spl token version declarations

(cherry picked from commit 02bc4e3fc1)

# Conflicts:
#	account-decoder/Cargo.toml
#	accounts-cluster-bench/Cargo.toml
#	accounts-cluster-bench/src/main.rs
#	rpc/Cargo.toml
#	rpc/src/rpc.rs
#	runtime/src/accounts_index.rs
#	runtime/src/bank.rs
#	runtime/src/lib.rs
#	sdk/src/feature_set.rs
#	tokens/Cargo.toml
#	tokens/src/spl_token.rs
#	transaction-status/Cargo.toml

* Fix merge issues

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-11-21 16:00:58 +00:00
f3ea9bc995 Fix authority in bpf_loader_upgradeable::close_any (#21344) (#21353)
(cherry picked from commit 1a7cefded7)

Co-authored-by: Kirill Fomichev <fanatid@ya.ru>
2021-11-19 09:10:48 -08:00