Commit Graph

2395 Commits

Author SHA1 Message Date
behzad nouri d7ae65fc46
removes feature-gated code revising turbine epoch stakes for shreds propagation (#35226) 2024-02-20 16:04:32 +00:00
Brooks 012f588482
Removes copying owner when serializing Account (#35118)
* Removes copying owner when serializing Account

* Provide generic AbiExample impls for &T and &[T]

---------

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2024-02-20 10:16:46 -05:00
Will Hickey 30adda4a71
Update version to 1.19.0 (#35168) 2024-02-19 15:43:58 -05:00
Joe C 78e187f220
bpf-loader-upgradeable: export `get_program_data_address` helper (#35131) 2024-02-16 21:00:50 +01:00
Sergey Timoshin d268139a0e
fix: correct typo in alt_bn128 function names. (#35210)
The typo in the function names convert_edianness_64 and convert_edianness_128 has been corrected to convert_endianness_64 and convert_endianness_128 respectively.
2024-02-16 19:59:15 +01:00
Dmitri Makarov eeb0cf1ea8
SVM: Move nonce_info from accounts-db to Solana SDK (#35138) 2024-02-08 15:01:15 -05:00
Pankaj Garg 28a320d815
SVM: Move `RentCollector` to sdk (#35122) 2024-02-07 16:38:42 -08:00
Dmitri Makarov b9ee3b475b
SVM: Move RentDebits from accounts-db to Solana SDK (#35135) 2024-02-07 15:10:17 -08:00
Joe C 3ddd2352a1
sdk: add `Immutable` and `IncorrectAuthority` to `ProgramError` (#35113) 2024-02-07 15:35:29 -06:00
Dmitri Makarov 2c0001b530
SVM: Move RewardInfo from accounts-db to Solana SDK (#35120) 2024-02-07 10:55:39 -08:00
Yihau Chen 8363ebfd64
ci: merge docker images (#35078)
* ci: add new ci docker image

* ci: use the new docker image

* fix shellcheck

* add readme for the new docker image

* remove old docker images

* remove unused check in docs/build.sh

* use the new image in net.sh
2024-02-07 15:17:33 +08:00
Tyera Eulberg 57bbd3363c Revert "Populate partitioned-rewards PDA during calculation (#34624)"
This reverts commit 4385ed11b1.
2024-02-05 19:54:19 -07:00
Tyera Eulberg d7179e4fa0 Revert "Define epoch-rewards partition data program id (#34862)"
This reverts commit 8aa726bfdf.
2024-02-05 19:54:19 -07:00
Jon C 3646291dc6
sdk: Do not derive AbiEnum on InstructionError for Solana builds (#35038) 2024-02-02 00:00:31 +01:00
Tao Zhu 0dcac3fe7c Revert "Remove congestion multiplier from calculate fee (#34865)"
This reverts commit 73d3973c7c.
2024-01-30 17:30:01 -06:00
Tao Zhu df2ee120e9 Revert "separate priority fee and transaction fee from fee calculation (#34757)"
This reverts commit 5ecc47ec5a.
2024-01-30 17:30:01 -06:00
Tao Zhu 15423928c1 Revert "refactor unused parameter (#34970)"
This reverts commit 083890928f.
2024-01-30 17:30:01 -06:00
hana c99427eb9e
solana-program: only decode prior_voters if needed (#34972) 2024-01-27 11:10:45 -08:00
behzad nouri d4fdcd940a
adds feature to enable chained Merkle shreds (#34916)
During a cluster upgrade when only half of the cluster can ingest the new shred
variant, sending shreds of the new variant can cause nodes to diverge.
The commit adds a feature to enable chained Merkle shreds explicitly.
2024-01-27 15:03:16 +00:00
Tao Zhu 083890928f
refactor unused parameter (#34970) 2024-01-26 12:28:44 -06:00
Ashwin Sekar 93271d91b0
gossip: notify state machine of duplicate proofs (#32963)
* gossip: notify state machine of duplicate proofs

* Add feature flag for ingesting duplicate proofs from Gossip.

* Use the Epoch the shred is in instead of the root bank epoch.

* Fix unittest by activating the feature.

* Add a test for feature disabled case.

* EpochSchedule is now not copyable, clone it explicitly.

* pr feedback: read epoch schedule on startup, add guard for ff recache

* pr feedback: bank_forks lock, -cached_slots_in_epoch, init ff

* pr feedback: bank.forks_try_read() -> read()

* pr feedback: fix local-cluster setup

* local-cluster: do not expose gossip internals, use retry mechanism instead

* local-cluster: split out case 4b into separate test and ignore

* pr feedback: avoid taking lock if ff is already found

* pr feedback: do not cache ff epoch

* pr feedback: bank_forks lock, revert to cached_slots_in_epoch

* pr feedback: move local variable into helper function

* pr feedback: use let else, remove epoch 0 hack

---------

Co-authored-by: Wen <crocoxu@gmail.com>
2024-01-26 07:58:37 -08:00
Tao Zhu 5ecc47ec5a
separate priority fee and transaction fee from fee calculation (#34757)
add function calculate_fee_details() that returns FeeDetails with base and priority fee separated
2024-01-26 08:24:45 -06:00
hana 0c2d9d25fd
solana-program: VoteState::deserialize() (#34829)
* implement a custom parser for `VoteState` which is usuable in a bpf context
* derive or impl `Arbitrary` for `VoteStateVersions` and its component types, for test builds only
2024-01-25 08:51:41 -08:00
Tyera bbd1fd41ac
Move EpochRewardsHasher to solana-sdk (#34934)
* Move EpochRewardsHasher to solana-sdk

* Cargo.lock

* Apparently we're allowing arithmetic_side_effects in all of runtime

* Move allow stmt to block instead of module

* Also allow in test mod
2024-01-24 16:25:01 -07:00
Tao Zhu 73d3973c7c
Remove congestion multiplier from calculate fee (#34865)
* remove println from a test

* sync fee_structure with fee_rate_governor;
remove congestion_multiplier from calculacte_fee(), leave parameters unused for now.
2024-01-23 12:59:50 -06:00
Tyera 8aa726bfdf
Define epoch-rewards partition data program id (#34862)
* Create new program id for epoch-rewards partition data PDAs

* Remove misleading repr attribute

* Remove storage of HasherKind

* Split up seeds
2024-01-22 19:14:29 -07:00
Andrew Fitzgerald 5e4332ee35
Feature Impl: cost model uses number of requested write locks (#34820) 2024-01-22 09:22:49 -08:00
samkim-crypto 73218595c6
[zk-token-sdk] Restrict Edwards and Ristretto multiscalar multiplication vector length to at most 512 (#34763)
* restrict curve25519 multiscalar multiplication vector length to 512

* add syscall tests for msm vector length

* add new feature gate `curve25519_restrict_msm_length`

* update tests for feature new gate

* Update programs/bpf_loader/src/syscalls/mod.rs

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* remove length guard on the multisicalar mult lib function

---------

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2024-01-19 08:40:42 +09:00
Justin Starry 747df9c105
Fix versioned message json deserialization (#34808) 2024-01-18 10:31:05 +08:00
Trent Nelson 6dbcdc063f
sdk: add bounds check when instantiating `Keypair` from byte array (#34817) 2024-01-17 18:51:16 -07:00
samkim-crypto b222fdf3d7
[zk-token-proof] Add functionality to read proof from accounts instead of instruction data (#34750)
* add functionality to read proof from accounts instead of instruction data

* update add tests

* clippy

* clarify instruction data discriminator

* avoid cloning entire proof data

* Update programs/zk-token-proof/src/lib.rs

Co-authored-by: Jon C <me@jonc.dev>

* update `PROOF_OFFSET_LENGTH` to `INSTRUCTION_DATA_LENGTH_WITH_PROOF_ACCOUNT`

* update instruction docs

* add feature gate

* Update sdk/src/feature_set.rs

Co-authored-by: Jon C <me@jonc.dev>

* update feature name `enable_zk_from_account` to `enable_zk_proof_from_account`

* Apply suggestions from code review

Co-authored-by: Jon C <me@jonc.dev>

* clarify the instruction data length more precisely

---------

Co-authored-by: Jon C <me@jonc.dev>
2024-01-13 08:15:44 +09:00
Tyera 4385ed11b1
Populate partitioned-rewards PDA during calculation (#34624)
* Add epoch_rewards_partition_data module

* Rename variable

* Pass hasher's parent_blockhash up to begin_partitioned_rewards

* Populate epoch rewards partition data account in begin_partitioned_rewards

* Fix method name
2024-01-11 23:15:55 -07:00
HaoranYi 5a3a10e847
Deprecate account meta executable read/update in bpf loaders (#34194)
* use PROGRAM_OWNER + program data for account executable

mock account data with executable_meta in precompiled program and update
test_bank_hash_consistency test

pr: return const slice and add comments

pr: use ReadableAccount

use const to get rid of magic number

add featuregate disable_bpf_loader_instructions to disable bpf loader management instructions, and deprecate_executable_meta_update_in_bpf_loader to deprecate executable flag update in bpf loader

deprecate usage of executable in Account

fix a test

fix sbp bench

fix sbf program tests

add feature gate to account and borrowed account apis

fix tests

more test fixes

* restore bpf_loader v2 tests

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-01-03 15:11:48 -06:00
Ashwin Sekar 19088411ff
blockstore: populate duplicate shred proofs for merkle root conflicts (#34270)
* blockstore: populate duplicate shred proofs for merkle root conflicts

* pr feedback: check test case

* pr feedback: comment

* pr feedback: match statement, shred_id, comment

* add feature flag

* pr feedback: rename ff var and perform_merkle_check

* pr feedback: move panic to callers in get_shred_from_just_inserted_or_db

* avoid unecessary write if proof is already present
2024-01-03 12:15:52 -05:00
Nick Frostbutter fc2a8794be
[docs] updated readme and fix links (#34565)
* feat: updated readme

* fix: updated links

* fix: proposal links

* fix: more links

* fix: json-rpc links

* fix: more links

* fix: zk links

* fix: managing forks

* fix: links for deprecated methods
2024-01-03 09:06:06 -05: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
HaoranYi 2fd0bae71e
rekey partitioned epoch rewards (#34502)
Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-12-21 16:46:30 -06:00
GoodDaisy 03386cc7b9
Fix typos (#34459)
* Fix typos

* Fix typos

* fix typo
2023-12-21 13:06:00 -07: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
Ashwin Sekar def3bc4c4f
Add feature flag for LastIndex and Erasure duplicate proofs (#34360)
* Add feature flag for LastIndex and Erasure duplicate proofs

* pr feedback: use root bank instead of 2 params

* pr feedback: & instead of &Arc

* pr feedback: reuse fn, remove redundant clones

* rebase: fix feature set conflict
2023-12-20 10:20:30 -05:00
Tao Zhu 4a8582eab4
cleanup feature code after activated everywhere (#34509) 2023-12-19 13:59:26 -06:00
Ashwin Sekar 4a8d27d921
replay: feature flag consumption of duplicate proofs from blockstore (#34372)
* replay: feature flag consumption of duplicate proofs from blockstore

* pr feedback: reorder check, add flag for restart logic
2023-12-18 19:01:24 -05:00
HaoranYi 1ac017c409
rekey stake limit feature (#34503)
Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-12-18 11:11:17 -06:00
Joe C 171c58c5c0
RPC: Add inner instructions to simulate transaction response (#34313)
* rpc: add optional `innerInstructions: bool` arg to `simulateTransaction`

* bank: enable cpi recording in simulate

* sdk: move `InnerInstructions` into SDK from accounts DB

* bank: return inner instructions from simulate tx

* rpc: return inner instructions from simulate tx

* rpc: simulate tx: add `jsonParsed` support for inner instructions

* accounts db: add deprecated attribute to re-exported inner instructions

* rpc: de-dupe inner instruction mapping

* update deprecated comment

Co-authored-by: Tyera <teulberg@gmail.com>

---------

Co-authored-by: Tyera <teulberg@gmail.com>
2023-12-16 12:49:22 +00:00
Tao Zhu 7360f48eb5
remove unnecessary wrapper function (#34428)
* remove unnecessary wrapper function

* add test to FeeStructure
2023-12-15 14:56:19 -06:00
Tao Zhu 39f2866a10
cleanup feature code after mainnet-beta activation (#34289)
* cleanup feature code after mainnet-beta activation
* add comment for reserved enum
2023-12-12 18:06:49 -06:00
norwnd 2e34bfc248
comments: fix typos (#34402)
fix miscellaneous typos

Co-authored-by: norwnd <norwnd>
2023-12-11 11:24:34 -07:00
bji 930ce1eb21
Add allow_commission_decrease_at_any_time feature which will allow (#33847)
* Add allow_commission_decrease_at_any_time feature which will allow
vote account commission to be lowered at any time during the epoch
regardless of the commission_updates_only_allowed_in_first_half_of_epoch
feature.  Fixes #33843.

SIMD: 0080

* Remove unused `feature_set` import

---------

Co-authored-by: Jon Cinque <me@jonc.dev>
2023-12-08 17:30:48 -05:00
Justin Starry 79739e1b78
Comment sysvar and builtin lists as deprecated and remove new keys (#34365) 2023-12-09 01:17:17 +08:00
Jon Cinque cfb16ab76a
sdk: Upgrade to borsh 1.2.1 (#34355)
* sdk: Update to borsh 1, revert borsh 0.9 / 0.10

* Restore borsh 0.10 and 0.9 support

* Update sbf lockfile

* Add borsh 0.10 implementations for stake types

* Fix weirdness on whitespace

* Update to borsh 1.2.1

* Update changelog

* compute-budget: Move `pack` under dev-context-only-utils

* Revert test to use HashMap

* transaction-status: Add comment about borsh version
2023-12-08 13:18:10 +01:00
ryleung-solana 132c910f81
Quic update identity (#33865)
Update the Quic transport layer keypair and identity when the Validator's identity keypair is updated
2023-12-08 14:53:19 +08:00
HaoranYi 9cb83069d8
fix typo in error message and code comments in transaction_context (#34339)
fix typo in error message and code comments

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-12-07 08:32:06 -06:00
behzad nouri d5eee01950
adds feature gated code to drop legacy shreds (#34328) 2023-12-06 22:47:46 +00:00
Brooks 20d33a5274
Removes unnecessary #[allow(dead_code)] in stake flags (#34322) 2023-12-05 16:12:22 +00:00
Lucas Steuernagel b97b3dd4ab
Use BankForks on tests - Part 3 (#34248)
* Add BankForks to core tests

* Refactor functions under DCOU
2023-12-01 13:47:22 -03:00
Andrew Fitzgerald 2294801954
Do not derive Copy for EpochSchedule and Rent (#32767) 2023-12-01 07:57:25 -08:00
HaoranYi f2878c0c51
fix merge error (#34195)
Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-11-21 17:29:54 +00:00
HaoranYi 57dc7adda1
move PROGRAM_OWNERS to sdk (#34193)
* move PROGRAM_OWNERS to sdk

* Update sdk/src/account.rs

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
2023-11-21 09:49:33 -06:00
samkim-crypto a8863bd9fe
[zk-token-proof] Feature gate transfer with fee related proofs (#34103)
feature gate zk-token-proof transfer with fee
2023-11-17 09:21:08 +09:00
Brooks 9a78924c4b
clippy: Uses .into() when .try_into() is infallible (#34119) 2023-11-16 15:28:49 -05:00
HaoranYi 60fdd85aed
Add a feature to disable rent collection (#33945)
* add a feature to disable rent collection

* fix a test

* fix a test

* rekey

* should collect rent

* Update runtime/src/bank/fee_distribution.rs

Co-authored-by: Brooks <brooks@prumo.org>

* expand tests to cover both rent collection disabled and enabled

* feedbacks

* reviews - move should collect rent check out of rent collector into bank

* enforce rent_epoch to u64:max when rent collection is disabled

* review feedbacks and fix a test
When rent fee collection is disabled, we won't collect rent for any account. If there are any rent paying accounts, their `rent_epoch` won't change too.

* revise comments

* update rent_epoch for rent exempted account

* rebase

* set rent_epoch in rent collection for rent exempted account

* revert test change

* don't assert

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
Co-authored-by: Brooks <brooks@prumo.org>
2023-11-16 08:57:49 -06:00
Tao Zhu e790f098b8
Create runtime-transaction crate to build transaction types with state for runtime use (#33471)
* Create runtime-transaction crate to host transaction type for runtime that comes with metadata

* create separate structs for runtime in different state, add corresponding traits for transaction_meta

* share simple-vote checking code

* not to expose private fields to outside of sdk

---------

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2023-11-15 22:29:37 -06:00
Justin Starry 2573b7acc9
clean feature: libsecp256k1_0_5_upgrade_enabled (#34080) 2023-11-16 09:59:53 +08:00
Lijun Wang aa991b6ab7
Adjust receive window to make them linear to the count of streams (#33913)
Adjust receive window to make them linear to the count of streams to reduce fragmentations
2023-11-14 10:55:16 -08:00
Brooks 725ab37bf4
clippy: Replaces .get(0) with .first() (#34048) 2023-11-13 17:22:17 -05:00
vadorovsky 67f8daf6e9
chore: Update light-poseidon to 0.2.0 (#33923)
That new release contains an important change which prevents a
potential DDoS.

* Lightprotocol/light-poseidon#32

Invoking `from_bytes_be` function light-poseidon 0.1.1 inverts all
the inputs before performing a check whether their length exceeds
the modulus of the prime field. Therefore, it was prone to an
attack, where a mailicious user could submit long byte slices just
to DDoS the validator, being stuck on inverting large byte sequences.

The update and mentioned change fixes the same issue as #33363 aims
to address.

The new release contains also few other less important changes like:

* Lightprotocol/light-poseidon#37
* Lightprotocol/light-poseidon#38
* Lightprotocol/light-poseidon#39
2023-11-10 16:00:10 +09:00
HaoranYi 75e598ece3
rekey stake redelegate feature (#33957)
Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-11-06 17:57:54 +00:00
Justin Starry ebe8afb0c3
Burn fees collected into invalid accounts (#33887)
* refactor: create bank::fee_distribution module

* feature: add checks to fee distribution

* refactor: move Bank::deposit fn into test_utils

* feedback

* feedback 2

* add datapoints

* change to datapoint_warn

* typo
2023-11-06 10:02:22 +08:00
Joe C ecd674bd92
revert programify feature gate (#33897) 2023-10-27 18:28:13 +02:00
Kevin Heavey af7fd32f4c
chore: fix some typos (#33833)
* fix spelling of "retrieved"
* fix spelling of "should"
* fix spelling of "comparisons"
2023-10-25 16:21:53 +02:00
Yihau Chen 7d56c3484c
test: check the existence of target_path_parent before detelting (#33812) 2023-10-23 14:14:34 +00:00
Dmitri Makarov 8260ffc1ef
Bump platform-tools to v1.39 (#33804) 2023-10-21 16:22:16 -04:00
ripatel-fd 6798e05b0a
Fix typo in feature_set.rs (#33777)
Co-authored-by: Richard Patel <ripatel@jumptrading.com>
2023-10-20 10:26:13 +02:00
Joe C 6b1e9b8974
SDK: update error variants in `Feature::from_account_info` (#33750) 2023-10-20 07:35:22 +02:00
Joe C 37d093a30e
program error: add `ArithmeticOverflow` (#33767) 2023-10-20 07:33:21 +02:00
Joe C 4cb5065e0d
program error: add `InvalidAccountOwner` (#33766) 2023-10-19 18:15:51 +02:00
Brooks c1353e172c
Removes cap_accounts_data_allocations_per_transaction featurization (#33754) 2023-10-19 07:01:15 -04:00
Illia Bobyr 84c2f9de55
program::message::AccountKeys: `Clone`, `Default`, `Debug`, `Eq` (#33749)
It is a pretty standard set of traits to implement on most types.  Both `Pubkey`
and `LoadedAddresses` contained within the `AccountKeys` already implement them.
Doing the same for `AccountKeys` could simplify unit tests and/or some common
value manipulation logic.
2023-10-18 10:22:33 -07:00
Illia Bobyr b5b48eeb72
Cargo.toml: Sort dependency and feature lists (#33670)
Keeping these sorted reduces merge conflicts.
2023-10-17 01:12:15 -07:00
Pierre 8a20e7f8de
sdk: fix broken C examples (#33701)
fix C broken example
2023-10-16 23:53:03 +02:00
Brennan b36d051b51
Update hashes per tick with feature gates (#33600)
* Update hashes per tick with feature gates
2023-10-11 09:58:06 -07:00
Alexander Meißner cb695c7b32
Cleanup - Feature Gate of `enable_early_verification_of_account_modifications` (#33579)
Cleans up the feature gate of enable_early_verification_of_account_modifications:
- Removes PreAccount
- Removes InvokeContext::pre_accounts and InvokeContext::rent
- Removes InvokeContext::verify() and InvokeContext::verify_and_update()
- Removes TransactionContext::is_early_verification_of_account_modifications_enabled()
- Removes TransactionAccounts::is_early_verification_of_account_modifications_enabled
- No longer optional: TransactionContext::rent
2023-10-10 17:26:17 +02:00
Ryo Onodera 95810d876a
Enable frozen_abi on banking trace file (#33501)
* Enable frozen_abi on banking trace file

* Fix ci with really correct bugfix...

* Remove tracker_callers

* Fix typo...

* Fix AbiExample for Arc/Rc's Weaks

* Added comment for AbiExample impl of SystemTime

* Simplify and document EvenAsOpaque with new usage

* Minor clean-ups

* Simplify SystemTime::example() with UNIX_EPOCH...

* Add comment for AbiExample subtleties
2023-10-07 13:15:38 +09:00
Sammy Harris 41ed9ab6d9
Fix: handle `-- --target-dir` arg in `cargo build-sbf` (#33555)
* fix: handle target dir override in build-sbf cargo args

* fix: refactor to canonicalize target arg for workspace absolute paths

* fix: nightly linting
2023-10-06 13:48:12 -07:00
Joe C 25460f76e7
Bank: Add function to replace empty account with upgradeable program on feature activation (#32783)
* replace program account

* modify for all cases

* remove non-data swap

* address tests & conditional feedback

* get the rent involved

* mix in owner & executable

* feature-related cases

* stripped back to feature-specific case only

* added feature

* address initial feedback

* added more lamport checks

* condense tests

* using test_case

* add fail cases to tests

* more cleanup

* add verifiably built program

* update program account state

* cleaned up serializing logic

* use full word capitalization

* rename old & new to dst & src

* swap src and dst in parameters

* add warnings and errors

* rename feature to programify

* test suite description clarity

* remove strings from datapoints

* spell out source and destination

* more verbose comments in account replace functions

* move lamport calculation

* swap lamport check for state check

* move replace functions to helper module

* make replace_account methods fallible

* refactor error handling

* add test for source program state
2023-10-04 19:54:59 +02:00
Andrew Fitzgerald 5a95e5676e
Manually add lookup table addresses instead of sanitizing (#33273) 2023-10-04 08:04:43 -07:00
Will Hickey c6ee69e0dc
Update version to v1.18.0 (#33487) 2023-10-03 10:20:24 -05:00
ch9xy 9f6ef2fe62
Typo fix in instruction.rs (#33473)
Typo fix
2023-09-30 06:05:05 +00:00
Yihau Chen 0b2beba357
chore(bpf): remove unused deps (#33435)
chore: remove unused deps
2023-09-28 11:16:16 +00: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
samkim-crypto 08aba38d35
[feature-id] add poseidon compression syscall feature id (#33392)
add poseidon compression syscall feature id
2023-09-25 09:26:17 -07:00
ananas-block 997aa0a3f8
Feat(syscall): add altbn128 g1 & g2 compression (#32870)
* solana-program - altbn128: add g1 & g2 compression

still fixing tests for point of infinity

feat: proof compression syscall working

add rust test to ci

remove prints

added c test

added sycall pricing

* fixed ci checks

* refactored altbn128 and compression
2023-09-25 05:43:34 -07:00
Trent Nelson 1840fd7ab3
Feature - better error codes for tx lamport check (#33343)
Replaces `TransactionError::InstructionError(0, InstructionError::UnbalancedInstruction)` with `TransactionError::UnbalancedTransaction`.

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
2023-09-22 23:58:05 +00:00
Trent Nelson 7c545b0ae9
bump rust stable to 1.72.1 (#33333)
* bump rust stable to 1.72.1

* bump rust nightly to 2023-09-20

* fix nightly lint -- unused doc comment

-- rustdoc does not generate documentation for expression fields

* fix nightly lint -- unnecessarily eager cloning of iterator items

* fix nightly lint -- loop never actually loops
2023-09-20 23:53:36 -06:00
Tyera bca41edf20
Make active stake consistent in split (#33295)
* Add feature gate

* Add helper fn

* Require split destination to be rent-exempt if it is active

* Update cli to prefund split accounts

* cli: require rent param with sign-only

* Update tokens to prefund split accounts

* Update split tests with sysvar accounts

* Fix test_split_to_account_with_rent_exempt_reserve

* Fix test_staked_split_destination_minimum_balance

* Fix test_split_more_than_staked

* Fix test_split_minimum_stake_delegation and remove misleading StakeState::Initialized case

* Fix test_split_from_larger_sized_account

* Add test for pre-/post-activation behavior splitting some or all of stake account

* Assert active stake

* Fix runtime test

* Ignore stake-pool downstream

* Review comments

* Feature gate sysvar reads
2023-09-20 06:00:51 +00:00
Kevin Heavey 92ab3827fd
program: move array-bytes to dev-dependencies (#33277)
* program: move array-bytes to dev-dependencies

* run cargo-for-all-lock-files.sh tree
2023-09-19 09:07:35 -07:00
Alexander Meißner bc38ef27d8
Feature - Enable Program-Runtime-v2 and Loader-v4 (#33294)
* Adds a new feature `enable_program_runtime_v2_and_loader_v4`.

* Adds a feature gated builtin entry for the solana_loader_v4_program.
2023-09-19 16:29:52 +02:00
Pankaj Garg 5dbc19ccbf
Processors to compile and send LoaderV4 CLI commands (#33228)
* Processors to compile and send LoaderV4 CLI commands

* suppress unused code warning

* clippy fixes

* redeploy program using source buffer

* unify deploy and redeploy to a single function

* clippy fixes

* fixes after testing the CLI frontend
2023-09-18 06:43:33 -07:00
Brooks 6481496564
Derives Pod and Zeroable on Hash (#33256) 2023-09-15 07:27:30 -04:00
behzad nouri c1090d3959
moves new_warmup_cooldown_rate_epoch outside iterators and for loops (#33259)
Recalculating new_warmup_cooldown_rate_epoch for each item is redundant
and wasteful and instead can be done only once outside the iterators and
for loops.
Also NewWarmupCooldownRateEpoch is unnecessary and verbose and is
removed in this commit.
2023-09-15 00:06:34 +00:00