Commit Graph

18539 Commits

Author SHA1 Message Date
Matt Green 9f3eba1d12 Link to SPL documentation in terminology page 2022-04-21 13:56:49 -07:00
Jeff Washington (jwash) a0c4be8cd7
add StorableAccountsMovingSlots (#24555) 2022-04-21 15:48:20 -05:00
Lijun Wang 7c61e438fc
Batch tpu calls in send-transaction-service (#24083)
Introduced flag --tpu-do-batch2.
Introduced flag to control the batch size-- by default 100
The default batch timeout is 200ms -- configurable. If either it time out or the batch size is filled, a new batch is sent
The batch honor the retry rate on the transaction already sent before.
Introduced two threads in STS: one for receiving new transactions and doing batch send and one for retrying old transactions and doing batch.6.
Fixes #
2022-04-21 12:43:08 -07:00
Jeff Washington (jwash) 25e9199397
cleanup FlushStats (#24556) 2022-04-21 14:05:01 -05:00
Yihau Chen 3d0ca2d94e
feat: export web3 to minnor repo (#24557) 2022-04-21 18:51:32 +00:00
Jeff Washington (jwash) 3f7b8d3d2c
provide default impl of 'is_empty' (#24554) 2022-04-21 12:49:44 -05:00
Jack May 28ed2a9df4
Simplify syscall register and bind (#24546) 2022-04-21 09:09:07 -07:00
behzad nouri d524ae293f collects metrics for cached vote/stake accounts consistency
Tracking mismatches between cached vote/stake accounts and accounts-db
in preparation of activating feature for updating rewards at
epoch-boundary using cached vote/stake accounts.
2022-04-21 15:28:41 +00:00
behzad nouri 108aa23d90 enforces type-safety in Stakes<StakeAccount> using phantom data
StakeAccount<Delegation> can only wrap a stake-state which is a
Delegation; whereas StakeAccount<()> wraps any account with stake state.

As a result, StakeAccount::<Delegation>::delegation() will return
Delegation instead of Option<Delegation>.
2022-04-21 15:28:41 +00:00
behzad nouri f937fcbd95 updates rewards at epoch boundary using cached accounts
Loading vote and stake accounts from accounts-db takes a significant
portion of time updating rewards at epoch boundary.

This commit bypasses accounts-db and instead uses vote and stake
accounts cached in bank stakes:
https://github.com/solana-labs/solana/blob/d2702201c/runtime/src/stakes.rs#L148-L152

These cached accounts are synchronized with accounts-db after each
transaction, and so there should not be any change in the resulting
computation:
https://github.com/solana-labs/solana/blob/d2702201c/runtime/src/bank.rs#L4526

Nevertheless, to avoid any chances of introducing a consensus issue, the
switch to cached account is feature gated.
2022-04-21 15:28:41 +00:00
behzad nouri b4491ff4ba adds StakesEnum type representing Stakes<StakeAccount|Delegation>
For backward compatibility, we can only serialize and deserialize
Stakes<Delegation>. However Bank caches Stakes<StakeAccount>. This type
mismatch incurs a conversion cost at epoch boundary when updating
EpochStakes.

This commit adds StakesEnum which allows EpochStakes to include either a
Stakes<StakeAccount> or Stakes<Delegation> and so bypass the conversion
cost between the two at the epoch boundary.
2022-04-21 15:28:41 +00:00
behzad nouri 454ef38e43 caches StakeAccount instead of Delegation in Stakes
The commit makes values in stake_delegations map in Stakes struct
generic. Stakes<Delegation> is equivalent to the old code and is used
for backward compatibility in BankFieldsTo{Serialize,Deserialize}.

But banks cache Stakes<StakeAccount> which includes the entire stake
account and StakeState deserialized from account. Doing so, will remove
the need to load stake account from accounts-db when working with
stake-delegations.
2022-04-21 15:28:41 +00:00
behzad nouri 8c4d6357fe adds StakeAccount type embodying an Account and a StakeState
The added type does sanity checks on the Account and stores deserialized
StakeState. Following commits will use this type instead of Delegation
in Stakes.
2022-04-21 15:28:41 +00:00
Justin Starry 02bfb85c16
Refactor transaction processing in banking stage (#24336)
* Refactor transaction processing in banking stage

* feedback

* more feedback
2022-04-21 21:06:26 +08:00
Justin Starry d5127abf46
Only add hashes for completed blocks to recent blockhashes (#24389)
* Only add hashes for completed blocks to recent blockhashes

* feedback
2022-04-21 21:05:29 +08:00
Tao Zhu a21fc3f303
Apply transaction actual execution units to cost_tracker (#24311)
* Pass the sum of consumed compute units to cost_tracker

* cost model tracks builtins and bpf programs separately, enabling adjust block cost by actual bpf programs execution costs

* Copied nightly-only experimental `checked_add_(un)signed` implementation to sdk

* Add function to update cost tracker with execution cost adjustment

* Review suggestion - using enum instead of struct for CommitTransactionDetails
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>

* review - rename variable to distinguish accumulated_consumed_units from individual compute_units_consumed

* not to use signed integer operations

* Review - using saturating_add_assign!(), and checked_*().unwrap_or()

* Review - using Ordering enum to cmp

* replace checked_ with saturating_

* review - remove unnecessary Option<>

* Review - add function to report number of non-zero units account to metrics
2022-04-21 07:38:07 +00:00
Justin Starry fed13b1f62
Assign backports for automerged PR to pr-subscribers group (#24523)
* Assign backports for automerged PR to pr-subscribers group

* branch on community label

* use anchor
2022-04-21 15:01:22 +08:00
dependabot[bot] 25d85bcfca
chore: bump hidapi from 1.3.4 to 1.4.1 (#24542)
Bumps [hidapi](https://github.com/ruabmbua/hidapi-rs) from 1.3.4 to 1.4.1.
- [Release notes](https://github.com/ruabmbua/hidapi-rs/releases)
- [Commits](https://github.com/ruabmbua/hidapi-rs/commits)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-20 23:27:43 -06:00
Justin Starry 79923c3b58
Refactor: Rename BlockhashQueue fields and methods for clarity (#24426) 2022-04-21 11:57:17 +08:00
Brian Anderson 658752cda7
And short descriptions to all solana-program modules and macros. (#24128)
* And short descriptions to all solana-program modules and macros.

Also fill out some of the docs within these modules.

* Update sdk/program/src/lib.rs

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

* Update sdk/program/src/sanitize.rs

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

* Update sdk/program/src/pubkey.rs

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

* Update sdk/program/src/program_memory.rs

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

* Update sdk/program/src/program_memory.rs

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

* Update sdk/program/src/program_memory.rs

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

* Update sdk/program/src/program_memory.rs

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

* Update sdk/program/src/program_memory.rs

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

* Update hash module docs

* Make solana-program crate docs match Pubkey docs

* Update sdk/program/src/program_memory.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-04-20 19:20:17 -06:00
Tyera Eulberg b42f34a7b8
Update Rpc filters to support token-2022 (#24541)
* Add TokenAccountState rpc_filter

* Use a method on RpcFliterType instead of helper
2022-04-20 19:18:12 -06:00
Jeff Biseda 96d977fd05
test_shred_fec_set_index fix (#24540) 2022-04-20 16:26:44 -07:00
dependabot[bot] 40b48f807a
chore: bump libc from 0.2.120 to 0.2.124 (#24520)
* chore: bump libc from 0.2.120 to 0.2.124

Bumps [libc](https://github.com/rust-lang/libc) from 0.2.120 to 0.2.124.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.120...0.2.124)

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

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-04-20 15:45:13 -06:00
dependabot[bot] 67bb78f4d7
chore: bump tarpc from 0.27.2 to 0.28.0 (#24532)
* chore: bump tarpc from 0.27.2 to 0.28.0

Bumps [tarpc](https://github.com/google/tarpc) from 0.27.2 to 0.28.0.
- [Release notes](https://github.com/google/tarpc/releases)
- [Changelog](https://github.com/google/tarpc/blob/master/RELEASES.md)
- [Commits](https://github.com/google/tarpc/commits/v0.28.0)

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

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-04-20 15:17:19 -06:00
Jeff Washington (jwash) 52f43a986d
skip rewrites in bank (#23985) 2022-04-20 14:08:46 -05:00
Jeff Washington (jwash) b1c89cf6d4
append_vec::remaining_bytes (#24531) 2022-04-20 13:44:57 -05:00
dependabot[bot] 15e30add26
chore: bump js-sys from 0.3.55 to 0.3.57 (#24485)
* chore: bump js-sys from 0.3.55 to 0.3.57

Bumps [js-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.55 to 0.3.57.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

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

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-04-20 11:54:44 -06:00
steveluscher 6f56b4d8ec chore: repair type:gen command in OS X and other non-GNU sed environments 2022-04-20 10:32:04 -07:00
Jon Cinque c43afe2d7f
spl: Bump token to v3.3.0 and ATA to v1.0.5 (#22649)
* Bump spl-token and ATA to v3.3.0

* Add parsers for new token instructions
* Update parser for modified associated-token-account instruction

* Update to use 1.0.5 once it's released

* Update Cargo.lock in programs/bpf
2022-04-20 19:13:42 +02:00
steviez 2a770e9726
Use unsigned_abs() instead of casting abs() (#24521) 2022-04-20 12:01:33 -05:00
Jeff Washington (jwash) 813d06529d
stats for rewrites (#24529) 2022-04-20 10:43:50 -05:00
Jeff Washington (jwash) 05438c3cd6
implement remove_old_historical_roots (#24492) 2022-04-20 10:43:32 -05:00
Josh 95e5a20713
feat(explorer): show orange for 25-50 percent ping loss (#24530) 2022-04-20 15:35:13 +00:00
Jeff Washington (jwash) cdc3c41001
helpers to skip rewrites in bank (#24507) 2022-04-20 10:21:02 -05:00
Jeff Washington (jwash) 0d797e2fff
contains_multiple_slots (#24500) 2022-04-20 09:53:36 -05:00
Jeff Washington (jwash) cfe2177e16
validator option: accounts-db-skip-rewrites (#24504) 2022-04-20 09:41:00 -05:00
Jeff Washington (jwash) 957849f4a5
load_to_collect_rent_eagerly returns loaded_slot (#24506) 2022-04-20 09:14:03 -05:00
HaoranYi d0761d0ca4
demote receive_window_num_slot_shreds to debug logging (#24505) 2022-04-20 08:51:46 -05:00
sakridge b64791ef79
Add packets and batches sent to quic client stats (#24442) 2022-04-20 13:59:54 +02:00
dependabot[bot] dd15193c69
chore: bump rayon from 1.5.1 to 1.5.2 (#24470)
* chore: bump rayon from 1.5.1 to 1.5.2

Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/commits)

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

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-04-19 23:17:52 -06:00
Michael Vines 05f32f287c solana-validator monitor now reports slot-level progress while loading blockstore 2022-04-19 22:09:48 -07:00
Dmitri Makarov 6bf58572ca Update llvm include path in C toolchain makefile 2022-04-19 21:38:36 -07:00
Tyera Eulberg 77f6ec5625
Add program_id to TokenBalances structs (#24513)
* Add program_id to TokenBalances structs

* Update docs
2022-04-19 22:01:22 -06:00
Jeff Washington (jwash) ef5e7cce6e
type PubkeyAccountSlot (#24503) 2022-04-19 21:34:00 -05:00
Jack May 5eb1ba402f
cpi charge for executables (#24396) 2022-04-19 19:31:11 -07:00
Jeff Washington (jwash) 4be01ec75a
remove temp dead_code markers (#24508) 2022-04-19 21:30:57 -05:00
Michael Vines 9e4999ef6a Remove halt_at_slot from RuntimeConfig, it's not a runtime concern 2022-04-19 19:23:58 -07:00
Michael Vines 32c008e02a Ensure farf_dir() exists before it's accessed 2022-04-19 19:23:58 -07:00
Michael Vines 988210908c Move verify_udp_stats_access out of the way 2022-04-19 19:23:58 -07:00
Michael Vines c6f3da4879 blockstore_processor now accepts an Arc<Rwlock<BankForks>> 2022-04-19 19:23:58 -07:00