Alexander Meißner
2e5042d8bd
Remove `KeyedAccount` in builtin program "vote" ( #24189 )
...
* Uses transaction_context.get_key_of_account_at_index() in vote.
* Inline keyed_account_at_index() in all instructions of vote
which have more than one KeyedAccount parameter,
because these could cause a borrow collision.
* Replaces KeyedAccount by BorrowedAccount in vote.
2022-04-08 20:40:50 +02:00
Alexander Meißner
fad9bd0538
Removes KeyedAccount parameter from get_if_mergeable(). ( #24190 )
2022-04-08 20:40:09 +02:00
Dmitri Makarov
689064a4f4
Bump sbf-tools version to v1.24
2022-04-08 09:06:40 -07:00
Dmitri Makarov
03ed334ebb
Double the chunk size for sending the program binary data in tx
2022-04-08 09:06:40 -07:00
Alexander Meißner
cb1507126f
Fixes check_number_of_instruction_accounts() in StakeInstruction::Authorize. ( #24172 )
2022-04-08 12:43:55 +02:00
Brooks Prumo
a100b32b37
Add test for GetMinimumDelegation stake instruction ( #24158 )
2022-04-07 11:54:15 -05:00
Alexander Meißner
efb9cbd8e7
Refactor: Remove `trait` from stake keyed account ( #24148 )
...
Removes trait from StakeAccount.
2022-04-06 22:58:09 +02:00
Alexander Meißner
25304ce485
Inlines verify_rent_exemption() in vote processor. ( #24146 )
2022-04-06 22:13:06 +02:00
ryleung-solana
a38bd4acc8
Use LRU in connection-cache ( #24109 )
...
Switch to using LRU for connection-cache
2022-04-06 10:58:32 -04:00
Alexander Meißner
07f4a9040a
Removes KeyedAccount from tests in stake instruction. (Part 4) ( #24124 )
...
* Moves tests from stake state to stake instruction.
* Migrates test_merge.
* Migrates test_merge_self_fails.
* Migrates test_merge_incorrect_authorized_staker.
* Migrates test_merge_invalid_account_data.
* Migrates test_merge_fake_stake_source.
* Migrates test_merge_active_stake.
2022-04-06 12:04:35 +02:00
samkim-crypto
ba92ba0e06
Zk instructions check length ( #24103 )
...
* zk-token-sdk: add a length check before decoding proof instruction
* zk-token-sdk: fix minor spelling
* zk-token-sdk: one-liner for length check
* zk-token-sdk: one-liner fix
2022-04-05 08:40:45 -04:00
Alexander Meißner
e051c7c162
Removes KeyedAccount from tests in stake instruction. (Part 3) ( #24110 )
...
* Moves test from stake state to stake instruction.
* Migrates test_split_source_uninitialized.
* Migrates test_split_split_not_uninitialized.
* Migrates test_split_more_than_staked.
* Migrates test_split_with_rent.
* Migrates test_split_to_account_with_rent_exempt_reserve.
* Migrates test_split_from_larger_sized_account.
* Migrates test_split_from_smaller_sized_account.
* Migrates test_split_100_percent_of_source.
* Migrates test_split_100_percent_of_source_to_account_with_lamports.
* Migrates test_split_rent_exemptness.
2022-04-05 12:36:01 +02: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
Alexander Meißner
8a18c48e47
Removes `KeyedAccount` from tests in stake instruction. (Part 2) ( #24053 )
...
* Migrates test_initialize_minimum_stake_delegation.
* Migrates test_delegate_minimum_stake_delegation.
* Migrates test_split_minimum_stake_delegation.
* Migrates test_split_full_amount_minimum_stake_delegation.
* Migrates test_split_destination_minimum_stake_delegation.
* Migrates test_withdraw_minimum_stake_delegation.
* Migrates test_behavior_withdrawal_then_redelegate_with_less_than_minimum_stake_delegation.
2022-04-02 01:08:55 +02: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
Jack May
ceb3b52ae4
Remove unnecessary asserts ( #24017 )
2022-03-31 09:23:45 -07: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
Jack May
b741b86403
restore existing overlapping overflow ( #24010 )
2022-03-30 15:21:51 -07:00
Jack May
37497657c6
assert-type-assumptions ( #23996 )
2022-03-30 08:28:49 -07:00
Alexander Meißner
83ef3fc53e
Refactor: Remove `KeyedAccount` in bpf_loader helper functions ( #23986 )
...
* Replaces KeyedAccount in create_executor().
* Refactors len to write_offset in write_program_data().
* Replaces KeyedAccount in write_program_data().
* Use transaction_context.get_key_of_account_at_index() in process_instruction_common().
* Renames next_first_instruction_account to program_account_index.
* Replaces program KeyedAccount by BorrowedAccount in process_instruction_common().
* Removes _program in process_instruction_common().
* Replaces first_account KeyedAccount by BorrowedAccount in process_instruction_common().
* Moves KeyedAccount lookup inside common_close_account().
* Replaces close_account, recipient_account and authority_account KeyedAccount by BorrowedAccount in common_close_account().
2022-03-30 09:17:55 +02:00
Alexander Meißner
794645d092
Adds check_number_of_instruction_accounts() to all builtin programs except for the address-lookup-table. ( #23984 )
2022-03-29 19:06:50 +02:00
Alexander Meißner
140c8dd01f
Refactor: Replaces KeyedAccount in_get_sysvar_with_account_check ( #23905 )
...
* Replaces all use sites of get_sysvar_with_account_check by get_sysvar_with_account_check2.
* Removes get_sysvar_with_account_check.
* Renames get_sysvar_with_account_check2 to get_sysvar_with_account_check.
2022-03-24 19:30:42 +01:00
ryleung-solana
82945ba973
Optimize TpuConnection and its implementations and refactor connection-cache to not use dyn in order to enable those changes ( #23877 )
2022-03-24 11:40:26 -04:00
Alexander Meißner
91c2729856
Replaces keyed_account get_signers() by InstructionContext::get_signers(). ( #23863 )
2022-03-24 12:57:51 +01:00
Trent Nelson
9dae5551a1
Revert transient dependency bumps from c4ecfa5
2022-03-23 21:08:26 +00:00
Jack May
6962a667e5
add-u8-align-check ( #23860 )
2022-03-23 09:16:29 -07:00
Jack May
27b66db88d
Use sat math for ptr calcs ( #23861 )
2022-03-23 09:16:03 -07:00
klykov
9859eb83b5
upd Cargo.lock for bpf
2022-03-23 09:25:36 +01:00
Jack May
3d7c8442c7
add size check for from_raw_parts ( #23781 )
2022-03-22 15:20:39 -07:00
Jon Cinque
7af48465fa
transaction-status: Add return data to meta ( #23688 )
...
* transaction-status: Add return data to meta
* Add return data to simulation results
* Use pretty-hex for printing return data
* Update arg name, make TransactionRecord struct
* Rename TransactionRecord -> ExecutionRecord
2022-03-22 23:17:05 +01:00
Lijun Wang
49228573f4
Use connection cache in send transaction ( #23712 )
...
Use connection cache in send transaction (#23712 )
2022-03-21 23:24:21 -07:00
Will Hickey
c4ecfa5716
Bump version to v1.11 ( #23807 )
...
* Revert crossbeam_epoch to stable. 0.9.8 only works with nightly
* Remove unneeded unit expression
2022-03-21 17:40:50 -05:00
Ikko Ashimine
848093b9fd
Fix typo in processor.rs ( #23786 )
...
relavant -> relevant
2022-03-19 15:24:40 -05:00
Jack May
1f052c6234
disable deprecated BPF loader deploys ( #23757 )
2022-03-18 14:29:49 -07:00
Jack May
7e358c654f
add test to assert type assumption ( #23769 )
2022-03-18 14:15:59 -07:00
Jack May
0e64fb1fab
don't rely on align_offset to check alignment ( #23770 )
2022-03-18 11:30:52 -07:00
Brian Anderson
fcea92ec6c
Improve correctness of Rust-side type definitions for C invoke syscall ( #23624 )
...
* Make Rust definitions of C types repr(C)
* Make SolInstruction field types agree with C definitions
* Use correct SolSignerSeedsC type in SyscallInvokeSignedC
* rustfmt
* Change asserts to debug asserts in syscall.rs
2022-03-18 11:30:30 -07:00
dependabot[bot]
00ddf6576c
chore: bump crossbeam-channel from 0.5.2 to 0.5.3 ( #23698 )
...
* chore: bump crossbeam-channel from 0.5.2 to 0.5.3
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam ) from 0.5.2 to 0.5.3.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases )
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md )
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.2...crossbeam-channel-0.5.3 )
---
updated-dependencies:
- dependency-name: crossbeam-channel
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-03-18 11:44:33 -06:00
HaoranYi
f54e746fc5
Support u8 slice digester in frozen abi struct. ( #23726 )
...
* support u8 slice in frozen abi digester
* use slice in account struct
* add bpf cargo lock file
* no need to pass account.data to serializer
* fix comments
2022-03-18 09:31:07 -05:00
Will Hickey
2f58c9e501
Bump version to 1.10.4 ( #23743 )
2022-03-17 14:02:13 -05:00
Jeff Washington (jwash)
bb9f9c8dd5
AccountSharedData::serialize ( #23685 )
2022-03-17 09:29:49 -05:00
Justin Starry
b4350a2522
Make solana-address-lookup-table-program crate bpf compatible ( #23700 )
2022-03-17 08:21:07 +08:00
Alexander Meißner
dda3a463a2
Fix duplicate account translation in CPI ( #23701 )
...
* Use visit_each_account_once() in CPI syscall to prevent duplicate accounts from being translated twice.
* remove unwrap() from runtime
Co-authored-by: Jack May <jack@solana.com>
2022-03-16 22:45:01 +00:00
Brooks Prumo
18bddbc730
Stake tests respect MINIMUM_STAKE_DELEGATION ( #23426 )
2022-03-16 16:36:23 -05:00
dependabot[bot]
45337885c1
chore: bump gethostname from 0.2.1 to 0.2.3 ( #23697 )
...
* chore: bump gethostname from 0.2.1 to 0.2.3
Bumps gethostname from 0.2.1 to 0.2.3.
---
updated-dependencies:
- dependency-name: gethostname
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-03-16 12:35:39 -06:00
Brooks Prumo
74bb527203
Refactor and use MINIMUM_STAKE_DELEGATION constant ( #22663 )
2022-03-16 10:56:48 -05:00
Justin Starry
cffc32af3e
Make payer and system program optional when extending lookup tables ( #23678 )
2022-03-16 21:40:16 +08:00
behzad nouri
3252dc7203
uses structural sharing for stake-delegations hash-map ( #23585 )
...
StakeDelegations is using Arc to implement copy-on-write semantics:
https://github.com/solana-labs/solana/blob/58c0db970/runtime/src/stake_delegations.rs#L14-L16
However a single delegation change will still clone the entire hash-map,
resulting in excessive memory use as observed in:
https://github.com/solana-labs/solana/issues/23061#issuecomment-1063444072
This commit instead uses immutable hash-map implementing structural
sharing:
> which means that if two data structures are mostly copies of each
> other, most of the memory they take up will be shared between them.
https://docs.rs/im/latest/im/
2022-03-16 12:58:05 +00:00
Alexander Meißner
584ac80b1e
Revert: `KeyedAccount` refactoings in builtin programs ( #23649 )
...
* Revert "Replaces KeyedAccount by BorrowedAccount in the BPF loader. (#23056 )"
6c56eb9663
* Revert "Replaces `KeyedAccount` by `BorrowedAccount` in `system_instruction_processor`. (#23217 )"
ee7e411d68
* Revert "Replaces `KeyedAccount` by `BorrowedAccount` in `nonce_keyed_account`. (#23214 )"
1a68f81f89
* Revert "Replaces KeyedAccount by BorrowedAccount in the config processor. (#23302 )"
a14c7c37ee
* Revert "Replaces `KeyedAccount` by `BorrowedAccount` in vote processor (#23348 )"
e2fa6a0f7a
* Revert "Refactor: Prepare stake_instruction.rs to remove `KeyedAccount`s (#23375 )"
ee3fc39f1c
2022-03-16 11:30:01 +01:00