Commit Graph

26079 Commits

Author SHA1 Message Date
Jeff Washington (jwash) e1e9a8394c
add stats for ancient bytes_from_newest_storages (#1802)
* add stats for ancient bytes_from_smallest_storages

* fix else if

* remove totally unrelated demo code. ugh.
2024-06-21 19:52:15 +00:00
Lucas Ste 437a6b1c92
Verify elf locally for write buffer cli command (#1794)
Verify elf locally for write buffer command
2024-06-21 15:31:32 -03:00
Joe C 1a679f470a
SVM: update spec (#1814) 2024-06-21 12:21:43 -05:00
Joe C 0f956c8ba7
SVM: Refactor program match criteria (#1784)
* SVM: hoist `program_modification_slot` up from bank

* SVM: add `check_program_modification_slot` to processing config

* SVM: hoist `program_match_criteria` up from bank

* SVM: drop `get_program_match_critera` from callbacks
2024-06-21 12:21:26 -05:00
Ryo Onodera 114d94a25e
Improve SchedulerStatus code and test as follow-up (#1797)
* Improve SchedulerStatus code and test as follow-up

* Don't use wait_timeout_while with magic number
2024-06-21 23:21:32 +09:00
Tao Zhu 077a651f01
harden sbf realloc tests (#1600) 2024-06-21 08:34:20 -05:00
Jon C 9bb532abcc
deps: Use bytemuck_derive explicitly instead of "derive" feature on bytemuck (#1799)
* deps: Use bytemuck_derive explicitly

* Missed a couple in zk-token-sdk

* Fix last few bits

* Fixup a re-export

* Use re-exports properly
2024-06-21 12:50:36 +02:00
samkim-crypto 1279ae6068
[docs] Add ciphertext validity proof docs (#1776)
* docs: add ciphertext validity proof docs

* update docs link to anza's

* remove extra space at the end of line
2024-06-21 10:33:31 +09:00
steviez 3ee204b5cb
ledger-tool: Get shreds from BigTable blocks (#1638)
There is often a desire to examine/replay/etc older blocks. If the
blocks are recent enough, they can be pulled from an actively running
node. Otherwise, the blocks must be pulled down from warehouse node
archives. These archives are uploaded on a per-epoch basis so they are
quite large, and can take multiple hours to download and decompress.

With the addition of Entry data to BigTable, blocks can be recreated
from BigTable data. Namely, we can recreate the Entries with proper PoH
and transaction data. We can then shred them such that they are the
same format as blocks that are produced from the cluster.

This change introduces a new command that will read BigTable data and
insert shreds into a local Blockstore. The new command is:
  $ agave-ledger-tool bigtable shreds ...

Several important notes about the change:
- Shred for some slot S will not be signed by the actual leader for
  slot S. Instead, shreds will be signed with a "dummy" keypair. The
  shred signatures does not affect the ability to replay the block.
- Entry PoH data does not go back to genesis in BigTable. This data
  could be extracted and uploaded from the existing rocksdb archives;
  however, that work is not planned as far as I know. --allow-mock-poh
  can be passed to generate filler PoH data. Blocks created with this
  flag are replayable by passing --skip-poh-verify to ledger-tool.
- A snapshot will be unpacked to determine items such as the shred
  version, tick hash rate and ticks per slot. This snapshot must be in
  the same epoch as the requested slots
2024-06-20 16:02:28 -05:00
Andrew Fitzgerald 8747c3f5e9
Clean up: remove unused _feature_set (#1803) 2024-06-20 15:35:48 -05:00
Justin Starry 66e3acce45
Rename tx counts from committed to executed (#1807) 2024-06-20 13:13:47 -07:00
Justin Starry 0d1ad0dc1d
Reuse compute budget processing (#1700)
* refactor: reuse compute budget limits

* fix tests
2024-06-20 19:22:19 +00:00
Andrew Fitzgerald 98f5d0ea63
ReadWriteAccountSet: use AHashSet (#1265) 2024-06-20 14:04:47 -05:00
Sammy Harris a9e3917082
Fix SyscallLogPubkey doc comment (#1805)
* Fix SyscallLogPubkey doc comment

* Update logging.rs
2024-06-20 11:22:16 -06:00
Tao Zhu 3668d104fe
charging CU for loaded accounts data size (#1356) 2024-06-20 11:54:20 -05:00
knotts 5feacd1d13
typo fixes (#1795) 2024-06-20 11:42:31 -05:00
Andrew Fitzgerald b0737e0e59
change match to an if (#726) 2024-06-20 11:38:14 -05:00
Justin Starry 8da4062644
refactor: consolidate fee deduction for failed transactions (#1636) 2024-06-20 08:03:40 -07:00
Brooks b1815e784d
Round up correctly when truncating max ancient storages (#1781) 2024-06-20 10:54:18 -04:00
Andrew Fitzgerald 246fc3c2f0
PrioGraphScheduler::complete_batch remove TransactionAccountLocks allocation (#1759) 2024-06-20 06:46:27 -05:00
Alexander Meißner eceaf3433b
CI - SBPF program build script (#1581)
* Replaces the rust build script by a makefile
2024-06-20 13:40:00 +02:00
Lucas Ste 974c013c04
Make futures crate optional in solana-type-overrides (#1792) 2024-06-20 07:49:10 -03:00
Kevin Heavey 6cf32250ee
use bytemuck_derive 1.7.0 explicitly in sdk and program (#1793)
* use bytemuck_derive 1.7.0 explicitly in sdk and program

* explicitly activate the derive feature of bytemuck in zk-sdk
2024-06-20 09:42:37 +02:00
steviez b70e6bbfd2
ledger-tool: Make verify --print-bank-hash support json (#1745)
The bank-hash command in ledger-tool was recently deprecated. However,
the command is used by some of the scripts that coordinate starting up
a fresh cluster. So, the deprecation of bank-hash broke those scripts.

This change fixes the scripts by doing the following:
- Makes --print-bank-hash support --output json
- Updates scripts to install jq on provisioned nodes
- Update remote-node.sh to parse the bank hash from json using jq
2024-06-20 00:15:18 -05:00
Alessandro Decina 2107adcf35
bpf_loader: use an explicit thread-local pool for stack and heap memory (#1370)
* Rename ComputeBudget::max_invoke_stack_height to max_instruction_stack_depth

The new name is consistent with the existing
ComputeBudget::max_instruction_trace_length.

Also expose compute_budget:MAX_INSTRUCTION_DEPTH.

* bpf_loader: use an explicit thread-local pool for stack and heap memory

Use a fixed thread-local pool to hold stack and heap memory. This
mitigates the long standing issue of jemalloc causing TLB shootdowns to
serve such frequent large allocations.

Because we need 1 stack and 1 heap region per instruction, and the
current max instruction nesting is hardcoded to 5, the pre-allocated
size is (MAX_STACK + MAX_HEAP) * 5 * NUM_THREADS. With the current
limits that's about 2.5MB per thread. Note that this is memory that
would eventually get allocated anyway, we're just pre-allocating it now.

* programs/sbf: add test for stack/heap zeroing

Add TEST_STACK_HEAP_ZEROED which tests that stack and heap regions are
zeroed across reuse from the memory pool.
2024-06-20 08:57:11 +07:00
Ryo Onodera 3e53b644a8
Adjust replay-related metrics for unified scheduler (#1741)
* Adjust replay-related metrics for unified schduler

* Fix grammar

* Don't compute slowest for unified scheduler

* Rename to is_unified_scheduler_enabled

* Hoist uses to top of file

* Conditionally disable replay-slot-end-to-end-stats

* Remove the misleading fairly balanced text
2024-06-20 09:12:04 +09:00
Kevin Heavey 2bdba73ee6
program: move itertools to dev-dependencies (#1782)
* port join from itertools and use it in program_stubs.rs

* move itertools to dev-dependencies of solana-program

* add comment to join fn

* more concise replacement for join fn

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

* remove join fn

---------

Co-authored-by: Jon C <me@jonc.dev>
2024-06-19 23:08:19 +02:00
dependabot[bot] 403b793fde
build(deps): bump url from 2.5.1 to 2.5.2 (#1788)
* build(deps): bump url from 2.5.1 to 2.5.2

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

---
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-19 23:16:36 +08:00
dependabot[bot] c8c23e2246
build(deps): bump bytemuck from 1.16.0 to 1.16.1 (#1789)
* build(deps): bump bytemuck from 1.16.0 to 1.16.1

Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.16.0 to 1.16.1.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.16.0...v1.16.1)

---
updated-dependencies:
- dependency-name: bytemuck
  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-19 23:16:26 +08:00
Yihau Chen a6bc917f36
ci: ignore curve25519-dalek audit temporarily (#1786)
ci: ignore curve25519-dalek audit
2024-06-19 12:12:57 +08:00
Alexander Meißner da6f7f2d31
Refactor - Avoid host build of SBPF program test crates (#1711)
* Removes ProgramTest from simulation tests.

* Removes ProgramTest from sysvar syscall tests.

* Workaround for rustc crash caused by 16 byte aligned memcpy.

* Deduplicates test_program_sbf_sanity.

* Moves mem and remaining_compute_units into test_program_sbf_sanity().

* Removes unused dev-dependencies in Cargo.toml.

* Removes crate-type = lib from Cargo.tomls.

* Adds SBF_OUT_DIR env to CI script.

* Adds "sysvar" to build.rs.
2024-06-18 23:10:40 +02:00
Jeff Washington (jwash) 4c921ca276
add ancient pack metrics (#1750)
* add ancient pack metrics

* add missing params

---------

Co-authored-by: brooks <brooks@anza.xyz>
2024-06-18 19:45:43 +00:00
steviez ba2ff5384d
ledger-tool: Deduplicate max-genesis-archive-unpacked-size argument (#1774)
The argument is currently declared in multiple places. So, delcare the
argument in one central place.
2024-06-18 13:15:02 -05:00
Pankaj Garg ad0a48c731
SVM: Reduce public visibility of sysvar_cache (#1783) 2024-06-18 10:53:57 -07:00
Jeff Washington (jwash) 7eca784e78
remove double-counted metric (#1748) 2024-06-18 17:26:34 +00:00
Jeff Washington (jwash) d2b3476db9
always pack a few newest ancient slots (#1730)
* always pack a few newest ancient slots

* pr feedback

* remove extra ()

* adds high slot tests

---------

Co-authored-by: brooks <brooks@anza.xyz>
2024-06-18 11:20:27 -05:00
Joe C 2dc95087ae
SVM: Move `fee_structure` to environment input (#1771)
* SVM: add `fee_structure` to environment arg

* runtime: add `fee_structure` to bank

* SVM: drop `fee_structure` from global configs
2024-06-18 10:07:22 -05:00
Brooks 954f3d175b
Adds `diff` to accounts-hash-cache-tool (#1772) 2024-06-18 10:40:51 -04:00
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