Commit Graph

2303 Commits

Author SHA1 Message Date
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