Commit Graph

26091 Commits

Author SHA1 Message Date
Jon C 62eb6ef82b
transaction-status: Use string instead of int for `amount` in `amountToUiAmount` (#1737)
* transaction-status: Use string instead of int for `amount`

* Add a changelog entry

* Update CHANGELOG.md

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

---------

Co-authored-by: Tyera <teulberg@gmail.com>
2024-06-18 16:10:47 +02:00
Kevin Heavey 25ec30452c
sdk: Only compile wasm-bindgen when target_arch = "wasm32" (#1658)
* move wasm-bindgen dep under cfg(target_arch = "wasm32") in sdk and program

* remove wasm_bindgen_stub (we don't need it where we're going)

* put wasm_bindgen usage behind #[cfg(target_arch = "wasm32")]

* remove doc comments from skippeed fields

* add missing attribute

* another missing attribute

* add doc comments explaining duplicated structs

* fmt

* fix wasm comments

* Update sdk/program/src/instruction.rs

---------

Co-authored-by: Jon C <me@jonc.dev>
2024-06-18 14:54:41 +02:00
samkim-crypto ef80b59f9b
[curve25519] Remove `ElGamalError` from curve25519 crate (#1777)
* remove `ElGamalError` from curve25519 crate

* add `ElGamalError` to zk-token-sdk
2024-06-18 20:39:43 +09:00
Sean Young cd7f34ecfc
Ensure mapping of callee is updated with direct mapping (#1093)
Consider this scenario:

 - Program increases length of an account
 - Program start CPI and adds this account as a read-only account
 - In fn update_callee_account() we resize account, which may change
   the pointer
 - Once CPI finishes, the program continues and may read/write from
   the account. The mapping must be up-to-date else we use stale
   pointers.

Note that we always call callee_account.set_data_length(), which
may change the pointer. In testing I found that resizing a vector
from 10240 down to 127 sometimes changes its pointer. So, always
update the pointer.
2024-06-18 10:13:00 +01:00
Kevin Heavey b855bd0c54
Extract curve25519 crate from zk-token-sdk (#951)
* extract curve25519 crate

* remove obsolete comment

* fix Cargo.toml files

* fix imports

* update lock file

* remove unused deps from zk-token-sdk

* fmt

* add solana-curve25519 patch

* add missing override to programs/sbf/Cargo.toml

* copy over an allow()

* move new crate to curves dir

* use workspace version

* add back missing dev dep

* add missing dependencies to programs/sbf

* fmt

* move dep to the correct dependency table

* remove #[cfg(not(target_os = "solana"))] above errors mod
2024-06-18 14:08:57 +09:00
steviez 4e0afd6c8c
ledger-tool: Make joining AccountsBackgroundService optional (#1673)
AccountsBackgroundService performs several operations that can take a
long time to complete and do not check the exit flag mid-operation.
Thus, ledger-tool can get hung up for a while waiting for ABS to
finish. However, many ledger-tool command do not ABS to have finished.

So, return a handle to the ABS thread and allow the caller to decide
whether to join ABS or not. As of right now, create-snapshot is the
only command that requires ABS to have finished before continuing.
2024-06-17 23:36:49 -05:00
steviez 878ef1f89f
ledger-tool: Subfunction for snapshot args (#1773)
There are several arguments to control snapshot configuration in the
various ledger-tool commands. The inclusion of args in each command
is inconsistent, especially for commands outside of main.rs

This change consolidates the snapshot related arguments into a single
function to help create consistency and reduce duplicate code
2024-06-17 21:55:07 -05:00
Ryo Onodera d9fcfeb12a
Don't panic when pausing stale unified schedulers (#1761) 2024-06-18 11:44:16 +09:00
samkim-crypto 563d1c04d6
[sdk] Add ZK Elgamal Proof program feature gate (#1679)
* add `zk-elgamal-proof-program-enabled` feature gate

* reserve account for zk elgamal proof program

* add zk elgamal proof as builtin program

* cargo lock

* cargo sort

* replace feature gate key to start with `zk..`

* add simd number

* update `elgamal_program` to `zk_elgamal_proof_program`
2024-06-18 11:34:34 +09:00
Andrew Fitzgerald d06a3aceb2
fix race condition on vote count (#1762) 2024-06-17 20:22:06 -05:00
Greg Cusack ddb4b3b2b7
run full gossip node when running `solana-gossip rpc-url` (#1753)
* send actual gossip ip:port when running solana-gossip rpc-url

* refactor gossip_addr out from spy and rpc methods
2024-06-18 00:05:02 +00:00
Tyera 034cd7396a
Add num_partitions to Blockstore rewards (#1601)
* Add num_partitions field to Rewards proto definition

* Add type to hold rewards plus num_partitions

* Add Bank method to get rewards plus num_partitions for recording

* Update Blockstore::write_rewards to use num_partitions

* Update RewardsRecorderService to handle num_partitions

* Populate num_partitions in ReplayStage::record_rewards

* Write num_partitions to Bigtable

* Reword KeyedRewardsAndNumPartitions method

* Clone immediately

* Determine epoch boundary by checking parent epoch

* Rename UiConfirmedBlock field

* nit: fix comment typo

* Add test_get_rewards_and_partitions

* Add pre-activation test

* Add should_record unit test
2024-06-17 16:42:33 -06:00
Lucas Ste ebd063eb79
Add Shuttle multithreading test infrastructure (#1634) 2024-06-17 19:24:43 -03:00
Pankaj Garg 2e54ed280b
SVM: Unify different instances of epoch_schedule in SVM and Bank into one (#1736) 2024-06-17 15:18:34 -07:00
Joe C 3af8f0cfdb
Program Runtime: Unify transaction batch program caches (#1399)
* local program cache: add `modified_entries` field

* use `modified_entries` for modified program cache

* invoke context: make `program_cache_for_tx_batch` mutable

* invoke context: unify local program cache instances

* remove `find_program_in_cache` alias
2024-06-17 17:08:13 -05:00
samkim-crypto 7ff7fe95d8
[docs] Update ZK Token Proof program to ZK ElGamal Proof program (#1758)
* docs: update ZK Token Proof program to ZK ElGamal Proof program

* remove blank line at eof
2024-06-18 06:46:48 +09:00
Tyera 863137135a
Simd-118: [HAL-04] simplify assertion that epoch contains enough slots for partitions (#1769)
Simplify assertion that epoch contains enough slots for partitions
2024-06-17 15:41:47 -06:00
Lucas Ste 8b8ddcbb84
Verify elf with active feature set before attempting deployment (#1654)
Co-authored-by: Jon C <me@jonc.dev>
2024-06-17 18:25:25 -03:00
Tyera c1bfb28d83
Simd-118: [HAL-01] add log to unreachable macro (#1767)
Add log to unreachable macro
2024-06-17 20:22:45 +00:00
Tyera 24d0bd850e
Simd-118: [HAL-02] add lamports burned to error log (#1768)
Add lamports burned to error log
2024-06-17 20:03:57 +00:00
steviez d056710c3e
ledger-tool: Use helper for AccountsDb args (#1749)
There are a handful of commands that specify AccountsDb config. To
create consistency between all these commands and remove repeated code,
build all of the arguments in a helper function that is passed to the
relevant commands.
2024-06-17 13:58:05 -05:00
Yihau Chen f7dad6d44c
ci: upgrade client-traget macos version (#1765) 2024-06-17 18:20:57 +00:00
Greg Cusack 7f2beb21a1
add retries to transaction sending in LocalCluster (#1747) 2024-06-18 00:20:17 +08:00
Andrei Silviu Dragnea f43cfc8c2e
refactor: clean up geyser-plugin-manager (#1570)
* Remove redundant Option return type from accountinfo_from_shared_account_data

* Remove redundant Option return type from accountinfo_from_stored_account_meta
2024-06-17 08:14:27 -05:00
Kevin Heavey 988647d814
remove unused build dep `cc` from solana-program (#1659)
* remove unused build dep `cc` from solana-program

* remove cc from workspace
2024-06-17 08:13:54 -05:00
Joe C aae4b33d94
SVM: update spec (#1757) 2024-06-17 07:56:16 -05:00
Jon C 9d8310cbe7
CHANGELOG: `Copy` no longer derived on Rent and EpochSchedule (#1746) 2024-06-17 12:53:53 +02:00
Wen a5229f989c
wen_restart: Ignore Gossip messages from my own pubkey. (#1678) 2024-06-15 10:50:32 -07:00
Kirill Fomichev dbea20b12a
rpc: add more services to getClusterNodes (#1637)
* rpc: add tpu_forwards/tpu_forwards_quic to getClusterNodes

* add tvu

* order

* add tpu_vote

* add serve_repair

* fix tests

* fix name in tests

* remove tvu / repair quic
2024-06-14 12:19:15 -06:00
HaoranYi d2124a995f
accounts-db: get rid of const in tests (#1732)
get rid of const in tests

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-06-14 09:37:53 -05:00
galactus a6b2283142
ScanConfig defaults no longer sort results (#1539) 2024-06-14 08:27:33 -04:00
Joe C a108498af1
SVM: Group transaction processing environment (#1650)
* SVM: introduce `TransactionProcessingEnvironment`

* SVM: fold `blockhash` and `lamports_per_signature` into env

* SVM: fold `rent_collector` into env

* SVM: fold `feature_set` into env

* SVM: fold `epoch_stake` into env
2024-06-14 00:02:50 -05:00
Brooks 7b4c4f6fb4
Adds accounts-hash-cache-tool to inspect accounts hash cache files (#1731) 2024-06-13 16:16:42 -04:00
Jeff Washington (jwash) 91a4ecfff7
refactor file version of get_account_shared_data (#1712)
* refactor file version of get_account_shared_data

* add tests to cover corrupted file when we can't read the complete data
for the account

* pr comments

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-06-13 14:08:45 -05:00
Tyera d319d0d1be
Reorganize partitioned_epoch_rewards::tests fixtures (#1719)
* Move test fixtures up

* Update test_rewards_computation_and_partitioned_distribution_two_blocks

* Update test_rewards_computation_and_partitioned_distribution_one_block
2024-06-13 11:45:44 -06:00
Brooks 29a36b66c1
Fixes test_add_builtin_account() (#1727) 2024-06-13 13:36:37 -04:00
Greg Cusack 63fb9fe9d9
Remove `ThinClient` from `LocalCluster` (#1300)
* setup tpu client methods required for localcluster to use TpuClient

* add new_tpu_quic_client() for local cluster tests

* update local-cluster src files to use TpuClient. tests next

* finish removing thinclient from localcluster

* address comments

* add note for send_and_confirm_transaction_with_retries

* remove retry logic from tpu-client. Send directly to upcoming leaders without retry.
2024-06-13 10:31:10 -07:00
steviez 6d8fa7a97b
ledger-tool: Deprecate bank-hash command (#1710)
ledger-tool has a somewhat cluttered interface. The bank-hash command
offers little extra functionality compared to what the verify command
does, and could instead be an optional flag for the verify command.

This change leaves the bank-hash command present, but prints an error
message and tells the user to instead use verify --print-bank-hash. The
command will be removed altogether in the future.
2024-06-13 12:13:39 -05:00
Kevin Heavey 7e0688341e
remove superfluous usage of allow(dead_code) (#1669) 2024-06-13 22:52:49 +08:00
HaoranYi e366797875
Use accounts_keep_slots map len for stats (#1716)
use accounts_keep_slots map len for stats

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-06-13 09:15:21 -05:00
Pankaj Garg 11018b5d35
Cleanup call to cache read lock in `prepare_program_cache_for_upcoming_feature_set()` (#1694) 2024-06-13 07:02:32 -07:00
dependabot[bot] 854620f51d
build(deps): bump lz4 from 1.24.0 to 1.25.0 (#1724)
* build(deps): bump lz4 from 1.24.0 to 1.25.0

Bumps [lz4](https://github.com/10xGenomics/lz4-rs) from 1.24.0 to 1.25.0.
- [Release notes](https://github.com/10xGenomics/lz4-rs/releases)
- [Changelog](https://github.com/10XGenomics/lz4-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/10xGenomics/lz4-rs/commits/v1.25)

---
updated-dependencies:
- dependency-name: lz4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update all Cargo files

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 22:01:45 +08:00
dependabot[bot] 791f6ba5cf
build(deps): bump proc-macro2 from 1.0.84 to 1.0.85 (#1723)
* build(deps): bump proc-macro2 from 1.0.84 to 1.0.85

Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.84 to 1.0.85.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.84...1.0.85)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update all Cargo files

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 22:01:29 +08:00
samkim-crypto 174f241cbe
[zk-sdk] Expose function to convert a grouped ElGamal ciphertext to a regular ciphertext (#1715) 2024-06-13 21:08:15 +09:00
samkim-crypto b5b4c007e5
[zk-sdk] Add functions to derive `ElGamalKeypair` and `AeKey` from `Signature` (#1717) 2024-06-13 21:08:01 +09:00
Yihau Chen c30f173004
ci: print spl commit hash for downstream tests (#1718)
* ci: print the commit hash of spl that is using in downstream project tests

* ci: trigger spl downstream tests correctly
2024-06-13 11:11:25 +00:00
Jon C 9be66e975e
sdk-macro: Move package_metadata macro to separate crate (#1713)
* sdk-macro: Move package_metadata macro to separate crate

* Update sbf lockfile

* Cargo fmt
2024-06-13 13:05:58 +02:00
dependabot[bot] 7b8f9d88d9
build(deps): bump url from 2.5.0 to 2.5.1 (#1722)
* build(deps): bump url from 2.5.0 to 2.5.1

Bumps [url](https://github.com/servo/rust-url) from 2.5.0 to 2.5.1.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.5.0...v2.5.1)

---
updated-dependencies:
- dependency-name: url
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update all Cargo files

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 18:27:19 +08:00
Yihau Chen 73b6df0ce1
test: ensure using the latest blockhash to process tx (#1720)
ensure using the latest blockhash to process tx

we see tests failing in CI due to the blockhash being invalid. details: https://github.com/anza-xyz/agave/pull/1693#discussion_r1637439072
2024-06-13 17:32:37 +08:00
Ryo Onodera 334221503c
Return back stale out-of-pool scheduler by timeout (#1690)
* Return back stale out-of-pool scheduler by timeout

* Add tests

* Document and proper panic messages

* Avoid recursion

* Tweak comments
2024-06-13 12:48:49 +09:00