Commit Graph

73 Commits

Author SHA1 Message Date
Brooks Prumo d1ba42180d
clippy for rust 1.65.0 (#28765) 2022-11-09 19:39:38 +00: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
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
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
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
Jeff Washington (jwash) 342f1ab1cb
clean up/add comments (#23727) 2022-03-17 14:23:08 -05:00
Jeff Washington (jwash) bb9f9c8dd5
AccountSharedData::serialize (#23685) 2022-03-17 09:29:49 -05:00
Jeff Washington (jwash) b5a99b9b09
avoid data copies in writing to cache (#23674) 2022-03-15 16:42:26 -05:00
Jack May 97d40ba3da Resized accounts must be rent exempt 2022-03-02 13:02:02 -08:00
Brooks Prumo d90d5ee9b6
Refactor Rent::due() with RentDue enum (#22346) 2022-01-08 09:03:46 -06:00
Justin Starry 9b41ddd9ba
Add address lookup table program (#21616)
* Add address lookup table program

* feedback
2021-12-10 16:02:16 -05:00
fee1-dead c4a9c8b5e9
Remove dependency on `hex` (#21567)
* Remove dependency on `hex`

* Update lock file

* Use `debug_struct` instead of own format

* Share code, add test, and fix rent_epoch spelling

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-12-03 20:53:35 -07:00
Michael Vines b8837c04ec Reformat imports to a consistent style for imports
rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
2021-12-03 09:19:13 -08:00
Justin Starry 207c90bd8b
Shorten long SerializeWith type paths in abi digest (#18734) 2021-07-20 08:59:50 -05:00
Alexander Meißner 6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
Tao Zhu 0781fe1b4f
Upgrade Rust to 1.52.0 (#17096)
* Upgrade Rust to 1.52.0
update nightly_version to newly pushed docker image
fix clippy lint errors
1.52 comes with grcov 0.8.0, include this version to script

* upgrade to Rust 1.52.1

* disabling Serum from downstream projects until it is upgraded to Rust 1.52.1
2021-05-19 09:31:47 -05:00
Jeff Washington (jwash) 92b8b20ca5
AccountSharedData.lamports private (#16985) 2021-05-03 17:25:31 +00:00
Jeff Washington (jwash) 3f982fcf65
account.rent_epoch private (#16974) 2021-04-30 12:16:44 -05:00
Jeff Washington (jwash) f533d3be77
Write account path impl ReadableAccount (#16779) 2021-04-28 15:29:22 -05:00
Jeff Washington (jwash) 9218b51de7
accountshareddata.executable is private (#16882) 2021-04-28 12:01:31 -05:00
Jeff Washington (jwash) 603872685d
private AccountSharedData.owner (#16760)
* private AccountSharedData.owner

* fix perf test
2021-04-26 14:59:17 -05:00
Jeff Washington (jwash) 48c07d32f0
WritableAccount.add/subtract_lamports (#16750)
* add/sub lamports

* make add/sub return Result

* sample replacements

* cleanup

* fix up a few tests as examples

* move enum, cleanup, impl from

* fmt

* cleanup

* add lamports.rs
2021-04-23 20:20:48 +00:00
Jeff Washington (jwash) 87e2e07d34
AccountSharedData.copy_into_owner_from_slice (#16755) 2021-04-23 09:34:08 -05:00
Jeff Washington (jwash) 03f7b251b8
ReadableAccount.data returns slice (#16686)
* ReadAbleAccount.data returns slice

* more slice fixup

* more slice

* slice
2021-04-20 16:41:16 -05:00
Jeff Washington (jwash) 66c42f62d8
make AccountSharedData.data private to abstract storage (#16091)
* format

* 2 more tests

* use
2021-03-25 11:04:20 -05:00
Ryo Onodera 6d5c6c17c5
Simplify account.rent_epoch handling for sysvar rent (#16049)
* Add some code for special local testing

* Add comment to store_account_and_update_capitalization

* Simplify account.rent_epoch handling for sysvar rent

* Introduce *_for_test functions

* Add deprecation messages to existing api
2021-03-25 15:23:20 +09:00
Jeff Washington (jwash) 2d24d13046
AccountsSharedData: data copy on write (#15800)
* Arc<AccountData>

* try custom serializer

* adapt test from Behzad's change

* clippy

* simplify serialization

* remove abi example derive

* refactor 'take'

* remove serialization

* remove serialize calls

* remove account_data

* remove intos

* remove left over file
2021-03-23 15:19:31 -05:00
Jeff Washington (jwash) 9760fded2d
remove old code (#15988) 2021-03-18 17:51:49 +00:00
Jeff Washington (jwash) 806bfdd67b
set_data_from_slice (#15854)
* data_ensure_equal_to_slice

* rename and change to copy
2021-03-16 16:56:26 -05:00
Jack May 60e5fd11c9
Display actual account length (#15875) 2021-03-15 14:17:56 -07:00
Jeff Washington (jwash) 3419a5446e
AccountSharedData.set_data (#15781)
* account.set_data and resize_data

* remove data_resize
2021-03-11 16:40:45 -06:00
Jeff Washington (jwash) 8a3135d17b
Account->AccountSharedData (#15691) 2021-03-09 15:06:07 -06:00
dependabot[bot] 1df93fa2be
chore: bump serde from 1.0.112 to 1.0.118 (#14828)
* chore: bump serde from 1.0.112 to 1.0.122

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.112 to 1.0.122.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.112...v1.0.122)

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

* [auto-commit] Update all Cargo lock files

* Update frozen_abi digest following serde update

* Revert "chore: bump serde from 1.0.112 to 1.0.122"

This reverts commit a3ef4442a4c985144ae2bd7ceaf8899a7ab8d7c0.

* Revert "[auto-commit] Update all Cargo lock files"

This reverts commit c41c3b005fb1ccade55155302c52cd5736c4b55f.

* chore: bump serde from 1.0.112 to 1.0.118

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.112 to 1.0.118.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.112...v1.0.118)

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

* [auto-commit] Update all Cargo lock files

* Remove serum-dex pinning

* blind commit!

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: Ryo Onodera <ryoqun@gmail.com>
2021-02-02 23:28:16 +09:00
Jack May c458d4b213
move Account to solana-sdk (#13198) 2020-10-28 22:01:07 -07:00
Michael Vines 63db324204 Initial population of solana-program-sdk 2020-10-24 08:37:55 -07:00
Ryo Onodera 39b3ac6a8d
Introduce automatic ABI maintenance mechanism (2/2; rollout) (#8012)
* Introduce automatic ABI maintenance mechanism (2/2; rollout)

* Fix stable clippy

* Change to symlink

* Freeze abi of Tower

* fmt...

* Improve dev-experience!

* Update BankSlotDelta

$ diff -u /tmp/abi8/*7dg6BreYxTuxiVz6aLvk3p2Z7GQk2cJqfGvC9h4FAoSj* /tmp/abi8/*9chBcbXVJ4fK7uGgydQzam5aHipaAKFw6V4LDFpjbE4w*
--- /tmp/abi8/bank__BankSlotDelta_frozen_abi__test_abi_digest_7dg6BreYxTuxiVz6aLvk3p2Z7GQk2cJqfGvC9h4FAoSj      2020-06-18 18:01:22.831228087 +0900
+++ /tmp/abi8/bank__BankSlotDelta_frozen_abi__test_abi_digest_9chBcbXVJ4fK7uGgydQzam5aHipaAKFw6V4LDFpjbE4w      2020-07-03 15:59:58.430695244 +0900
@@ -140,7 +140,7 @@
                                                         field u8
                                                             primitive u8
                                                         field solana_sdk::instruction::InstructionError
-                                                            enum InstructionError (variants = 34)
+                                                            enum InstructionError (variants = 35)
                                                                 variant(0) GenericError (unit)
                                                                 variant(1) InvalidArgument (unit)
                                                                 variant(2) InvalidInstructionData (unit)
@@ -176,6 +176,7 @@
                                                                 variant(31) CallDepth (unit)
                                                                 variant(32) MissingAccount (unit)
                                                                 variant(33) ReentrancyNotAllowed (unit)
+                                                                variant(34) MaxSeedLengthExceeded (unit)
                                                     variant(9) CallChainTooDeep (unit)
                                                     variant(10) MissingSignatureForFee (unit)
                                                     variant(11) InvalidAccountIndex (unit)

* Fix some merge conflicts...
2020-07-06 20:22:23 +09:00
Jack May dac7dc2f10
Move types to more appropriate files (#10638) 2020-06-17 10:39:14 -07:00
Justin Starry 5cc252d471
Remove hash field from account (#9915) 2020-05-12 23:39:46 +08:00
Jack May 25df95be6f
Expose executable and rent_epoch in AccountInfo (#8619) 2020-03-04 10:52:09 -08:00
Jack May 12eff5a2f9
Cleanup SDK use syntax (#8004) 2020-01-28 16:11:22 -08:00
Jack May c95e5346a4
Boot the mut (#7926) 2020-01-22 17:54:06 -08:00
Jack May 023074650f
Allow the same account to be passed multiple times to a single instruction (#7795) 2020-01-22 09:11:56 -08:00
Jack May 52bc4a3598
nudge (#7887) 2020-01-20 15:27:36 -08:00
Tyera Eulberg 6d3b8b6d7d
Remove tuples from JSON RPC responses (#7806)
* Remove RpcConfirmedBlock tuple

* Remove getRecentBlockhash tuple

* Remove getProgramAccounts tuple

* Remove tuple from get_signature_confirmation_status

* Collect Rpc response types

* Camel-case epoch schedule for rpc response

* Remove getBlockCommitment tuple

* Remove getStorageTurn tuple

* Update json-rpc docs
2020-01-15 00:25:45 -07:00
Jack May 75d94240ed
account_info utilities (#7666) 2020-01-03 09:14:51 -08:00
Jack May 39b578fde9
Remove runtime dependency from config program unit tests and move back to config program (#7277) 2019-12-04 19:24:12 -08:00
Jack May 8babecd890
Remove todo from account (#6827) 2019-11-08 13:30:21 -08:00
Tyera Eulberg c6931dcb07
Remove credit-only account handling (#6726)
* Renaming
- credit-only/credit-debit to read-only/read-write
- debitable to writable

* Remove credit handling, making credit-only accounts read-only

* Update programs to remove deprecated credit-only account designation

* Use readonly and writable instead of underscored types
2019-11-05 09:38:35 -07:00
Jack May 985f5c7351 Use serde-bytes to serialize u8 efficiently (#6442)
automerge
2019-10-18 17:18:06 -07:00
Rob Walker c2ebf466fd
reestablish parameter semantics for withdraw (#6330) 2019-10-14 15:02:24 -07:00