Commit Graph

2358 Commits

Author SHA1 Message Date
Yihau Chen 58e9a19f11 [anza migration] ci: fix path (#8)
* ci: fix windows build

* ci: publish sdk docker image with the new name

* update automerge status
2024-03-03 12:31:24 +08:00
Brooks 3ec020f742
Removes cap_accounts_data_size_per_block feature (#35381) 2024-03-01 14:22:25 -05:00
Brooks 672943224e
Removes cap_accounts_data_len feature (#35378) 2024-03-01 14:22:19 -05:00
Han Yang e3b9d7fbb3
SDK: refactor `Signer` and `Signers` traits (#34984)
* read_keypair_file\((.+?)\)[\n\r\s]+.unwrap\(\)[\n\r\s]+.into\(\) -> Box::new(read_keypair_file().unwrap()), Presigner::new\((.*?)\).into\(\) -> Box::new(Presigner::new())

* compiles

* moar general

* doc

* Result impls FromIterator

* doc
2024-03-01 12:34:32 +01:00
Justin Starry c9c2fbbdd6
Add `Message::is_maybe_writable` (#35340) 2024-02-29 10:27:33 +08:00
Justin Starry 312f786abf
Rename `SanitizedMessage::try_from` to `try_from_legacy_message` (#35338)
* Simplify and refactor tx message creation in tests

* Rename SanitizedMessage::try_from to try_from_legacy_message
2024-02-29 08:25:22 +08:00
Lucas Steuernagel 8f3e960640
Add tests for private functions in SVM `account_loader.rs` (#35334) 2024-02-28 14:17:45 -03:00
Tao Zhu 089cead024
add bench for precompiled programs (#35310)
* add bench for ed25519 instruction

* add bench for secp256k1 instruction

* Apply suggestions from code review

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>

* prepare unique txs for benching

* use iter::Cycle for endless loop

---------

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2024-02-28 09:06:55 -06:00
Lucas Steuernagel 8be9930c98
Bump platform tools version (#35330)
Co-authored-by: Dmitri Makarov <dmakarov@users.noreply.github.com>
2024-02-27 17:58:26 -03:00
Michal Rostecki e74d5ccca3
hash: Use `finalize().into()` instead of `try_into()` for hash results (#35300)
`sha2` and `sha3` crates already moved to `generic-array` 0.14.7,
which means that we can safely convert the hash result to a sized
array just by calling `finalize().into()`, which doesn't return
any errors.
2024-02-23 19:31:32 -07:00
Tao Zhu 139b9c8c25
Add fee_details to fee calculation (#35021)
* add fee_details to fee calculation

* fix - no need to round after summing u64

* feature gate on removing unwanted rounding
2024-02-23 08:58:48 -06:00
HaoranYi 141048ee74
update comments for is_builtin (#35258)
Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-02-20 16:45:38 -06:00
Ashwin Sekar befe8b9d98
replay: reload tower if set-identity during startup (#35173)
* replay: reload tower if set-identity during startup

* pr feedback: add unit tests

* pr feedback: use tower.node_pubkey, more descriptive names
2024-02-20 09:30:46 -08:00
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