Commit Graph

302 Commits

Author SHA1 Message Date
mergify[bot] b271f1ffbf
v2.0: token-2022: Use mainnet-beta binary in all tools (backport of #3165) (#3166)
token-2022: Use mainnet-beta binary in all tools (#3165)

#### Problem

The binary of token-2022 bundled in program-test and fetch-spl.sh is
very out of date with what's currently running on mainnet.

#### Summary of changes

Update the shared object and version to fetch.

(cherry picked from commit 96955661f7)

Co-authored-by: Jon C <me@jonc.dev>
2024-10-15 18:52:21 +02:00
mergify[bot] 96fe61ad79
v2.0: Remove assorted deprecated symbols (backport of #1995) (#2002)
* 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

(cherry picked from commit efdbdc00ce)

# Conflicts:
#	gossip/src/cluster_info.rs

* Fix conflict

---------

Co-authored-by: Tyera <tyera@anza.xyz>
2024-07-04 00:29:49 -06:00
mergify[bot] 764596ccb3
v2.0: Remove deprecated BanksClient methods and dependent ProgramTest methods (backport of #1956) (#1963)
Remove deprecated BanksClient methods and dependent ProgramTest methods (#1956)

* Remove deprecated Banks client/interface methods

* Remove dependent deprecated program-test methods

(cherry picked from commit 6e4e82eb2a)

Co-authored-by: Tyera <tyera@anza.xyz>
2024-07-02 16:18:42 -06:00
Joe C 02f2861f7f
Program Test: Add BPF program account helpers (#1614)
* program-test: add program account helpers

* program-test: add test for Core BPF programs

* program-test: add BPF program fixture

* wrap into `add_upgradeable_program_to_genesis`

* wrap ELF loading into `add_upgradeable_program_to_genesis`

* cleanup
2024-06-06 10:59:22 -05:00
Joe C 62eb4cc068
Add Compute Budget Crate (#1121) 2024-06-01 01:38:19 -05:00
Yihau Chen f2f1a22ccc
chore: remove unused clippy attributes, unnecessary_wraps (#1514)
remove clippy unnecessary_wraps
2024-05-29 11:09:29 +00:00
Joe C 6631e5f4d9
Program-Test: Spport adding genesis accounts (#1418) 2024-05-18 05:46:45 -05:00
Joe C 1a37631629
Program-Test: Add test for BPF programs (#1416) 2024-05-18 05:46:17 -05:00
Yihau Chen 8f9fc2ada2
clippy: missing_transmute_annotations (#1343)
* clippy: missing_transmute_annotations

* Revert "clippy: missing_transmute_annotations"

This reverts commit 01b5fe5dabd8e8c860c8173840429204c4cca3b0.

* update types

* update types

* update types

* update types

* feedback

* add one more missing type

* Revert "feedback"

This reverts commit 420ee23489fe71b1b33a413e084d46204d7b8c9e.

* update types
2024-05-18 01:03:17 +08:00
Yihau Chen b42d8f68a4
clippy: allow dead_code for GraphVoteAccountModeError, DroppableTask and SubscriptionToken (#1246)
* clippy: allow dead_code for SubscriptionToken

* clippy: allow dead_code for GraphVoteAccountModeError

* clippy: allow dead_code for DroppableTask

* remove the string in the GraphVoteAccountModeError

* abort the joinhandle when drop

* only trace JoinHandle in the drop

* add comment
2024-05-13 10:45:37 +08:00
Pankaj Garg bbe470562b
SVM: Cleanup transaction processor construction (#974) 2024-04-22 14:29:20 -07:00
Alexander Meißner e43338f3d6
Refactor - Rename `LoadedProgram` to `ProgramCacheEntry` (#880)
LoadedProgramOwner => ProgramCacheEntryOwner.
LoadedProgramType => ProgramCacheEntryType.
LoadedProgram => ProgramCacheEntry.
LoadedProgramStats => ProgramCacheStats.
LoadedProgramMatchCriteria => ProgramCacheMatchCriteria.
LoadedProgramsForTxBatch => ProgramCacheForTxBatch.
2024-04-18 21:38:08 +02:00
carllin d5c291a934
Remove send snapshot hard unwrap (#326) 2024-04-11 12:18:52 -04:00
Kevin Heavey d06e3e95cb
program-test: move test-case to dev-dependencies (#710) 2024-04-10 10:22:28 -05:00
Lucas Steuernagel 4753a8aefa
Move `add_builtin` to SVM (#547) 2024-04-09 16:55:09 -03: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
Tyera 9253c465d1
Persist EpochRewards sysvar (#572)
* Persist EpochRewards sysvar between reward intervals

* Adjust initial EpochRewards balance to ensure it is not debited out of existence

* Set EpochRewards::active = false at end of distribution

* Fix tests

* Extend test to 2 epochs, assert sysvar still exists

* Stop adjusting EpochRewards balance based on rewards

* Fix tests

* Review suggestions
2024-04-05 10:13:50 -06:00
Lucas Steuernagel 9f8a478c51
Use `&str` instead of `String` in `add_builtin` (#539) 2024-04-02 14:36:13 -03:00
sakridge e0e659680a
Remove duplicated token ids and use a shared inline-spl crate (#456) 2024-04-01 14:31:04 +02:00
Brooks 24fe473b46
clippy: Automated fixes for Rust 1.77.0 (#390) 2024-03-22 13:48:46 -04:00
HaoranYi 0f8f8cd970
Revert deprecate executable feature (#309)
* revert deprecate executable feature

* add native loader account transfer test

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-03-20 10:54:15 -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
Tao Zhu 51eaa2b9cc
cleanup feature code after activation (#34695)
cleanup feature checking code
2024-01-12 14:28:50 -06:00
Tao Zhu 88f8d11da2
program-test consumes some units as native (#34714)
program-test consumes some units as native;
harden a unit test wrt if builtin consumes units;
2024-01-10 09:05:30 -06:00
Justin Starry 5f74fc4f16
Update genesis processing to have a fallback collector id for tests (#34135)
* Update genesis processing to have a fallback collector id for tests

* DCOU-ify the collector id for tests parameter (#1902)

* wrap test_collector_id in DCOU

* rename param to collector_id_for_tests

* fix program test

* fix dcou

---------

Co-authored-by: Brooks <brooks@prumo.org>
2024-01-10 08:34:41 +08:00
chalda 8330dee95d
[program-test] adding method warp_to_epoch (#34620)
* [program-test] adding method warp_to_epoch

* formatting fix
2024-01-03 10:58:22 -07:00
Justin Starry 88af74d1d0
refactor: optional `stake_history` arg is never `None` (#34556)
refactor: optional stake_history arg is never none
2023-12-22 10:44:28 +08:00
Jon Cinque 8a8466cd86
spl: Bump token-2022 to v1 (#34412)
* Update toml and lockfiles

* account-decoder: Add group and group member extensions

* transaction-status: Add token group + pointer extensions

* program-test: Update token-2022 binary
2023-12-21 20:19:10 -05:00
HaoranYi 531d69fd10
pass feature_set to BorrowedAccount (#34542)
Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-12-21 20:03:17 +01:00
Brooks 25f0f377c6
program-test uses Bank::new_with_paths() (#34549) 2023-12-21 07:00:28 -05:00
Ryo Onodera 0873705c1b
Define register_unique_recent_blockhash_for_test (#33880) 2023-10-27 12:30:45 +09:00
Pankaj Garg 9d42cd7efe
Initialize fork graph in program cache during bank_forks creation (#33810)
* Initialize fork graph in program cache during bank_forks creation

* rename BankForks::new to BankForks::new_rw_arc

* fix compilation

* no need to set fork_graph on insert()

* fix partition tests
2023-10-23 09:32:41 -07:00
Ryo Onodera 5a963529a8
Add BankWithScheduler for upcoming scheduler code (#33704)
* Add BankWithScheduler for upcoming scheduler code

* Remove too confusing insert_without_scheduler()

* Add doc comment as a bonus

* Simplify BankForks::banks()

* Add derive(Debug) on BankWithScheduler
2023-10-21 15:56:43 +09:00
Alexander Meißner a5c7c999e2
Bump solana_rbpf to v0.8.0 (#33679)
* Bumps solana_rbpf to v0.8.0

* Adjustments:
Replaces declare_syscall!() with declare_builtin_function!().
Removes Config::encrypt_runtime_environment.
Simplifies error propagation.
2023-10-20 21:39:50 +02:00
Justin Starry 3bfa0d291a
feature flag cleanup: cap_bpf_program_instruction_accounts (#33746) 2023-10-19 08:15:35 +08:00
Jon Cinque d33758171b
token-2022: Update to use program build with zk-ops enabled (#33747)
token-2022: Update to use version with zk-ops enabled
2023-10-18 21:39:01 +02:00
Jon Cinque de38b05ad1
spl: Bump token-2022 and friends (#33453)
* token: Update to 4.0.0

* token-2022: Bump and support new account and instruction types

* Update token-2022 in fetch_spl / program-test

* Fixup downstream uses

* Mint and destination were flipped in 0.9.0

* Don't use `convert_pubkey`

* Bump spl dependencies to versions which avoid recompilations
2023-09-29 19:12:06 +02:00
HaoranYi d25d53e979
Fix bug of same-epoch stake deactivation after stake redelegation (#32606)
* fix stake deactivation in the same epoch after redelegation bug

add tests

refactor common code into fn

avoid early return

add feature gate for the new stake redelegate behavior

move stake tests out of cli

add stake-program-test crate

reimplemnt stake test with program-test

remove stake-program-test crate

reviews

add setup.rs

remove clippy

reveiws

* reviews

* review comments

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-09-25 16:35:40 -05: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
Jon Cinque dcad8f01bd
banks-server: Support versioned transactions (#33005) 2023-08-28 23:08:41 +02:00
HaoranYi 910b0f5d12
fix sbf sysvar test (#32803)
* fix sbf sysvar test

* typo

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-08-21 09:49:48 -06:00
Brooks 9a6cf3f528
Renames SnapshotRequestType to SnapshotRequestKind (#32907) 2023-08-21 07:12:20 -04:00
steviez a4c8cc3ce0
Remove improper uses of &Arc<Bank> (#32802)
In most cases, either a &Bank or an Arc<Bank> is more proper.
- &Bank is used if the function only needs a momentary reference
- Arc<Bank> is used if the function needs its' own copy

This PR leaves several instances of &Arc<Bank> around; these instances
are situations where a clone may only happen conditionally.
2023-08-18 16:46:34 -05:00
Jon Cinque 760559157c
program-test: Fix realloc in native mode (#32818) 2023-08-14 13:56:03 +02:00
Jon Cinque 194c959aa8
program-test: Prohibit setting the compute unit limit past `i64::MAX` (#32807)
program-test: Prohibit setting the compute unit limit past the max
2023-08-11 18:30:22 +02:00
Jon Cinque c73a56faf8
stake: Rename `StakeStateWithFlags` -> `StakeStateV2` (#32795) 2023-08-11 01:07:21 +02:00
Pankaj Garg f4287d70bb
Move accounts-db code to its own crate (#32766) 2023-08-09 13:03:36 -07:00
Jon Cinque 8e4a9a94ed
sdk: Add new version of `StakeState` to avoid breaking downstream users (#32736)
* sdk: Rename `StakeState` -> `StakeStateWithFlags`

* Add back `StakeFlags` with a deprecation warning
2023-08-09 00:05:40 +02:00