Commit Graph

130 Commits

Author SHA1 Message Date
mergify[bot] 0e50e66a30
v2.1: test-validator: Fix upgradeable programs at genesis (backport of #3692) (#3694)
test-validator: Fix upgradeable programs at genesis (#3692)

#### Problem

As noted in
https://solana.stackexchange.com/questions/17478/solana-localnet-error-while-upgrading-a-program-loaded-at-genesis-using-solan,
an upgradeable program loaded at genesis is not actually upgradeable,
failing with `instruction changed executable accounts data`. This is
because the program-data account is incorrectly set as "executable",
which it isn't really.

#### Summary of changes

Don't set the program-data account as executable. This is the only place
in the repo where we were doing this incorrectly.

(cherry picked from commit 73f54a05ac38228b1d86504041a17efcb46d6468)

Co-authored-by: Jon C <me@jonc.dev>
2024-11-18 23:19:04 +01:00
mergify[bot] adeac02216
v2.1: SIMD-0075: Precompile for Secp256r1 (backport of #3152) (#3662)
* SIMD-0075: Precompile for Secp256r1 (#3152)

* feat: secp256r1 precompile

* add: num_signatures == 0 check from SIMD-0152

* rm: unnecessary comment

* fix: legacy numeric constant

* CI/fix: compilation for wasm32 target

* Extract secp256r1 crate

* rm: unnecessary import

* update: sbf/Cargo.lock

* rm: unnecesary re-exports

* add: secp256r1 precompile to docs

* add: docs/description to sdk/program/src/lib.rs

* fix: alpha sort deps

* fixes

* docs fixes

* add: solana-instruction std feature to deps

* fix: lockfile from rebase

* fix: target architecture

* fix: workflow for client_target android

* add: sudo to workflow perl install

* fix: Cargo toml workspace member

* modify: ranlib path in client-targets.yaml

* fix: secp256r1/Cargo.toml formatting

* add: openssl feature

* fixes

* add: precompile signature range error

* more adjustments

* change: feature id

* fix: cargo format

* Revert "add: precompile signature range error"

This reverts commit fdf76739af10828d8c01d59b0cb912a1b044aaa2.

* fix: cargo sanity

* fix: client target openssl dep

* fix: 31 byte r,s support in new_secp256r1_instruction

* update: Cargo.lock

* fix: unchecked math in new_secp256r1_instruction

* fixes & increased test coverage

* add: solana-sdk/openssl to all release binaries

* update: comment to make openssl feature more clear

* add: solana-sdk/openssl feature to dependencies

* add: solana-sdk/openssl feature to dependencies

* merge: master into secp256r1-precompile

* fix: test-validator formatting

* Revert "add: solana-sdk/openssl to all release binaries"

This reverts commit 5c66b508be3a4324c9b7c8d93a81e41dc47c4312.

* add: reserved key for secp256r1 program

* modify: client-targets.yaml

* modify: client/Cargo.toml solana-sdk dep

* modify: ledger-tool/Cargo.toml solana-sdk

* modify: test-validator/Cargo.toml solana-sdk dep

* modify: validator/Cargo.toml solana-sdk dep

* change: openssl feature to openssl-vendored

* remove: solana-sdk dep from sdk/program

* refactor: secp256r1 directory name

* fmt

* cargo.lock files

* revert: rustc-demangle bump

* cargo lock sanity

* fix: faulty feature-set merge

* fix: reserved keys pending feature id

---------

Co-authored-by: Iceomatic <89707822+iceomatic@users.noreply.github.com>
(cherry picked from commit da4f55ef4e04aebb5f3590127f98c03ca5881b28)

# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	ledger-tool/Cargo.toml
#	programs/sbf/Cargo.lock
#	sdk/Cargo.toml
#	sdk/feature-set/src/lib.rs
#	sdk/reserved-account-keys/Cargo.toml
#	sdk/src/reserved_account_keys.rs

* Fix merge conflicts

---------

Co-authored-by: Orion <89707822+0xRigel@users.noreply.github.com>
Co-authored-by: Jon C <me@jonc.dev>
2024-11-16 07:28:35 +09:00
mergify[bot] 285e2e8466
v2.1: Revert "remove test-only bool arg from calculate_fee (#3211)" (backport of #3367) (#3373)
Revert "remove test-only bool arg from calculate_fee (#3211)" (#3367)

This reverts commit aad0381e10.

(cherry picked from commit cec2324188166be17b1ffdc2b6538386a6a010e1)

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2024-10-29 19:32:21 -05:00
steviez 5de9be051f
Consolidate AccountsDb parameters (#3324)
Move shrink_ratio and account_indexes into AccountsDbConfig struct
2024-10-28 12:36:55 -05:00
Andrew Fitzgerald aad0381e10
remove test-only bool arg from calculate_fee (#3211) 2024-10-25 05:23:40 -05:00
Kevin Heavey 8116c10021
Extract feature-set crate (#2172)
* extract feature-set crate

* update feature_set dependents

* re-export with deprecation notice

* fix path after rebase

* fmt

* fmt after rebase

* fixes after rebase

* unused import

* fix import

* unused import

* post-rebase fixes

* fix path

* missing frozen-abi support

* update lock file

* use workspace lints

* fix paths

* fix import

* remove unused import

* remove unused deps

* consolidate imports

* add back dep (not unused after all)
2024-09-10 19:27:20 +02:00
Yihau Chen 4ac1300873
clippy: manual_inspect (#2496)
fix manual_inspect
2024-08-09 15:10:15 +08:00
Jon C 39af6c092d
test-validator: Add flag to clone feature set from a cluster (#2480)
* test-validator: Add flag to clone feature set from a cluster

#### Problem

Program devs run into issues when testing, where everything works great
with a solana-test-validator, and then fails once they deploy to a real
cluster. Most times, this happens because the test validator enables all
features by default, and their program depended on a new feature without
their knowledge.

#### Summary of changes

To make local development much easier, add a `--clone-feature-set` flag
to solana-test-validator to easily mimic the functionality on the
cluster targeted with `--url`.

* Add changelog entry
2024-08-08 23:25:52 +02:00
Kevin Heavey 0b6f4a0d4d
replace solana-client with its constituent parts where possible (#2086) 2024-07-16 11:25:13 -06:00
Tyera efdbdc00ce
Remove assorted deprecated symbols (#1995)
* Remove deprecated method from program-test

* Remove deprecated programs stuff from TestValidator

* Remove deprecated method from TestValidator (deprecated in v1.11.0)

* Remove deprecated re-export from cluster_info
2024-07-03 14:07:35 -06:00
Tyera 51af772e63
Remove deprecated RpcClient methods (#1899)
* Remove deprecated RpcClient methods corresponding to #1809

* Remove internal handling for pre-v1.9.0 servers

* Remove unused import of deprecated_config module

* Remove request mapping (pre-v1.7.0)

* Remove dangling allow-deprecated tag

* Add line to changelog

* Remove deprecated RpcRequest variants

* Remove reprecated rpc-client-nonce-utils methods

* Remove deprecated TestValidator method

* Remove deprecated solana fees command
2024-06-28 16:35:08 -06:00
Jon C c9d670773c
test-validator: Try to reset deployment slot on all cloned accounts (#1706)
* test-validator: Try to reset deployment slot on all cloned accounts

* Address feedback
2024-06-12 20:00:07 +02:00
Joe C 62eb4cc068
Add Compute Budget Crate (#1121) 2024-06-01 01:38:19 -05:00
Lijun Wang f54c120450
Connection rate limiting (#948)
* use rate limit on connectings

use rate limit on connectings; missing file

* Change connection rate limit to 8/min instead of 4/s

* Addressed some feedback from Trent

* removed some comments

* fix test failures which are opening connections more frequently

* moved the flag up

* turn off rate limiting to debug CI

* Fix CI test failures

* differentiate of the two throttling cases in stats: across connections or per ip addr

* fmt issues

* Addressed some feedback from Trent

* Added unit tests

Cleanup connection cache rate limiter if exceeding certain threshold

missing files

CONNECITON_RATE_LIMITER_CLEANUP_THRESHOLD to 100_000

clippy issue

clippy issue

sort crates

* revert Cargo.lock changes

* Addressed some feedback from Pankaj
2024-05-14 17:33:43 -07:00
Joe C 03ef611f0c
program-runtime: hoist `RuntimeConfig` up to SVM (#630)
program-runtime: hoist `RuntimeConfig` out into SVM
2024-04-07 10:45:57 -05:00
Joe C 4b0e7d6ba3
Test Validator: Set deployment slot to `0` for cloned upgradeable programs (#501)
test-validator: clone upgradeable programs with slot 0
2024-03-29 17:05:53 -05:00
Dmitri Makarov ba43f74dcf
[SVM] Move RuntimeConfig to program-runtime (#96)
RuntimeConfig doesn't use anything SVM specific and logically belongs
in program runtime rather than SVM.  This change moves the definition
of RuntimeConfig struct from the SVM crate to program-runtime and
adjusts `use` statements accordingly.
2024-03-07 10:16:16 -08:00
Pankaj Garg 46b9586630
SVM: Move SVM code to its own crate folder (#35119) 2024-02-06 16:06:32 -08:00
Pankaj Garg 3cf5dd2afb
SVM: Move RuntimeConfig to svm folder (#35085) 2024-02-05 13:49:36 -08:00
Brooks 2f744f1639
Moves create_all_accounts_run_and_snapshot_dirs() into accounts-db utils (#34877) 2024-01-22 18:18:43 -05:00
Andrew Fitzgerald 2294801954
Do not derive Copy for EpochSchedule and Rent (#32767) 2023-12-01 07:57:25 -08:00
Joe C 72706d6601
test validator write stake account to JSON (#33014) 2023-09-01 08:18:53 -06:00
Alexander Meißner 9e703f85de
Upgrades Rust to 1.72.0 & nightly-2023-08-25 (#32961)
* allow pedantic invalid cast lint

* allow lint with false-positive triggered by `test-case` crate

* nightly `fmt` correction

* adapt to rust layout changes

* remove dubious test

* Use transmute instead of pointer cast and de/ref when check_aligned is false.

* Renames clippy::integer_arithmetic to clippy::arithmetic_side_effects.

* bump rust nightly to 2023-08-25

* Upgrades Rust to 1.72.0

---------

Co-authored-by: Trent Nelson <trent@solana.com>
2023-09-01 07:26:13 +00:00
Pankaj Garg f4287d70bb
Move accounts-db code to its own crate (#32766) 2023-08-09 13:03:36 -07:00
behzad nouri d54b6204be
removes instances of clippy::manual_let_else (#32417) 2023-07-09 21:41:36 +00:00
Jeff Biseda 87c1b67d53
refactor core to create consensus module (#32282) 2023-06-27 17:25:08 -07:00
behzad nouri 4e34abbf3d
specifies protocol in contact-info get-socket api (#31602) 2023-05-12 16:16:20 +00:00
Illia Bobyr 43c0f05ca0
Bumps base64 from 0.13.1 to 0.21.0. (#31522)
Changes:

  marshallpierce/rust-base64@v0.13.1...v0.21.0

`base64::{encode,decode}` are now deprecated in favor of an API that
explicitly selects an `Engine`.  Migrated all calls to the new API.
2023-05-11 11:34:58 -07:00
Alexander Meißner 7002c568fb
Cleanup - Removes the CLI option "no-bpf-jit" (#31329)
* Enables JIT everywhere by default.

* Removes the CLI argument "no-bpf-jit" and its plumbering through out the validator code base.

* Removes with_jit bpf_loader variants.

* Removes the to_builtin!() macro.
2023-04-25 19:04:11 +02:00
Illia Bobyr 809041b151
poh_verify => run_verification: Rename to be more accurate (#30811)
`poh_verify` actually disables transaction signature, tick count and
built in program argument verifications as well.  It is somewhat
confusing to call it `poh_verify`.
2023-03-22 11:03:30 -07:00
cavemanloverboy 10f49d4e26
Geyser Runtime Reload (#30352)
Support dynamic geyser plugin load, unload, and listing through admin RPC.
2023-03-16 17:03:00 -07:00
Tyera 7b1d446001
Admin RPC Service: move post-init activation to before wait-for-supermajority (#30544)
* Move AdminRpcRequestMetadataPostInit to solana-core

* Move AdminRpcRequestMetadataPostInit write to just before wait_for_supermajority

* Pass AdminRpcRequestMetadataPostInit in TestValidatorGenesis

* Fixup local-cluster
2023-03-01 19:38:11 -07:00
Tyera 08ca9cc17d
Default solana-test-validator --bpf-programs to upgradeable loader (#30485)
* Dedupe parsing

* Update --bpf-program param to use upgradeable loader, upgrade authority disabled

* Update add_program to use upgreadeable loader

* Deprecate non-upgradeable utils
2023-02-24 09:22:27 -07:00
Tyera fbd8ef5bab
Add solana-test-validator --upgradeable-program (#30412)
* Add TestValidator handling for upgradeable programs

* Plumb --upgradeable-program for solana-test-validator
2023-02-23 18:25:14 +00:00
Yihau Chen df3ef111f7
chore: workspace inheritance (#29893)
* introduce workspace.package

* introduce workspace.dependencies

* read version from root cargo.toml

* pass check when version = { workspace = true }

* don't bump version when version = { workspace = true }

* including workspace Cargo.toml when bump version

* programs/sbf use workspace inheritance

* fix increasing cargo version ignore program/sbf/Cargo.toml
2023-02-23 22:01:54 +08:00
Michael Vines 5136ed3448
Update homepage value for all crates (#30444) 2023-02-23 02:20:18 +00:00
Tyera b0009a3203
TestValidator nits (#30410)
* nit: remove erroneous comment

* nit: use max for program account lamports
2023-02-20 16:24:29 -07:00
skrrb 6717c07af1
test-validator: clone upgradeable programs (#30279)
* test-validator: clone upgradeable programs

* typo & drop bincode dep & clone bound
2023-02-16 16:28:01 +01:00
behzad nouri ded457cd73
embeds the new gossip ContactInfo in ClusterInfo (#30022)
Working towards replacing the legacy gossip contact-info with the new
one, the commit updates the respective field in gossip cluster-info.
2023-02-10 20:07:45 +00:00
Kevin Ji cd51499ab9
Use Ipv4Addr constants in socketaddr! (#30095) 2023-02-02 16:48:21 -07:00
Lijun Wang ada6136a6c
Refactor connection cache to support generic msgs (#29774)
tpu-client/tpu_connection_cache is refactored out the module and moved to connection-cache/connection_cache and the logic in client/connection_cache is consolidated to connection-cache/connection_cache as well. client/connection_cache only has a thin wrapper which forward calls to connection-cache/connection_cache and deal with constructions of quic/udp connection cache for clients using them both.2.

The TpuConnection is refactored to ClientConnection to make it generic and functions renamed to be proper for other workflows. eg. tpu_addr -> server_addr, send_transaction --> send_data and etc...

The enum dispatch is removed so that we can make the bulk of code of quic and udp agnostic of each other. The client is possible to load quic or udp only into its runtime.

The generic type parameter in the tpu-client/tpu_connection_cache is removed in order to create both quic and udp connection cache and use the object to send transactions with multiple branching when sending data. The generic type parameters and associated types are dropped in other types in order to make the trait "object safe" for this purpose.

I have annotated the code explaining the reasoning and the refactoring source -> destination.

There is no functional changes

bench-tps has been performed for rpc-client, thin-client and tpu-client. And it is found the performance number largely match the ones before the refactoring.
2023-02-01 18:10:06 -08:00
Will Hickey 04a6a631bc
Bump version to v1.16 (#30028) 2023-01-31 17:48:33 -06:00
joeaba a12bf8c003
Update maintainers references (#29997)
* update maintainers references

* chore: update maintainers reference
2023-01-31 08:07:13 -05:00
Xiang Zhu 856598969c
Account path add run parent with old path cleanup (#29942)
* Add run parent directory for accounts files

* fix test test_concurrent_snapshot_packaging

* review comments.  renamed the path setup function

* Addressed most of the review comments

* remove explict type def for map result

* handle create_accounts_run_and_snapshot_dirs error with expect

* update with more review comments

* minor fixes from review comments

* simplify account_filename option assignment

* handle error from create_accounts_run_and_snapshot_dirs

* use then instead of then_some for lazy evaluation

* Clean up files in the old account_path before trasitioning to the new run path

* try_exist and accounts_dir removing extra

* sync rmdir, is_dir check

* handle the account_path not deletable case
2023-01-30 10:26:43 -08:00
Xiang Zhu 4ebcacb4a3
Revert "Add run parent directory for accounts files (#29794)" (#29899)
This PR is causing OOM on master.  Reverting it for now.

This reverts commit 74f89d1494.
2023-01-25 10:03:01 -08:00
Yihau Chen 9193b4221d
Revert "chore: workspace inheritance (#29509)" (#29892)
This reverts commit a67d239dde.
2023-01-25 15:50:41 +08:00
Yihau Chen a67d239dde
chore: workspace inheritance (#29509)
* introduce workspace.package

* introduce workspace.dependencies

* read version from root cargo.toml

* pass check when version = { workspace = true }

* don't bump version when version = { workspace = true }

* including workspace Cargo.toml when bump version

* programs/sbf use workspace inheritance

* fix increasing cargo version ignore program/sbf/Cargo.toml
2023-01-25 13:59:59 +08:00
Xiang Zhu 74f89d1494
Add run parent directory for accounts files (#29794)
* Add run parent directory for accounts files

* fix test test_concurrent_snapshot_packaging

* review comments.  renamed the path setup function

* Addressed most of the review comments

* remove explict type def for map result

* handle create_accounts_run_and_snapshot_dirs error with expect

* update with more review comments

* minor fixes from review comments

* simplify account_filename option assignment

* handle error from create_accounts_run_and_snapshot_dirs

* use then instead of then_some for lazy evaluation
2023-01-24 16:44:35 -08:00
Kevin Ji dd92f225bb
Use Ipv4Addr::{LOCALHOST, UNSPECIFIED} constants (#29813) 2023-01-23 16:49:51 -06:00
Jeff Biseda a44ea779bd
add support for a repair protocol whitelist (#29161) 2022-12-15 19:24:23 -08:00