Commit Graph

1239 Commits

Author SHA1 Message Date
Jon Cinque b1340d77a2
sdk: Make Packet::meta private, use accessor functions (#29092)
sdk: Make packet meta private
2022-12-06 12:54:49 +01:00
Alexander Meißner f766895f78
Adds a feature ID for `enable_alt_bn128_syscall` (#28908)
Adds a feature ID for enable_alt_bn128_syscall.
2022-12-01 09:58:23 +01:00
Jeff Washington (jwash) 7999f4278e
add feature #28934 (no-op in master) (#28936) 2022-11-28 14:58:59 -08:00
apfitzge bdd162492c
Feature/multi-iterator-scanner-read-locks (#28862) 2022-11-28 11:23:04 -06:00
Maximilian Schneider c8b0c3ede9
Update cost model to use requested_cu instead of estimated cu #27608 (#28281)
* Update cost model to use requested_cu instead of estimated cu #27608

* remove CostUpdate and CostModel from replay/tvu

* revive cost update service to send cost tracker stats

* CostModel is now static

* remove unused package

Co-authored-by: Tao Zhu <tao@solana.com>
2022-11-22 11:55:56 -06:00
ananas-block afc3fee937
added alt_bn syscalls (#27961)
* added alt_bn128_syscalls

* increased regression build redundancy to > 10
2022-11-21 17:43:06 +01:00
Lijun Wang ad24e37cc0
Limit the maximum staked streams to avoid excessive streams from staked nodes (#27973)
* Limit the maximum staked streams to avoid excessive streams from staked nodes.

* Fixed a clippy issue
2022-11-15 12:58:10 -08:00
Tao Zhu 81dc2e56ac
Cap accounts data a transaction can load by its requested limit (#27840)
- Add new compute-budget instruction to set transaction-wide accounts data size limit
- Set default accounts data limit to 10MB, and max to 100MB, per transaction;
- Add getters to make changing default and/or max values easier in the future with feature gates;
- added error counter for transactions exceed data size limit
2022-11-14 10:29:35 -06:00
Alexander Meißner 66d06b3f99
Revert #27444 (#28784)
* Removes SyscallSetAccountProperties.

* Removes TransactionContextAttribute.
2022-11-11 10:26:55 +01:00
Brooks Prumo d1ba42180d
clippy for rust 1.65.0 (#28765) 2022-11-09 19:39:38 +00:00
Alexander Meißner 93fc4edef8
Refactor - derive `CloneZeroed` (#28771)
* Adds proc_macro_derive(CloneZeroed).

* Switches over all use sites of clone_zeroed() and copy_field().

* Removes clone_zeroed() and copy_field().

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-11-09 18:15:42 +01:00
Sergey Melnychuk 0347d9cf78
Remove unnecessary clone of a String (#28758) 2022-11-07 20:42:19 +00:00
ryleung-solana 842fa993c8
Quic fix calculation of staked number of concurrent streams (#28705)
* Fix calculation of staked number of concurrent streams
2022-11-03 20:45:44 +08:00
0xripleys 5de4dd8f9b
Add SetAuthorityChecked instruction to bpf loader (#28424)
* SetAuthorityChecked

* restore old logic for loader

* add more upgrade authority checked test cases

* setBufferAuthority checked tests

* format

* add set_buffer_authority_checked instruction to sdk

* Update transaction-status/src/parse_bpf_loader.rs

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>

* add is_set_authority_checked function

* fix set_buffer_authority_checked sdk instruction

* feature gate setAuthorityChecked

* add bpf loader tests for setAuthorityChecked ixs

* test that you can set to same authority

* allow set_authority_checked to be called via cpi (if feature is enabled)

* fix ci

* fmt

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
Co-authored-by: Justin Starry <justin@solana.com>
2022-11-01 08:34:04 +00:00
Dmitri Makarov 34865d032c chore: update Solana docs and code comments that specify "BPF" to "SBF" 2022-10-31 14:14:25 -04:00
apfitzge 37fb603fc0
precompile verify: &Arc<FeatureSet> to &FeatureSet (#27647) 2022-10-27 19:25:33 -05:00
Alexander Meißner a43098a428
Feature - Check syscall outputs do not overlap (#28599)
* Extends is_nonoverlapping() to be able to deal with two different lengths.

* Uses is_nonoverlapping() for syscall output parameters.

* Feature gates the new throws of SyscallError::CopyOverlapping.

* Adds tests which trigger SyscallError::CopyOverlapping.
2022-10-27 19:11:18 +02:00
Jeff Washington (jwash) 1ff2740905
feature 28541 no-op (#28542) 2022-10-24 07:52:11 -07:00
Jeff Washington (jwash) fd2e671861
remove slot# from account hash (#28405)
* remove slot# from account hash

* add feature

* fix tests

* constants to help clarify 'irrelevant' changes

* move to enum for enforcing irrelevancy

* ignore unsupported tests
2022-10-18 08:03:37 -07:00
Alexey Skibin 108a02cfd4
Add off-chain messages support (#27456) 2022-10-17 11:19:12 -04:00
Kevin Heavey 061bed0a8c
More missing derives (#27418)
* add Eq, PartialEq to EpochInfo

* add Eq, PartialEq related to transactions and messages

* add Eq, PartialEq to Ed25519SignatureOffsets

* add Eq, PartialEq to FeatureSet

* add Eq, PartialEq to fee.rs

* add Eq, PartialEq to GenesisConfig

* don't add Eq to GenesisConfig because floats

* add Eq, PartialEq to PohConfig

* add Eq, PartialEq to SecpSignatureOffsets

* add some missing derives to transaction_context.rs

* add Eq, PartialEq to ProcessedSiblingInstruction
2022-10-11 12:59:58 -07:00
Jeff Biseda 15050b14b9
use signed repair request variants (#28283) 2022-10-10 14:09:45 -07:00
apfitzge 3781c0668f
separate account locks validation from creating the locks (#28292) 2022-10-07 12:23:18 -05:00
Alessandro Decina f6fee4ac3a
Serialization refactor (#28251)
* Use infallible, unchecked methods to write into the serialization buffer

We serialize in two steps: first we compute the size of the buffer, then
we write into it. Therefore there's no need to check if each individual
write fits the buffer - we know it does we just computed the required
size.

* serialize_parameters: remove extra loop/borrows

Remove one extra loop over accounts to gather account lengths. Also
gather all accounts at once and avoid temporary borrows.

* Move creating MemoryRegions for serialized parameters from create_vm to serialize_parameters

This is in preparation of using multiple MemoryRegions once we land direct account mapping.

* bpf_loader: introduce internal API to build serialization buffer/regions

This is prep work for landing the direct_mapping feature, which maps account
data in their own memory regions.

* serialization: fix after API changes
2022-10-07 07:45:05 +01:00
Justin Starry ddf95c181c
RPC: Support versioned txs in getFeeForMessage API (#28217)
* RPC: Support versioned txs in getFeeForMessage API

* Update sdk/program/src/message/sanitized.rs

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

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-10-05 00:00:34 +08:00
Jeff Washington (jwash) 7b4a6ded5b
remove feature return_none_for_zero_lamport_accounts (#28144) 2022-10-03 12:22:56 -07:00
Ashwin Sekar 84acef007c
Add bench test for voting threads (#28031) 2022-09-27 12:12:22 -07:00
Alexander Meißner 71aee4fcaf
Feature: Explicitly limit `TransactionContext::instruction_trace_capacity` (#27938)
* Renames instruction_stack_capacity => instruction_stack_capacity.

* Replaces number_of_instructions_at_transaction_level by instruction_trace_capacity.

* Adds MaxInstructionTraceLengthExceeded.

* Adjusts TransactionContext::new() parameter.

* Adds feature gate limit_max_instruction_trace_length.

* Adds test_max_instruction_trace_length().
2022-09-26 10:47:16 +02:00
Alessandro Decina b9f4c8e3c0
BorrowedAccount: add set_data_from_slice(), make set_data() take owned values (#27836)
* BorrowedAccount: add set_data_from_slice(), make set_data() take owned values

set_data() used to take a slice and would force alloc+copy if the caller
has owned values (eg account creation, account lookup table).

Expose set_data_from_slice() for callers that have slices, and switch
set_data() to taking an owned Vec.

* BorrowAccount: refactor common accounts_update_delta code in helper method

* BorrowedAccount: add extend_from_slice()

This allows avoiding copies appending entries to account lookup tables.

* BorrowedAccount: remove unnecessary ifs around update_accounts_resize_delta
2022-09-24 01:37:02 +01:00
behzad nouri 9ee53e594d
patches clippy errors from new rust nightly release (#28028) 2022-09-23 20:57:27 +00:00
Jeff Biseda 206cc9407b
allow unsigned repair requests (#27910) 2022-09-23 10:11:08 -07:00
Alessandro Decina bad09812e3 AccountSharedData: optimize set_data_from_slice
Remove memcmp and try to avoid allocations by trying to reuse or extend
existing capacity.
2022-09-23 11:31:33 +01:00
behzad nouri 9a57c64f21
patches clippy errors from new rust nightly release (#27996) 2022-09-22 22:23:03 +00:00
Justin Starry 108b245e6b
Require program account to be writable in extend program data ix (#27911)
* Require program account to be writable in extend program data ix

* feedback
2022-09-22 12:03:06 +08:00
Justin Starry 00b0a92ec4
Support sending versioned txs in rpc client (#27933)
* Support sending versioned txs in rpc client

* Revert adding instructions_mut function
2022-09-22 01:25:43 +00:00
Justin Starry b9700244b5
Increase transaction account lock limit from 64 to 128 (#27242)
* Increase transaction account lock limit from 64 to 256

* fix bpf test

* Reduce lock limit from 256 to 128
2022-09-15 13:50:14 -04:00
Jeff Washington (jwash) 138d5ed5b0
don't return zero lamport accounts from 'load' with feature (#27793)
* don't return zero lamport accounts from 'load'

* add feature

* rename
2022-09-15 08:46:32 -07:00
Christian Kamm 90b8a3a44d
Remove KeypairInsecureClone trait and add insecure_clone() instead (#27396)
See discussion in #26248
2022-09-12 14:59:41 +00:00
Tao Zhu ced8f6a512
Add feature gate to remove support for RequestUnitsDeprecated instruction (#27503)
* feature gate: remove support for RequestUnitsDeprecated instruction #27500

* review update: stop support deprecated ix for prioritization

* Apply suggestions from code review

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
2022-09-09 22:24:21 +00: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
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
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