Commit Graph

2166 Commits

Author SHA1 Message Date
dependabot[bot] f338aa62ba
chore: bump serde from 1.0.143 to 1.0.144 (#27511)
* chore: bump serde from 1.0.143 to 1.0.144

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.143 to 1.0.144.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.143...v1.0.144)

---
updated-dependencies:
- dependency-name: serde
  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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-09-07 16:54:44 -06:00
Brian Anderson 28f979b5a5
Fix solana_program::vote docs (#27621) 2022-09-07 13:05:52 -06:00
DimAn 6899af26b0
keygen: add the ability to use derivation path for new & grind commands (#21614)
* keygen: add --use-derivation-path for new & grind

* keygen: add prompt:// uri scheme to new and grind

* fmt

* migrate to clap-v3-utils

* Revert "migrate to clap-v3-utils"

This reverts commit 77f33262ce6c4e95ac1cc62cca32749516f7f357.

* Revert "fmt"

This reverts commit 038cd4ce9628c57dec1f5a4716e2c5baacbe57b3.

* Revert "keygen: add prompt:// uri scheme to new and grind"

This reverts commit 029ea61409a1a16ba2c45483ade2c01f84f25fac.

* - remove `use` from arg
- fix issue from first commit with default value for derivation path
- refactor arg definition and acquiring
2022-09-07 14:31:40 -04:00
Brooks Prumo 1cf9077d06
Include the Epoch Accounts Hash in the Bank hash (#27541) 2022-09-07 10:10:49 -04:00
dependabot[bot] 43f0e981dc
chore: bump generic-array from 0.14.5 to 0.14.6 (#27531)
* chore: bump generic-array from 0.14.5 to 0.14.6

Bumps [generic-array](https://github.com/fizyk20/generic-array) from 0.14.5 to 0.14.6.
- [Release notes](https://github.com/fizyk20/generic-array/releases)
- [Changelog](https://github.com/fizyk20/generic-array/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fizyk20/generic-array/commits)

---
updated-dependencies:
- dependency-name: generic-array
  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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-09-06 14:05:17 -06:00
Alexander Meißner 12d2147efa
Adds `IndexOfAccount` type (#27599)
Adds the type `IndexOfAccount`.
2022-09-06 11:31:40 +02:00
Alexander Meißner 6f2e556b16
Cleanup: `TransactionContext` (#27595)
* Lets instruction_accounts_lamport_sum() have the &InstructionContext as parameter directly.

* Updates docu comments.

* Uses accessors methods instead of accessing private properties of other structs.

* Adds #![deny(clippy::indexing_slicing)].

* Has get_signers() return a Result instead of using unwrap().

* Removes InvokeContext::get_key_of_account_at_index().
2022-09-05 16:29:02 +02:00
Alexander Meißner 0b94d5af18
Refactor: `InstructionContext::configure()` (#27400)
* Replaces InstructionContext::new() by InstructionContext::configure().
Adds TransactionContext::get_next_instruction_context().

* Switch back to using references as parameters.

* Hoists InstructionContext::configure() from TransactionContext::push() into InvokeContext::push().

* Moves InstructionContext::config() to the beginning of InvokeContext::push().

* Hoists InstructionContext::configure() from InvokeContext::push() into InvokeContext::process_instruction().

* Review feedback: Updates docu comments.
2022-09-03 10:34:57 +02:00
Alexander Meißner 0367c1a60c
Feature: `SyscallSetAccountProperties` (#27444)
* Adds TransactionContextAttribute.

* Adds SyscallSetAccountProperties.

* Adds AccountPropertyUpdate factory methods to BorrowedAccount.

* Categorizes syscalls exclusive to ABIv0/v1 and ABIv2.
2022-09-02 12:42:06 +02:00
Brian Anderson dce99f1d0d
Fix broken macro doc links (#27125)
These don't resolve correctly in Rust 1.63.
2022-09-01 21:14:25 +00:00
Florian Hartwig 12f921386f
Make CommitmentLevel constructors const (#27367)
make CommitmentLevel constructors const
2022-08-31 13:20:53 -06:00
Alexander Meißner 84b5a2bcf4
Refactor: `TransactionContext` ABIv2 adjustments (#27476)
* Marks methods and structs which are only to be used by the program runtime.

* Removes TransactionContext::get_keys_of_accounts().

* Adds InstructionContext::get_instruction_accounts_lamport_sum().
2022-08-31 17:47:47 +02:00
Brooks Prumo 757e46c3c7
Set cap for new allocations per transaction (#27385) 2022-08-29 14:30:48 -04:00
Brennan Watt 46a48760db
Switch concurrent replay from feature to param (#27401)
* Switch concurrent replay from feature to param
2022-08-26 12:36:02 -07:00
Justin Starry 56cebf9da2
Relax keypair ordering restriction for `VersionedTransaction::try_new` (#27397)
* Relax keypair ordering restriction for VersionedTransaction::try_new

* feedback
2022-08-26 11:25:20 +02:00
Yihau Chen a19b5c1536
chore: allow test_is_writable_account_cache ignore clippy::get_first (#27414) 2022-08-26 15:33:25 +08:00
Tao Zhu 5e71f339c9
Add a SanitizedMessage type that caches writable accounts indexes (#27317)
* Add a SanitizedMessage type that caches writable accounts indexes

* Add is_writable_account_cache to both SanitizedMessage variants, cache is initialized in constructors
2022-08-25 16:33:41 -05:00
Tyera Eulberg 1095cdf436
Fixup docs in sdk to use new clients (#27362)
Fixup client docs in sdk
2022-08-24 21:29:56 -06:00
carllin ad6c2d8c5f
Handle VoteStateUpdates for outdated roots bigger than slots in existing VoteState (#27323)
* Set root to latest vote in tower <= prposed vote state

* fixup tests

* PR comments

* feature gate
2022-08-24 20:42:57 -05:00
Ashwin Sekar efa6201eda
Check overflow on vote tx compaction boundary (#27185)
* Check overflow on vote tx compaction boundary

Check for overflow during the conversion between VoteStateUpdate and
CompactVoteStateUpdate.

* Try removing clippy supress
2022-08-23 22:29:03 -07:00
Alexander Meißner a8543ad992
Feature: `stop_sibling_instruction_search_at_parent` (#27290)
* Adds stop_sibling_instruction_search_at_parent.

* Adds test_syscall_sol_get_processed_sibling_instruction().
2022-08-23 23:55:56 +02:00
Alexander Meißner b2ae7def06
Remove `total_data_size` and `data_size_changed` from `ExecuteDetailsTimings` (#27051)
* Removes total_data_size and data_size_changed from ExecuteDetailsTimings.
2022-08-23 14:58:32 +02:00
Brennan Watt e4a7d01e10
Rust v1.63 (#27303)
* Upgrade to Rust v1.63.0

* Add nightly_clippy_allows

* Resolve some new clippy nightly lints

* Increase QUIC packets completion timeout

* Update quinn-udp crate

Co-authored-by: Michael Vines <mvines@gmail.com>
2022-08-22 18:01:03 -07:00
Justin Starry b79abb4fab
Relax authority signer check for lookup table creation (#27248)
* Relax authority signer check for lookup table creation

* cli: support creating lookup tables without authority signer

* add another create lookup table ix function

* improve help message
2022-08-22 23:38:56 +01:00
Alexander Meißner 55d18e8463
Refactor: Flattens `TransactionContext::instruction_trace` (#27109)
* Flattens TransactionContext::instruction_trace.

* Stop the search at transaction level.

* Renames get_instruction_context_at => get_instruction_context_at_nesting_level.

* Removes TransactionContext::get_instruction_trace().
Adds TransactionContext::get_instruction_trace_length() and TransactionContext::get_instruction_context_at_index().

* Have TransactionContext::instruction_accounts_lamport_sum() accept an iterator instead of a slice.

* Removes instruction_trace from ExecutionRecord.

* make InstructionContext::new() private
2022-08-20 11:20:47 +02:00
leonardkulms 1794455766
correct double negation (#27240) 2022-08-19 10:18:19 +00:00
Brennan Watt 7573000d87
Revert "Rust v1.63.0 (#27148)" (#27245)
This reverts commit a2e7bdf50a.
2022-08-19 09:19:44 +01:00
Justin Starry 7d765e3d67
clean feature: `prevent_calling_precompiles_as_programs` (#27100)
* clean feature: prevent_calling_precompiles_as_programs

* fix tests

* fix test

* remove comment

* fix test

* feedback
2022-08-18 05:21:16 +00:00
Jon Cinque 68a5e05f81
sdk: Fix args after "--" in build-bpf and test-bpf (#27221) 2022-08-18 02:52:54 +00:00
Brennan Watt a2e7bdf50a
Rust v1.63.0 (#27148)
* Upgrade to Rust v1.63.0

* Add nightly_clippy_allows

* Resolve some new clippy nightly lints

* Increase QUIC packets completion timeout

Co-authored-by: Michael Vines <mvines@gmail.com>
2022-08-17 15:48:33 -07:00
Alexander Meißner f61f63c19b
Remove the deprecated `KeyedAccount` interface (#27147)
* Removes the deprecated KeyedAccount interface.

* Removes outdated example code.
2022-08-15 20:41:46 +02:00
Brian Anderson b6762fc2f9
Add more sysvar API docs (#26849)
* Add more sysvar API docs

* Remove println from examples

* Update sdk/program/src/clock.rs

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

* Update sdk/program/src/clock.rs

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

* Update sdk/program/src/clock.rs

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

* Update sdk/program/src/clock.rs

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

* Update sdk/program/src/clock.rs

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

* Update sdk/program/src/clock.rs

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

* Update sdk/program/src/clock.rs

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

* Update sdk/program/src/clock.rs

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

* Fix docs for ACCOUNT_STORAGE_OVERHEAD

* Update sdk/program/src/epoch_schedule.rs

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

* Update sdk/program/src/sysvar/slot_hashes.rs

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

* Update sdk/program/src/sysvar/slot_history.rs

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

* Update sdk/program/src/sysvar/slot_history.rs

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

* Update sdk/program/src/sysvar/mod.rs

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

* Fix docs for DEFAULT_LEADER_SCHEDULE_SLOT_OFFSET

* Fix recent_blockhash short description

* Fix whitespace

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-08-15 12:19:46 -06:00
Justin Starry 5618e9fd07
Allow overriding the runtime transaction account lock limit (#26948)
* Add --transaction-account-lock-limit cli arg to test-validator

* Allow overriding the tx account lock limit in ProgramTest
2022-08-12 15:07:48 +01:00
dependabot[bot] 73436795a0
chore: bump js-sys from 0.3.58 to 0.3.59 (#27088)
* chore: bump js-sys from 0.3.58 to 0.3.59

Bumps [js-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.58 to 0.3.59.
- [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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-08-12 07:40:25 -06:00
dependabot[bot] 02a6b7ac1f
chore: bump predicates from 2.0.3 to 2.1.1 (#27087)
Bumps [predicates](https://github.com/assert-rs/predicates-rs) from 2.0.3 to 2.1.1.
- [Release notes](https://github.com/assert-rs/predicates-rs/releases)
- [Changelog](https://github.com/assert-rs/predicates-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/assert-rs/predicates-rs/compare/v2.0.3...v2.1.1)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-12 06:44:59 +00:00
Dmitri Makarov d42fcf2e30 Fix rust flags handling in cargo-build-sbf 2022-08-11 01:07:51 +00:00
Brian Anderson 96a8f19105
Fix duplicate / incorrect docs in solana_sdk by removing the solana_program::* import (#26588)
* Make solana_sdk imports from solana_program explicit.

* Adjust imports
2022-08-10 15:56:30 -06:00
dependabot[bot] e3a8d2ecdd
chore: bump serde_json from 1.0.81 to 1.0.83 (#27036)
* chore: bump serde_json from 1.0.81 to 1.0.83

Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.81 to 1.0.83.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.81...v1.0.83)

---
updated-dependencies:
- dependency-name: serde_json
  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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-08-10 09:45:42 -06:00
dependabot[bot] ae5b680c6f
chore: bump serde from 1.0.138 to 1.0.143 (#27015)
* chore: bump serde from 1.0.138 to 1.0.143

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.138 to 1.0.143.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.138...v1.0.143)

---
updated-dependencies:
- dependency-name: serde
  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-08-10 05:08:43 +00:00
Jeff Biseda 370de8129e
ancestor hashes socket ping/pong support (#26866) 2022-08-09 21:39:55 -07:00
Michael Vines ccfbc54195 Move vote program state and instructions to solana-program 2022-08-09 20:52:47 -07:00
Alexander Meißner 85a679b098
Feature: disable CPI setting `is_executable` and `rent_epoch` (#26987)
* Adds the feature disable_cpi_setting_executable_and_rent_epoch.

* Adds the feature gate for disable_cpi_setting_executable_and_rent_epoch.

* Removes TEST_EXECUTABLE_LAMPORTS.

* Test that is_executable and rent_epoch are ignored.
2022-08-10 00:22:23 +02:00
Lijun Wang a69470fd45
Set receive_window per quic connection (#26936)
This change sets the receive_window for non-staked node to 1 * PACKET_DATA_SIZE, and maps the staked nodes's connection's receive_window between 1.2 * PACKET_DATA_SIZE to 10 * PACKET_DATA_SIZE based on the stakes.

The changes is based on Quinn library change to support per connection receive_window tweak at the server side. quinn-rs/quinn#1393
2022-08-09 10:02:47 -07:00
Justin Malčić 632752d2f9
Add `Signers` impls for `Arc<dyn Signer>` (#27000)
* Add `Signers` impls for `Arc<dyn Signer>`

* Reformat
2022-08-09 13:05:59 +02:00
dependabot[bot] 15acb7239d
chore: bump sha3 from 0.10.1 to 0.10.2 (#27002)
* chore: bump sha3 from 0.10.1 to 0.10.2

Bumps [sha3](https://github.com/RustCrypto/hashes) from 0.10.1 to 0.10.2.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/sha3-v0.10.1...sha3-v0.10.2)

---
updated-dependencies:
- dependency-name: sha3
  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

* Revert sha3 bump in zk-token-sdk

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2022-08-08 21:19:34 -06:00
Dmitri Makarov 84eb6bab4a Refactor cargo-build-sbf integration tests using assert_cmd crate 2022-08-09 00:34:04 +00:00
Brian Anderson ebe25fdb56
Add API docs for secp256k1_instruction and secp256k1_recover (#26065)
* Add API docs for secp256k1_instruction and secp256k1_recover

* typo

* Remove unused variable from secp256k1 program test

* Bump solana_bpf_rust_secp256k1_recover ix count

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2022-08-08 16:22:10 -06:00
dependabot[bot] 0c82ca9293
chore: bump rustversion from 1.0.7 to 1.0.9 (#26984)
* chore: bump rustversion from 1.0.7 to 1.0.9

Bumps [rustversion](https://github.com/dtolnay/rustversion) from 1.0.7 to 1.0.9.
- [Release notes](https://github.com/dtolnay/rustversion/releases)
- [Commits](https://github.com/dtolnay/rustversion/compare/1.0.7...1.0.9)

---
updated-dependencies:
- dependency-name: rustversion
  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-08-08 14:40:18 -06:00
Dmitri Makarov 776a47bd83 Bump sbf-tools version to v1.29 2022-08-07 22:11:57 +00:00
Will Hickey ed8c224374
Bump version to v1.12 (#26967) 2022-08-06 13:20:30 -05:00
Christian Kamm cf58640937
Keypair: implement clone() (#26248)
* Keypair: implement clone()

This was not implemented upstream in ed25519-dalek to force everyone to
think twice before creating another copy of a potentially sensitive
private key in memory.

See https://github.com/dalek-cryptography/ed25519-dalek/issues/76

However, there are now 9 instances of
  Keypair::from_bytes(&keypair.to_bytes())
in the solana codebase and it would be preferable to have a function.

In particular since this also comes up when writing programs and can
cause users to either start messing with lifetimes or discover the
from_bytes() workaround themselves.

This patch opts to not implement the Clone trait. This avoids automatic
use in order to preserve some of the original "let developers think
twice about this" intention.

* Use Keypair::clone
2022-08-06 11:54:38 -06:00
Richard Patel a9a3c62907
Fix sol_get_processed_sibling_instruction on 32-bit hosts (#26522) 2022-08-05 12:06:03 -07:00
Tyera Eulberg 2dca239480
Remove runtime dependency from solana-transaction-status (#26930)
* Move RewardType out of runtime

* Move collect_token_balances to solana-ledger

* Remove solana-runtime dependency
2022-08-05 00:20:27 -06:00
github-actions[bot] fbf1bf6d86
Bump Version to 1.11.6 (#26906)
Co-authored-by: willhickey <willhickey@users.noreply.github.com>
2022-08-03 12:48:43 -05:00
Brian Anderson a69ee79111 Delete unused create_test_recent_blockhashes 2022-08-02 01:28:23 -06:00
Jeff Biseda 857be1e237
sign repair requests (#26833) 2022-07-31 15:48:51 -07:00
Dmitri Makarov 8db5a6a4f2 Copy changes made to a generated header file to its source 2022-07-30 10:38:53 -07:00
dependabot[bot] 422cff69fd
chore: bump cargo_metadata from 0.14.2 to 0.15.0 (#26803)
Bumps [cargo_metadata](https://github.com/oli-obk/cargo_metadata) from 0.14.2 to 0.15.0.
- [Release notes](https://github.com/oli-obk/cargo_metadata/releases)
- [Changelog](https://github.com/oli-obk/cargo_metadata/blob/main/CHANGELOG.md)
- [Commits](https://github.com/oli-obk/cargo_metadata/commits)

---
updated-dependencies:
- dependency-name: cargo_metadata
  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-07-29 14:11:58 -06:00
apfitzge bda14e348a
Feature-gate for incremental snapshots only hashing accounts in the incremental snapshot (#26809)
Add feature module and pubkey for incremental snapshots hashing only accounts in the snapshot
2022-07-29 14:25:19 -05:00
Jeff Washington (jwash) 69b5dd9b07
cleanup ignore_eof_error (#26838) 2022-07-29 12:10:22 -05:00
Brennan Watt 467cb5def5
Concurrent slot replay (#26465)
* Concurrent replay slots

* Split out concurrent and single bank replay paths

* Sub function processing of replay results for readability

* Add feature switch for concurrent replay
2022-07-28 11:33:19 -07:00
Michael Vines 48862c575a Add StakeInstruction::Redelegate 2022-07-27 20:24:25 -06:00
Richard Patel 741076ecdd bpf: fix objcopy.sh
Uses bundled version of llvm-objcopy.
2022-07-27 15:42:10 -07:00
Richard Patel b4a9a0a89c cargo-build-sbf: support debuginfo 2022-07-27 15:42:10 -07:00
Ashwin Sekar 8d69e8d447
Compact vote state updates to reduce block size (#26616)
* Compact vote state updates to reduce block size

* Add rpc transaction tests
2022-07-27 13:23:44 -06:00
apfitzge ecc5b65784
Fix typo: contirbutor to contributor (#26807) 2022-07-27 16:06:29 +00:00
dependabot[bot] cd4340ed06
chore: bump bytemuck from 1.10.0 to 1.11.0 (#26792)
* chore: bump bytemuck from 1.10.0 to 1.11.0

Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.10.0 to 1.11.0.
- [Release notes](https://github.com/Lokathor/bytemuck/releases)
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.10.0...v1.11.0)

---
updated-dependencies:
- dependency-name: bytemuck
  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-07-26 20:50:30 -06:00
Tao Zhu 5e622f82ac
Add feature gate to use default units per instruction for fee calculation (#26786)
* Add feature gate to use default units per instruction for fee calculation

* fix bpf tests
2022-07-26 19:39:24 +00:00
github-actions[bot] 5d038b9d2a
Bump Version to 1.11.5 (#26758)
Co-authored-by: willhickey <willhickey@users.noreply.github.com>
2022-07-25 13:05:14 -06:00
Justin Starry 2335f6908a
Loosen CPI restrictions and charge compute for ix data len (#26653)
* Loosen CPI restrictions and charge compute for ix data len

* Address feedback

* use explicit casting

* more feedback
2022-07-24 20:20:16 +02:00
Pankaj Garg 27866aeab4
Fix transaction chunking on QUIC batch send (#26642)
* Fix chunking of transaction at batch transmit via QUIC

* clippy fixes
2022-07-22 08:56:15 -07:00
dependabot[bot] c7ff185eda
chore: bump anyhow from 1.0.57 to 1.0.58 (#26724)
* chore: bump anyhow from 1.0.57 to 1.0.58

Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.57 to 1.0.58.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.57...1.0.58)

---
updated-dependencies:
- dependency-name: anyhow
  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-07-22 02:45:22 +00:00
Alexander Meißner cbb74a190f
Cleanup: `record_instruction_in_transaction_context_push` (#26658)
Cleanup feature gate of record_instruction_in_transaction_context_push.
2022-07-21 12:49:34 +02:00
Justin Starry f8e9af5f1e
Cap the number of accounts passed to a bpf program ix (#26630)
* Cap the number of accounts passed to a bpf program ix

* update bank abi hash

* fix ci failures
2022-07-20 14:12:43 +02:00
Dmitri Makarov 8bc8f77820 Sync return_data.inc and add a warning about modifying generated header files 2022-07-19 20:03:05 -07:00
Richard Patel 4163dc181e
sdk/bpf/c: fix sol_get_return_data signature (#26525) 2022-07-19 09:30:29 +02:00
behzad nouri bf225bae73
restricts rent-paying accounts lifetime extension (#26606)
https://github.com/solana-labs/solana/pull/22292
prevents rent paying accounts creation going forward. However a rent
paying account can linger on for ever if it is continually topped up but
stays below the rent-exempt minimum.
This can prevent eliminating accounts-rewrites and the problematic
rent_epoch field in accounts.

Link to discord discussion:
https://discord.com/channels/428295358100013066/943609352068145162/995202300001927219

This commit restricts rent-paying accounts lifetime extension by
preventing increasing lamports on the account if the account stays below
the rent-exempt minimum.
2022-07-15 13:23:37 +00:00
Alexander Meißner 038da82b6f
Feature: Early verification of account modifications in `BorrowedAccount` (#25899)
* Adjusts test cases for stricter requirements.

* Removes account reset in deserialization test.

* Removes verify related test cases.

* Replicates account modification verification logic of PreAccount in BorrowedAccount.

* Adds TransactionContext::account_touched_flags.

* Adds account modification verification to the BPF ABIv0 and ABIv1 deserialization, CPI syscall and program-test.

* Replicates the total sum of all lamports verification of PreAccounts in InstructionContext

* Check that the callers instruction balance is maintained during a call / push.

* Replicates PreAccount statistics in TransactionContext.

* Disable verify() and verify_and_update() if the feature enable_early_verification_of_account_modifications is enabled.

* Moves Option<Rent> of enable_early_verification_of_account_modifications into TransactionContext::new().

* Relaxes AccountDataMeter related test cases.

* Don't touch the account if nothing changes.

* Adds two tests to trigger InstructionError::UnbalancedInstruction.

Co-authored-by: Justin Starry <justin@solana.com>
2022-07-15 09:31:34 +02:00
Dmitri Makarov 0b78a213c3 Add a comment explaining the check for crate recompilation redundancy 2022-07-14 17:59:37 -07:00
Dmitri Makarov 27cee7a7de Compile for bpf target for compatibility when cargo-build-bpf is used 2022-07-14 10:41:39 -07:00
Justin Starry 3fc161bea4
Fix flaky message kitchen sink test (#26624) 2022-07-14 18:39:57 +01:00
bji 61fd9288ba
Fix sol_memset to return the correct value. (#26598) 2022-07-14 17:27:02 +01:00
Alessandro Decina ab6802bd2d cargo-build-sbf, cargo-test-sbf: add --arch option
--arch allows selecting the target SBF version. See
https://github.com/solana-labs/llvm-project/pull/26.
2022-07-13 14:49:38 -07:00
Dmitri Makarov 8797ad03c4 Bump sbf-tools version to v1.28 2022-07-13 21:47:48 +00:00
Dmitri Makarov 1db17a8874 Issue a warning about removing RUSTC from cargo env by build-sbf 2022-07-13 20:44:27 +00:00
Dmitri Makarov b7e7e4159c Prevent cargo from running a non-BPF compiler for BPF target 2022-07-13 05:48:48 +00:00
github-actions[bot] fd5df1cf25
Bump Version to 1.11.4 (#26578)
Co-authored-by: willhickey <willhickey@users.noreply.github.com>
2022-07-11 23:30:38 -05:00
Justin Starry 8e8c6e60ff
Allow extending upgradeable program data account length (#26386)
* Allow extending upgradeable program data account length

* Add is_writable check

* Fix cargo version

* System program fix, comment, and test

* Switch to u32 for serialized bytes value in ix
2022-07-11 22:46:32 +01:00
ryleung-solana 4772a93109
Quic handshake timeout (#26306)
* Implement timeout for the quic client and server handshake
2022-07-11 14:10:12 +08:00
dependabot[bot] e3d1fe52a2
chore: bump js-sys from 0.3.57 to 0.3.58 (#26508)
* chore: bump js-sys from 0.3.57 to 0.3.58

Bumps [js-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.57 to 0.3.58.
- [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-07-09 00:35:29 -06:00
behzad nouri c99d9f00a9
preserves rent_epoch for rent exempt accounts (#26479)
https://github.com/solana-labs/solana/pull/22292
prevents rent paying account creation going forward. As a result
rent_epoch field for rent exempt accounts is redundant, and advancing
this field will incur expensive account rewrites and cause discrepancy
between accounts-db and cached vote/stake accounts.

This commit adds a feature which upon activation preserves rent_epoch
field for rent exempt accounts so that the field is frozen and is no
longer advanced.
2022-07-08 20:04:08 +00:00
Dmitri Makarov f3bba9723e Consolidate dep features in Cargo.toml files to minimize rebuilds
Indirect dependency packages introduce variations in features of other
dependencies, which affect the fingerprints of previously built
packages such as solana-program and cause redundant rebuilds of
affected packages.  These changes specify several features in
dependencies specifications explicitly to a common set of
features. The result of such consolidation is improved re-usability of
previously built binary packages across programs/bpf/rust/ packages
when these packages are built in CI jobs.
2022-07-08 12:40:06 -07:00
Brooks Prumo 78b8a8a6db
Remove `get_total_resize_remaining()` and `total_resize_limit` from `TransactionContext` (#26504) 2022-07-08 20:26:54 +02:00
dependabot[bot] d1370f2c7d
chore: bump bytemuck from 1.9.1 to 1.10.0 (#26495)
* chore: bump bytemuck from 1.9.1 to 1.10.0

Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.9.1 to 1.10.0.
- [Release notes](https://github.com/Lokathor/bytemuck/releases)
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.9.1...v1.10.0)

---
updated-dependencies:
- dependency-name: bytemuck
  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-07-08 10:04:43 -06:00
dependabot[bot] 312748721d
chore: bump rustversion from 1.0.6 to 1.0.7 (#26488)
* chore: bump rustversion from 1.0.6 to 1.0.7

Bumps [rustversion](https://github.com/dtolnay/rustversion) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/dtolnay/rustversion/releases)
- [Commits](https://github.com/dtolnay/rustversion/compare/1.0.6...1.0.7)

---
updated-dependencies:
- dependency-name: rustversion
  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

* Sync rustversions

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2022-07-07 20:54:27 -06:00
github-actions[bot] 9d937fb8a0
Bump Version to 1.11.3 (#26481)
Co-authored-by: willhickey <willhickey@users.noreply.github.com>
2022-07-07 14:39:46 -05:00
Justin Starry eb6a722eba
Clean up `nonce_must_be_writable` feature (#26444)
Clean up nonce_must_be_writable feature
2022-07-07 15:45:19 +01:00
Alexander Meißner 06ebfa1eb2
Replicates `AccountsDataMeter` in `TransactionContext` (#26438)
Replicates AccountsDataMeter in TransactionContext.
2022-07-06 19:27:42 +02:00
Justin Starry f8dccd4602
Clean up `max_tx_account_locks` feature (#26440)
Clean up max_tx_account_locks feature
2022-07-06 15:06:03 +00:00
behzad nouri 6f5857a5db
removes feature gate code separating durable nonce from blockhash domain (#26055) 2022-07-06 12:03:13 +00:00
dependabot[bot] 37f4621c06
chore: bump serde from 1.0.137 to 1.0.138 (#26421)
* chore: bump serde from 1.0.137 to 1.0.138

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.137 to 1.0.138.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.137...v1.0.138)

---
updated-dependencies:
- dependency-name: serde
  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-07-05 23:18:08 -06:00
Jack May 690efc0b7c
Missing privkey, add 2nd feature key (#26415) 2022-07-05 13:36:37 -07:00
Jack May 6ebd4abf41
spell nit (#26336) 2022-06-30 10:32:10 -07:00
samkim-crypto 24c6f820ce
remove elgamal syscall operations (#26311)
resolve conflict
2022-06-30 16:27:48 +09:00
Justin Starry f44fcd1880 Detect and reject invalid AccountInfo reallocations 2022-06-29 09:15:59 +01:00
Alexander Meißner e8fed88669
Both kinds of LamportsError are turned into InstructionError::ArithmeticOverflow anyway. (#26273) 2022-06-28 10:04:54 +02:00
Ryo Onodera 090e11210a
Add const_assert_eq to PACKET_DATA_SIZE (#26227) 2022-06-27 13:58:08 +09:00
behzad nouri 2efdb965dd
encapsulates AuthorizeNonceAccount implementation in the nonce module (#26202)
Follow up commit removes feature gate code separating durable nonce from
blockhash domain. This commit allows to encapsulate any logic
distinguishing legacy vs current nonce versions in the nonce module
after removing the feature gate.
2022-06-25 12:17:39 +00:00
Jeff Washington (jwash) a3395a786a
vote_account uses AccountSharedData to avoid copies (#23687)
* vote_account uses AccountSharedData to avoid copies

* simpler deserialize
2022-06-24 15:08:01 -05:00
behzad nouri 09d3c890e9
partially reverts #25963 (#26155)
This partially reverts commit 47e62add5b.

Adding back the feature-id so that the master branch can successfully
run ledger-tool across epoch-boundary which enabled the feature.

Note that #25963 backport did not remove the feature-id.
2022-06-23 13:23:11 +00:00
Brooks Prumo 7d29c26315
Remove auto traits from ICE work-around (#26098) 2022-06-23 07:22:30 -05:00
github-actions[bot] 5c2f819f99
Bump Version to 1.11.2 (#26159) 2022-06-22 21:16:18 -05:00
Jack May 467c840df8
Cleanup superseded neon specific feature (#26142) 2022-06-22 15:12:12 -07:00
Michael Vines f3639b76ce Remove some clippy lints 2022-06-22 09:23:22 -07:00
behzad nouri 955302b953
masks packet data if the packet is already marked as discard (#26078)
If the packet is marked as discard, it is either invalid or otherwise
should be ignored, and so the payload should not be read from.
2022-06-22 15:36:54 +00:00
Lijun Wang 61946a49c3
Weight concurrent streams by stake (#25993)
Weight concurrent streams by stake for staked nodes
Ported changes from #25056 after address merge conflicts and some refactoring
2022-06-21 12:06:44 -07:00
Will Hickey 51f26dc96e
Bump version to 1.11.1 (#26104) 2022-06-21 12:07:46 -05:00
behzad nouri 47e62add5b
removes feature gate code adding shred-type to shred seed (#25963)
The feature is already activated on all clusters, and does not impact
processing of ledger/snapshots.
2022-06-20 14:39:24 +00:00
Dmitri Makarov f14a361854 Fix build/test-bpf command line handling if run as cargo subcommand 2022-06-19 19:00:55 -07:00
Alexander Meißner bf9ca9827e
Refactor: instruction account index (#25825)
* Adds methods based on instruction_account_index to InstructionContext.
Removes methods which are based on index_in_instruction.

* Adjusts program-runtime.

* Adjusts runtime.

* Adjusts bpf loader.

* Adjusts built-in programs.

* Adjusts program-test and bpf tests.
2022-06-16 18:46:17 +02:00
Brooks Prumo b4b191e446
Enforce accounts data size limit per block in ReplayStage (#25524) 2022-06-15 20:35:33 -05:00
Steven Luscher 45d11f3d26
Implement `VoteInstruction::AuthorizeWithSeed` & `VoteInstruction::AuthorizeWithSeedChecked` (#25928)
* [vote_authorize_with_seed] Add `VoteInstruction::AuthorizeWithSeed`

* [vote_authorize_with_seed] You can now update a vote account's authority if it's a derived key for which you control the base key

* [vote_authorize_with_seed] Add test helper to create a vote account whose authorities are derived keys

* [vote_authorize_with_seed] Write tests to assert the behavior of `VoteInstruction::AuthorizeWithSeed`

* [vote_authorize_with_seed] Feature gate the `VoteInstruction::AuthorizeWithSeed` processor

* [vote_authorize_with_seed] Add `VoteInstruction::AuthorizeWithSeed` to transaction status parser

* [vote_authorize_with_seed] Add `VoteInstruction::AuthorizeWithSeed` to docs

* [vote_authorize_with_seed] Add `VoteInstruction::AuthorizeCheckedWithSeed`

* [vote_authorize_with_seed] You can now update a vote account's authority (while checking that the new authority has signed) if it's a derived
key for which you control the base key

* [vote_authorize_with_seed] Add `VoteInstruction::AuthorizeCheckedWithSeed` to transaction status parser

* [vote_authorize_with_seed] Write tests to assert the behavior of `VoteInstruction::AuthorizeCheckedWithSeed`
2022-06-13 20:36:44 -07:00
apfitzge 4940d530b8
Add static vector to get sdk ids (#25907)
* Add function to get all sdk program ids

* program_ids: use lazy_static instead of a function

* program_ids -> sdk_ids
2022-06-13 13:07:18 -05:00
steviez 853b0ea966
fixup! Add syscall tests for curve25519 (#25634) (#25921) 2022-06-11 23:32:28 -05:00
samkim-crypto 697a69cbe8
Add syscall tests for curve25519 (#25634)
* add curve25519 syscall tests

* add curve25519 syscall feature set description

* fmt

* rename curve25519 group syscall

* update point to scalar

* resolve conflict
2022-06-12 10:18:51 +09:00
behzad nouri b4190319a1
feat(nonce): adds system instruction to upgrade legacy nonce versions (#25789)
https://github.com/solana-labs/solana/pull/25788
permanently disables durable transactions with legacy nonce versions
which are within chain blockhash domain.

This commit adds a new system instruction for a one-time idempotent
upgrade of legacy nonce accounts in order to bump them out of chain
blockhash domain.
2022-06-10 00:04:29 +00:00
behzad nouri 3c1ce3cc93
permanently disables durable nonces with chain blockhash domain (#25788)
https://github.com/solana-labs/solana/pull/25744
separated durable nonce and blockhash domains, which will stop double
execution going forward. However it is possible that a durable
transaction has *already* been executed once as a normal transaction and
it is now a valid durable transaction. #25744 cannot stop such
transactions to be re-executed until the nonce accounts are advanced.

This commit adds a new nonce version indicating that the nonce is moved
out of the blockhash domain, and permanently disables durable
transactions for legacy nonces which are in the blockhash domain.
2022-06-09 15:28:37 +00:00
carllin bf8faa8a30
Report banking stage tracer metrics (#25620) 2022-06-09 00:25:37 -05:00
Dmitri Makarov 0bbfcc3ba0 Add a rustc option to strip environment information from path strings
Usernames and other environment specific information can be revealed
in on-chain program binary files that compiler generates, because it
includes paths to source files as strings in the binary files.  The
added option instructs the compiler to strip the path parts up to
and including crate root subdirectory from the path strings added to
the generated binary files.
2022-06-08 21:25:00 -07:00
Dmitri Makarov ffeac6488e Ignore sbf-tools in sdk/bpf/dependencies and remove the ignored file 2022-06-08 18:11:04 -07:00
Justin Starry 6a7edc02c6
Reject durable nonce txs that don't use an advanceable nonce (#25832)
* Reject durable nonce txs that use the latest durable nonce hash

* feedback
2022-06-08 21:34:57 +00:00
Justin Starry b2b426d4bf
Reject durable nonce transactions not signed by authority (#25831) 2022-06-08 14:43:09 -05:00
Dmitri Makarov f3c77f7d9e Set up solana logger in cargo-build-sbf 2022-06-07 09:57:42 -07:00
Jack May ff68bf6c2c
quick bail on panic (#25804) 2022-06-07 06:45:45 -07:00
Jack May 363d8d1539
Bump rBPF (#25593) 2022-06-07 04:45:07 -07:00
bji cbb0f07d54
Award one credit per dequeued vote when processing VoteStateUpdate in… (#25743)
* Award one credit per dequeued vote when processing VoteStateUpdate instruction,
to match vote rewards of Vote instruction.

* Update feature pubkey to one owned by cc (ashwin)

Co-authored-by: Ashwin Sekar <ashwin@solana.com>
2022-06-06 16:37:03 -07:00
Ashwin Sekar 8caced68ce
Serialize lamports per signature (#25364)
* Serialize lamports per signature

* Add full snapshot archive test, enable features in previous tests
2022-06-06 13:07:02 -07:00
behzad nouri 9851774133 adds feature gate enabling durable nonce
Previous commit separates durable nonce and blockhash domains with a
feature gate. A 2nd feature added in this commit enables durable nonce
at least one epoch after the 1st feature.
By the time 2nd feature is activated, some nonce accounts will have an
old blockhash, but no nonce account can have a recent blockhash.
As a result no transaction (durable or normal) can be executed twice.
2022-06-04 12:39:31 +00:00
behzad nouri 5ee157f43d separates durable nonce and blockhash domains
AdvanceNonceAccount instruction updates nonce to blockhash. This makes it
possible that a durable transaction is executed twice both as a normal
transaction and a nonce transaction if it uses blockhash (as opposed to nonce)
for its recent_blockhash field.

The commit prevents this double execution by separating nonce and blockhash
domains; when advancing nonce account, blockhash is hashed with a fixed string.
As a result a blockhash cannot be a valid nonce value; and if transaction was
once executed as a normal transaction it cannot be re-executed as a durable
transaction again and vice-versa.
2022-06-04 12:39:31 +00:00
Dmitri Makarov 4dfaf15a46 Add cargo bpf tools that invoke newer sbf tools and issue deprecation notice 2022-06-03 14:12:42 -07:00
Dmitri Makarov 9425478f86 Rename cargo-build-bpf and cargo-test-bpf to cargo-build-sbf and cargo-test-sbf 2022-06-03 14:12:42 -07:00
HaoranYi 3564b5d389
typo (#25771) 2022-06-03 20:50:52 +00:00
behzad nouri 5dbf7d8f91
removes raw indexing into packet data (#25554)
Packets are at the boundary of the system where, vast majority of the
time, they are received from an untrusted source. Raw indexing into the
data buffer can open attack vectors if the offsets are invalid.
Validating offsets beforehand is verbose and error prone.

The commit updates Packet::data() api to take a SliceIndex and always to
return an Option. The call-sites are so forced to explicitly handle the
case where the offsets are invalid.
2022-06-03 01:05:06 +00:00
Brooks Prumo 0b2d5291f8
Add new error if stake delegation is below the minimum (#25709) 2022-06-01 20:29:57 -05:00
Tyera Eulberg 8584a3a331
Add feature to increase timestamp bounding on the slow side to 150% of poh estimate (1s/slot) (#25666) 2022-05-31 16:53:06 -06:00
Brian Anderson 897e97a305
Add docs to solana_program::program (#25352) 2022-05-31 10:10:40 -07:00
Alessandro Decina 2c8a3f39a6
Consolidate syscalls under solana_program::syscalls, implement static syscalls (sbfv2) (#24188)
Move all syscall declarations under solana_program::syscalls. If the target
supports static syscalls (sbfv2), then actually define them statically to avoid
dynamic relocations.
2022-05-26 23:01:55 +10:00
behzad nouri cafa85bfbb
includes shred-type when computing turbine broadcast seed (#25556)
Indices for code and data shreds of the same slot overlap; and so they
will have the same random number generator seed when shuffling cluster
nodes for turbine broadcast.

This results in the same propagation path for code and data shreds of
the same index and effectively smaller sample size for re-transmitter
nodes. For example a 32:32 batch (32 code + 32 data shreds), is
retransmitted through _at most_ 32 unique nodes, whereas ideally we want
~64 unique re-transmitters.

This commit adds shred-type to seed function so that code and data
sherds of the same (slot, index) will (most likely) have different
propagation paths.
2022-05-25 20:31:53 +00:00
behzad nouri 880684565c
limits read access into Packet data to Packet.meta.size (#25484)
Bytes past Packet.meta.size are not valid to read from.

The commit makes the buffer field private and instead provides two
methods:
* Packet::data() which returns an immutable reference to the underlying
  buffer up to Packet.meta.size. The rest of the buffer is not valid to
  read from.
* Packet::buffer_mut() which returns a mutable reference to the entirety
  of the underlying buffer to write into. The caller is responsible to
  update Packet.meta.size after writing to the buffer.
2022-05-25 16:52:54 +00:00
Alexander Meißner f10c80b49f
Refactor: Rebase offset of `index_in_caller` (#25531)
* Removes the offset InstructionContext::get_number_of_program_accounts() from InstructionAccount::index_in_caller.

* Removes unreachable SyscallError::InvalidLength in orig_data_lens.get().
2022-05-25 13:43:20 +02:00
Alexander Meißner 2fb096c486
Refactor: Adds `index_in_callee` to `InstructionAccount` (#25490)
* Adds InstructionAccount::index_in_callee

* Adjusts tests and benches.

* Adds documentation for InstructionAccount.

* Adds InstructionContext::is_duplicate()
2022-05-25 00:04:46 +02:00
carllin 9651cdad99
Refactor Sigverify trait (#25359) 2022-05-24 16:01:41 -05:00
Justin Starry cad1c41ce2 Add Packet::deserialize_slice convenience method 2022-05-24 17:31:14 +08:00
dependabot[bot] 3566fb5660
chore: bump regex from 1.5.5 to 1.5.6 (#25488)
* chore: bump regex from 1.5.5 to 1.5.6

Bumps [regex](https://github.com/rust-lang/regex) from 1.5.5 to 1.5.6.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.5.5...1.5.6)

---
updated-dependencies:
- dependency-name: regex
  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-05-23 13:45:43 -06:00
HaoranYi be630a5213
typo (#25479) 2022-05-23 18:42:43 +00:00
behzad nouri c248fb3f51
renames Packet Meta::{,set_}addr methods to {,set_}socket_addr (#25478)
In order to distinguish between Meta.addr field which is an IpAddr and
the methods which refer to a SocketAddr.
2022-05-23 15:48:59 +00:00
Michael Vines b05c7d91ed Fix derive_partial_eq_without_eq clippy lint 2022-05-22 22:22:21 -07:00
Alexander Meißner 7eae98c6d9
Introduces `Result` return types to mutable accessors of `BorrowedAccount` (#25380)
* Introduces result return types to get_data_mut(), set_data() and set_data_length() of BorrowedAccount.

* Introduces result return types to set_owner(), set_lamports() and set_executable() of BorrowedAccount.
2022-05-21 17:47:09 +02:00
Justin Starry 10d677a092
Fix flakey v0::Message::test_try_compile test (#25438) 2022-05-21 20:49:07 +08:00
Jack May 851958f77a
Disallow deployment of deprecated _sol_alloc_free syscall (#25179) 2022-05-20 13:19:41 -07:00
Alessandro Decina 9bf07ee206 More target_arch = "bpf" => target_os = "solana"
Continuing the work started in https://github.com/solana-labs/solana/pull/25358
2022-05-20 16:57:18 +10:00
Dmitri Makarov dcce90555b Bump sbf-tools to v1.27 2022-05-19 21:56:56 +00:00
Dmitri Makarov 569b00025c fix: replace rust cfg annotations that use bpf by target_os solana 2022-05-18 20:39:43 -07:00
Justin Starry a1522d0024
Use consistent naming for compute unit limit (#25229)
* Use consistent naming for compute unit limit

* feedback
2022-05-18 13:14:31 +08:00
Jack May 21e066ef26
Merge pull request from GHSA-wxrh-ff9f-fc6w 2022-05-16 12:30:37 -07:00
Justin Starry f81c5df1f0
Include account index in rent paying account tx error (#25189) 2022-05-16 23:35:34 +08:00
Tao Zhu b1b3702e6d
Prioritize transactions in banking stage by their compute unit price (#25178)
* - get prioritization fee from compute_budget instruction;
- update compute_budget::process_instruction function to take instruction iter to support sanitized versioned message;
- updated runtime.md

* update transaction fee calculation for prioritization fee rate as lamports per 10K CUs

* review changes

* fix test

* fix a bpf test

* fix bpf test

* patch feedback

* fix clippy

* fix bpf test

* feedback

* rename prioritization fee rate to compute unit price

* feedback

Co-authored-by: Justin Starry <justin@solana.com>
2022-05-16 12:06:33 +08:00
Justin Starry 6c10515ccf
Revert "Serialize lamports per signature in snapshots (#25181)" (#25228)
This reverts commit 35d2a0fd69.
2022-05-15 12:04:17 +00:00
Ashwin Sekar 35d2a0fd69
Serialize lamports per signature in snapshots (#25181)
* Serialize lamports per signature

* pr comments
2022-05-14 10:57:51 -07:00
Dmitri Makarov 3c70220142 Remove obsolete string C header input file
string.h doesn't contain any syscall declarations that need to be
processed by the gen-headers C header file generating utility.
2022-05-13 10:37:25 -07:00
Justin Starry d8a8393994
Don't extract invoked keys from a message when using a lookup table (#25065)
* Refactor message compiled keys

* Prohibit invoked keys from being extracted by lookup table
2022-05-13 10:32:10 +08:00
Jack May 8902a66b20
Revert "Disallow deployment of deprecated _sol_alloc_free syscall (#24986)" (#25170)
This reverts commit 8f1d4c1665.
2022-05-12 17:58:17 -05:00
Jack May cde15ff687
support 64-bit prioritization fee (#25027) 2022-05-12 11:07:36 -07:00
Dmitri Makarov 9d18fe019b Bump sbf-tools version to 1.26 2022-05-12 03:53:55 +00:00
Justin Starry 68800982ea
Add size_of const fns for upgradeable loader states (#25131) 2022-05-11 22:22:59 +08:00
Jack May 8f1d4c1665
Disallow deployment of deprecated _sol_alloc_free syscall (#24986)
* Disallow deployment of deprecated _sol_alloc_free syscall

* remove cli argument
2022-05-11 05:22:49 +00:00
Justin Starry e3bdc38f0a
Add sanitized types for use in banking stage (#25067) 2022-05-11 00:30:48 +08:00
Jason c80896b58f
speedup sysvar or builtin test (#25047)
* Add a quick lookup table to speed up sysvar/builtin key check

* Fix up the syntax

* Fix syntax

* Fix syntax 2

* Rename the static variable, improve commenting

* Fix merge error

* Fixed two clippy suggestions

* Improved commenting
2022-05-10 10:37:51 -05:00
Brian Anderson 8dd7aa9b40
Update sysvar module short docs (#25070) 2022-05-09 05:51:17 +00:00
samkim-crypto aba6a89517
Curve25519 syscall group ops (#25071)
* zk-token-sdk: implement group ops trait for curve25519

* zk-token-sdk: extend syscall trait implementation for group ops for ristretto

* zk-token-sdk: register curve25519 group ops to bpf loader

* zk-token-sdk: update curve25519_syscall_enabled address
2022-05-08 11:28:07 +09:00
Brooks Prumo e6c02f30dd
Raise minimum stake delegation to 1 SOL (#24603) 2022-05-07 19:01:05 -04:00
samkim-crypto d9deab4d2c
Curve25519 point validation syscall (#23771)
* zk-token-sdk: add curve25519 basic ops

* zk-token-sdk: add bpf operations for curve25519 ops

* zk-token-sdk: rebase

* zk-token-sdk: add tests for curve25519 opertions

* zk-token-sdk: rustfmt

* zk-token-sdk: organize syscalls by trait

* zk-token-sdk: organize syscalls by trait

* zk-token-sdk: cleaning up

* zk-token-sdk: rename mods

* zk-token-sdk: cargo fmt

* zk-token-sdk: fix tests for edwards and ristretto

* zk-token-sdk: add Syscall object for curve point validation

* zk-token-sdk: docs for curve syscall traits

* zk-token-sdk: fix errors from rebase

* zk-token-sdk: update Vec to slice

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* zk-token-sdk: use enum with num-derive for curve ids

* zk-token-sdk: update vec to slice

* zk-token-sdk: make curve25519 tests be deterministic

* zk-token-sdk: rebase

* token-2022: re-organizing curve point validation

* token-2022: cargo fmt

* zk-token-sdk: minor

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2022-05-07 16:20:53 +09:00
Brian Anderson c785f1ffc5
Fix indentation of Message API examples (#25051) 2022-05-06 14:50:43 -06:00
Justin Starry 082502d4f3
Fail tx sanitization when ix program id uses lookup table (#25035)
* Fail tx sanitization when ix program id uses lookup table

* feedback
2022-05-07 03:19:50 +08:00
Dmitri Makarov 66366615bb Generate syscall headers 2022-05-05 19:50:54 -07:00
Jason ee1b92c480
Reorder a boolean computation to speed up processing (#24913)
* Move a computation to where it's actually needed in is_writable(), which speeds up the code.

* Simplified a bool expr, even though it's a little less clear now

* Reorganize to make demote_program_id explicit again

* Remove the unnecessary let; replace it with a comment

* try different comment style

* Used cargo fmt that time

* Made demote_program_id its own function, for clarity
2022-05-05 15:19:06 -05:00
carllin 870ac80b79
Prioritize BankingStage packets individually in min-max heap (#24187) 2022-05-04 21:50:56 -05:00
dependabot[bot] bece7f32c8
chore: bump log from 0.4.16 to 0.4.17 (#24987)
* chore: bump log from 0.4.16 to 0.4.17

Bumps [log](https://github.com/rust-lang/log) from 0.4.16 to 0.4.17.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/commits/0.4.17)

---
updated-dependencies:
- dependency-name: log
  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-05-05 01:49:18 +00:00
dependabot[bot] 61a9faae17
chore: bump serde_json from 1.0.80 to 1.0.81 (#24960)
* chore: bump serde_json from 1.0.80 to 1.0.81

Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.80 to 1.0.81.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.80...v1.0.81)

---
updated-dependencies:
- dependency-name: serde_json
  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 <you@example.com>
2022-05-04 14:57:38 -06:00
Jon Cinque 326e53be97
stake: Allow initialized stakes to be below the min delegation (#24670)
* stake: Allow initialized stakes to be below the min delegation

* Add PR number in feature

* Fixup RPC subscription test

* Address feedback pt 1

* Address feedback pt 2

* Update FrozenAbi Digest

* Address feedback: no new error type, more comments
2022-05-04 12:17:29 +02:00
dependabot[bot] 9258d81ba3
chore: bump serde from 1.0.136 to 1.0.137 (#24957)
* chore: bump serde from 1.0.136 to 1.0.137

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.136 to 1.0.137.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.136...v1.0.137)

---
updated-dependencies:
- dependency-name: serde
  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-05-03 22:14:59 -06:00
dependabot[bot] 2c9d2a2140
chore: bump serde_json from 1.0.79 to 1.0.80 (#24943)
* chore: bump serde_json from 1.0.79 to 1.0.80

Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.79 to 1.0.80.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.79...v1.0.80)

---
updated-dependencies:
- dependency-name: serde_json
  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-05-03 13:46:45 -06:00
Jack May e070c5ca38
default compute units per instruction (#24899) 2022-05-03 09:50:06 -07:00
Jon Cinque b4503d4110
token: Add features for new program releases (#24742)
* token: Add features for new program releases

* Add PR number
2022-04-28 23:43:57 +02:00
Jack May 224e0b27a1
Simplify register and bind (#24724)
* Revert "Bumps solana_rbpf to v0.2.27 (#24694)"

This reverts commit f3d27cc400.

* Simplify syscall register and bind (#24546)

* declare syscalls with macro (#24564)
2022-04-28 10:24:42 +02:00
Ryo Onodera 412a5a0d33
Credits auto rewind on vote recreation (#22546)
* Credits auto rewind on vote recreation

* Update comment

* Improve comments and tests

* Recommended fn rename

* Restore old feature, and replace new feature key

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2022-04-26 15:49:35 -06:00
Michael Vines 533eadd024 Remove StakeState::get_rent_exempt_reserve() 2022-04-25 21:43:04 -07:00
Jeff Washington (jwash) 14ee36a2af
cleanup in vote/stake accounts (#24608)
* cleanup in vote/stake accounts

* reorder comparisons in accounts_equal
2022-04-23 08:28:21 -05:00
dependabot[bot] 3fda7aaa4d
chore: bump anyhow from 1.0.56 to 1.0.57 (#24618)
* chore: bump anyhow from 1.0.56 to 1.0.57

Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.56 to 1.0.57.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.56...1.0.57)

---
updated-dependencies:
- dependency-name: anyhow
  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-22 23:34:34 -06:00
dependabot[bot] b101e00ffa
chore: bump bytemuck from 1.8.0 to 1.9.1 (#24604)
* chore: bump bytemuck from 1.8.0 to 1.9.1

Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.8.0 to 1.9.1.
- [Release notes](https://github.com/Lokathor/bytemuck/releases)
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.8.0...v1.9.1)

---
updated-dependencies:
- dependency-name: bytemuck
  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-22 20:50:47 -06:00
dependabot[bot] 948abf00ac
chore: bump pbkdf2 from 0.10.1 to 0.11.0 (#24394)
* chore: bump pbkdf2 from 0.10.1 to 0.11.0

Bumps [pbkdf2](https://github.com/RustCrypto/password-hashes) from 0.10.1 to 0.11.0.
- [Release notes](https://github.com/RustCrypto/password-hashes/releases)
- [Commits](https://github.com/RustCrypto/password-hashes/compare/pbkdf2-v0.10.1...pbkdf2-v0.11.0)

---
updated-dependencies:
- dependency-name: pbkdf2
  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-22 10:47:19 -06:00
Brian Anderson 7206f894eb
Move solana_program::example_mocks declaration to appear last in source files (#24577) 2022-04-22 06:43:27 +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
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
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
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
Dmitri Makarov 6bf58572ca Update llvm include path in C toolchain makefile 2022-04-19 21:38:36 -07:00
Jack May 5eb1ba402f
cpi charge for executables (#24396) 2022-04-19 19:31:11 -07:00
Justin Starry 2ad1baa753
Add const fn StakeState::size_of and static assertion (#24416) 2022-04-20 01:04:12 +08:00
Alexander Meißner 860ecd6572
Deprecate `KeyedAccount` and `StackFrame` (#24480)
* Marks KeyedAccount as deprecated.

* Marks StackFrame as deprecated.
2022-04-19 17:11:04 +02:00
Alexander Meißner db3dd458a4
Reverts the feature removal of: (#24476)
Remove `NativeLoader` from program runtime (#24296)
2022-04-19 17:10:35 +02:00
behzad nouri 16222553b8
defines const fn for serialized size of VoteState, Feature and Nonce (#24435)
bincode::serialized_sized requires constructing a temporary object and
it is slow. Silently changing serialized size of these structs can also
be a backward incompatible change.
This commit instead hard-codes serialized size of VoteState, Feature and
Nonce, and defines the functions as const. Added tests verify hard-coded
values.
2022-04-19 13:10:14 +00:00
Dmitri Makarov f58ebff44e Update C toolchain linker script to match the rust toolchain script 2022-04-18 17:35:38 -07:00
behzad nouri 039488b562
drops redundant turbine propagation path (#24351)
Most nodes in the cluster receive the same shred from two different
nodes: parent, and the first node of their neighborhood:
https://github.com/solana-labs/solana/blob/a8c695ba5/core/src/cluster_nodes.rs#L178-L197

Because of the erasure codings, half of the shreds are already
redundant. So this redundant propagation path will only add extra
overhead.

Additionally the very first node of the broadcast tree has 2x fanout
(i.e. 400 nodes) which adds too much load at one node.

This commit simplifies the broadcast tree by dropping the redundant
propagation path and removing the 2x fanout at root node.
2022-04-19 00:11:29 +00:00
Caio b7bf00a9ee
Implement From<[u8; 32]> for Pubkey and Hash (#24427) 2022-04-18 07:36:31 +00:00
Tao Zhu 2970507d7c remove unused file 2022-04-17 19:26:24 -05:00
Tao Zhu 85281de981 move number utility functions to sdk; log error if cost adjust overflows i64 2022-04-17 19:26:24 -05:00
arusso-certik 41a9eb1bf2
Update doc for sol_memset (#24101) 2022-04-16 22:11:19 +08:00
Tyera Eulberg a0e3e3c193
Add Ident case (#24390) 2022-04-15 16:27:25 -06:00
sakridge 1b7d1f78de
Implement QUIC connection warmup service for future leaders (#24054)
* Increase connection timeouts

* Bump quic connection cache to 1024

* Use constant for quic connection timeout and add warm cache service

* Fixes to QUIC warmup service

* fix check failure

* fixes after rebase

* fix timeout test

Co-authored-by: Pankaj Garg <pankaj@solana.com>
2022-04-15 12:09:24 -07:00
Jon Cinque d54ec406df
sdk: Add --jobs parameter in build/test bpf (#24359) 2022-04-15 13:49:43 +02:00
Brooks Prumo 2456a7be35
Deprecate `MINIMUM_STAKE_DELEGATION` (#24329) 2022-04-14 11:59:18 -05:00
Michael Vines 57ff7371b4 Add StakeInstruction::DeactivateDelinquent 2022-04-14 01:49:22 -04:00
dependabot[bot] b9caa8cdfb
chore: bump uriparse from 0.6.3 to 0.6.4 (#23799)
* chore: bump uriparse from 0.6.3 to 0.6.4

Bumps [uriparse](https://github.com/sgodwincs/uriparse-rs) from 0.6.3 to 0.6.4.
- [Release notes](https://github.com/sgodwincs/uriparse-rs/releases)
- [Changelog](https://github.com/sgodwincs/uriparse-rs/blob/master/RELEASES.md)
- [Commits](https://github.com/sgodwincs/uriparse-rs/commits)

---
updated-dependencies:
- dependency-name: uriparse
  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-13 19:33:42 -06:00
Brooks Prumo e146e860e2
Add convenience function for programs to get minimum delegation (#24175) 2022-04-13 14:41:52 -05:00
Jack May 2e0bc89ec4
featurize rejection of callx r10 instructions (#24309) 2022-04-13 11:09:33 -07:00
Alexander Meißner b8ca1bcb68
Remove `NativeLoader` from program runtime (#24296)
* Deletes native_loader.rs

* Deletes the feature: remove_native_loader
2022-04-13 12:15:28 +02:00
Jack May a43ff3bbcb
cleanup (#24299) 2022-04-12 17:52:47 -07:00
Jack May 138f04a49f
featurize bpf function hash collision fix (#24262) 2022-04-12 17:52:32 -07:00
Dmitri Makarov 6b611e1c52 Bump bpf-tools to v1.25
- Tweak linker script
  Ensure that all read only sections end up in one segment, and
  everything else in other segments. Discard .eh_frame, .hash and
  .gnu.hash since they are unused.
- Don't create invalid string slices in stdout/stderr on Solana
- Report exceeded stack size as a warning if dynamic frames are off
- Native support for signed division in SBF
  Adds BPF_SDIV, which is enabled only for the SBF subtarget.
- Introduce dynamic stack frames and the SBFv2 flag
  Dynamic stack frames  are currently opt-in and enabled setting
  cpu=sbfv2. When sbfv2 is used, ELF files are flagged with
  e_flags=EF_SBF_V2 so the runtime can detect it and react
  accordingly.
2022-04-12 10:51:15 -07:00
Jack May b035991c35
migrate memberes from deprecated structs (#24263) 2022-04-12 09:49:42 -07:00
Michael Vines a2be810dbc Resolve new clippy complaints 2022-04-11 18:15:03 -04:00
Brian Anderson b38833923d
Use atomics instead of mutable statics in slot_hashes (#24091) 2022-04-11 15:12:50 -06:00
Ikko Ashimine ecfa1964ff
sdk: fix typo in lib.rs (#24240)
recieved -> received
2022-04-11 22:36:08 +08:00
Dmitri Makarov 689064a4f4 Bump sbf-tools version to v1.24 2022-04-08 09:06:40 -07:00
ignassew 0c2d9194dd
Fix typo in solana-program lib.rs (#24170) 2022-04-07 11:23:54 -06:00
behzad nouri d0b850cdd9 removes turbine peers shuffle patch feature 2022-04-05 12:04:12 +00:00
behzad nouri 855801cc95 removes deterministic-shred-seed feature 2022-04-05 12:04:12 +00:00
Brooks Prumo b14b8b1efa
Un-deprecate `MINIMUM_STAKE_DELEGATION` (#24089) 2022-04-03 15:09:41 -05:00
Brooks Prumo 2af6753808
Add GetMinimumDelegation stake program instruction (#24020) 2022-04-02 05:11:10 +00:00
Justin Starry 792bbf75ab
Support sending versioned txs in AsyncClient (#23982) 2022-04-02 11:12:02 +08:00
HaoranYi 0b7d0476c8
fix a typo (#24070) 2022-04-01 15:16:51 -07:00
Justin Starry 97170a5d38
Bump bytemuck version in solana-program for consistency (#24043) 2022-04-01 22:25:53 +08:00
Alexander Meißner 1b45c509c3
Refactor: Use `InstructionContext::get_instruction_data()` (#24014)
* Adds transaction_context and instruction_context where invoke_context.get_keyed_accounts() is used.

* Use instruction_context.get_instruction_data() instead of an explicit parameter.

* Removes instruction_data parameter from Executor::execute().

* Removes instruction_data parameter from ProcessInstructionWithContext.
2022-04-01 15:48:05 +02:00
Justin Starry 88326533ed
Add SDK support for creating transactions with address table lookups (#23728)
* Add SDK support for creating transactions with address table lookups

* fix bpf compilation

* rename compile error variants to indicate overflow

* Add doc tests

* fix bpf compatibility

* use constant for overflow tests

* Use cfg_attr for dead code attribute

* resolve merge conflict
2022-03-31 17:44:20 +08:00
Justin Starry cb5e67d327
Use Rent sysvar directly for stake split instruction (#24008)
* Use Rent sysvar directly for stake split ix

* Add feature to gate rent sysvar change

* fix tests

* cargo clippy
2022-03-31 16:46:35 +08:00
Brian Anderson 210d98bc06 Document APIs related to durable transaction nonces 2022-03-30 22:49:29 -06:00
Jack May 37497657c6
assert-type-assumptions (#23996) 2022-03-30 08:28:49 -07:00
Brian Anderson 492c54a28f
Fix example mock Signer API in solana-program (#23911) 2022-03-24 17:58:51 -04:00
Jeff Washington (jwash) 396b49a7c1
Start saving/loading prior_roots(_with_hash) to snapshot (#23844)
* Start saving/loading prior_roots(_with_hash) to snapshot

* Update runtime/src/accounts_index.rs

Co-authored-by: Michael Vines <mvines@gmail.com>

* Update runtime/src/accounts_index.rs

Co-authored-by: Michael Vines <mvines@gmail.com>

* update comment

Co-authored-by: Michael Vines <mvines@gmail.com>
2022-03-24 10:06:24 -05:00