49 Commits

Author SHA1 Message Date
Jack May
03263c850a
Force program address off the curve (#11323) 2020-08-05 16:35:54 -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
db4a18ada4
Add PubkeyError for ProgramError (#10748) 2020-06-23 11:19:27 -07:00
Greg Fitzgerald
19d11800bf
Remove WithSigner (#10325)
automerge
2020-05-29 23:17:44 -07:00
Jack May
03abd3ddd7
Prevent privilege escalation (#10232)
automerge
2020-05-26 01:02:31 -07:00
anatoly yakovenko
a0514eb2ae
thiserror, docs, remove general Failure case (#9741)
automerge
2020-04-29 18:12:51 -07:00
Jack May
068f12fd6f
Add Cross-program invocations (#9582) 2020-04-28 14:33:56 -07:00
Jack May
241a05fc52
Add native loader entry points (#9486) 2020-04-15 09:41:29 -07:00
Jack May
ad0482be73
Revert "Add native loader entry points (#9275)" Breaks genesis_config abi (#9377)
This reverts commit ed86d8d1fcd29c3c5000cc1aa4fda0b681319a65.
2020-04-08 14:36:18 -07:00
Jack May
ed86d8d1fc
Add native loader entry points (#9275) 2020-04-03 17:40:59 -07:00
Jack May
268e04cb4a
Rename CustomError to Custom (#9207) 2020-04-01 09:01:11 -07:00
Jack May
93be7370d9
Nit: print program error as hex (#9171) 2020-03-31 10:08:07 -07:00
Jack May
130c0b484d
Enforce an executable's rent exemption in the runtime (#9134) 2020-03-31 10:07:38 -07:00
Jack May
e2491c6322
Prevent add/subtract from executable account (#9132) 2020-03-27 16:43:25 -07:00
Jack May
8d4cecdb77
Account data may not change once the executable bit is set (#9099)
automerge
2020-03-26 17:10:11 -07:00
Trent Nelson
fbf2dd1672
CLI: Error message cleanup (#8804)
automerge
2020-03-12 23:20:49 -07:00
Jack May
deaf3cb416
Instruction member function (#8801) 2020-03-12 09:08:39 -07:00
Michael Vines
7dac8e2dde Reorder InstructionError to remain compatible with v0.23 2020-02-27 18:05:12 -07:00
Jack May
a0bcbf70d5
Cleanup new_result_with_negative_lamports (#8286) 2020-02-14 13:58:33 -08:00
Jack May
0fd795a676
Remove program error footgun and cleaner developer experience (#8042) 2020-01-31 10:58:07 -08:00
Jack May
2226c1b75c
Add Rust BPF RefCell borrow helpers (#8047) 2020-01-30 20:40:27 -08:00
Jack May
dd276138c2
Add support for idiomatic error handling to BPF instruction processors (#7968) 2020-01-30 09:47:22 -08:00
Jack May
12eff5a2f9
Cleanup SDK use syntax (#8004) 2020-01-28 16:11:22 -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
Jack May
88cb0c6ae3
Add offline signing support to CLI (#7104) 2019-11-25 21:09:57 -08:00
Tyera Eulberg
716caeb17c Use camelCase (#7050)
automerge
2019-11-19 14:55:32 -08:00
Justin Starry
3acd84d9c0 Allow creating an vote program ix where the withdrawer is also the "to" account (#6992)
automerge
2019-11-18 12:43:47 -08:00
Jack May
cd5ec8cd35
Fix blind keyed_account indexing in BPF and Move loader (#6810) 2019-11-08 09:19:19 -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
1fd84cb52b
Enforce only system program can allocate accounts (#6386) 2019-10-16 10:47:45 -07:00
Greg Fitzgerald
eca56eb87d
Add next_keyed_account() to instruction_processor_utils (#6309)
* Cleanup KeyedArguments traversal

* Better error message

* Fix clippy warning

* Rename next_arg to next_keyed_account

* Fix clippy warning

* Shorter
2019-10-10 06:30:42 -06:00
Justin Starry
81c36699c4
Add support for BPF program custom errors (#5743)
* Add support for BPF program custom errors

* Rename SOL_SUCCESS -> SUCCESS
2019-09-06 16:05:01 -07:00
Rob Walker
e2ecacc141
runtime checks for rent_epoch (#5629)
* runtime checks for rent_epoch

* add actual test

* bigger timeout

* backout 90 min timeout

* new noop
2019-08-26 11:04:20 -07:00
Rob Walker
50a991fdf9
add executable checks to verify_instruction (#5326) 2019-07-29 15:29:20 -07:00
TristanDebrunner
091999a17e
fix Instruction and CompiledInstruction field names (#4895)
* s/program_ids_index/program_id for Instruction

* s/program_ids_index/program_id_index for CompiledInstruction
2019-07-01 18:34:22 -06:00
Tyera Eulberg
807c69d97c
Slimmer implementation of credit-only accounts (#4592)
* Add credit-only debit/data check to verify_instruction

* Store credits and pass to accounts_db

* Add InstructionErrors and tests

* Relax account locks for credit-only accounts

* Collect credit-only account credits before passing to accounts_db to store properly

* Convert System Transfer  accounts to credit-only, and fixup test

* Functionalize collect_accounts to unit test

* Review comments

* Rebase
2019-06-10 20:50:02 -06:00
Rob Walker
a18c0e34f4
add activate_stake to stake_api (#4600) 2019-06-10 12:17:29 -07:00
Tyera Eulberg
943cd0a24a
Add credit-only info to AccountMetadata (#4405)
* Add credit-only flag to AccountMeta, default to false

* Sort keys by is_credit_only within signed/unsigned groupings

* Process and de-dupe program keys along with other account keys

* Add message helper functions

* Fix test

* Improve comment

* s/is_credit_only/is_debitable

* Add InstructionKeys helper struct, and simplify program_position method
2019-05-23 18:19:53 -04:00
Tyera Eulberg
99d2428041
Transaction format changes toward Credit-Only accounts (#4386)
* Add num_readonly_accounts slice

* Impl programs in account_keys

* Emulate current account-loading functionality using program-account_keys (breaks exchange_program_api tests)

* Fix test

* Add temporary exchange faucet id

* Update chacha golden

* Split num_credit_only_accounts into separate fields

* Improve readability

* Move message field constants into Message

* Add MessageHeader struct and fixup comments
2019-05-22 18:23:16 -04:00
Tyera Eulberg
d31989f878 CustomError from Vec->u32 2019-04-11 13:59:48 -07:00
Tyera Eulberg
90c1300bb6 Plumb TransactionError through Rpc 2019-04-05 22:09:29 -06:00
Greg Fitzgerald
4c0bc1fd88 Add program_ids() methods
Added CompiledInstruction::program_id() so that we don't need to pass
around instruction indexes just for Message::program_id().

Also added Message.program_ids() that returns a slice so that we
can move those pubkeys into Message::account_keys.
2019-04-02 19:00:35 -06:00
Greg Fitzgerald
7896e8288d Replace Transaction::fee with a FeeCalculator 2019-03-29 19:21:51 -06:00
Greg Fitzgerald
c4bc710d3a Use Serde's with attribute to shorten length encodings in Transaction 2019-03-29 08:25:56 -06:00
Sathish Ambley
857dc2ba47 Remove custom serialization 2019-03-29 08:25:56 -06:00
Greg Fitzgerald
4bca60861e Specialize GenericInstruction 2019-03-28 05:45:46 -06:00
Greg Fitzgerald
df333e8b6e Move new_move_many to SystemInstruction 2019-03-26 09:22:29 -07:00
Greg Fitzgerald
acedf4ca5a Move Instruction into its own module 2019-03-23 20:31:55 -07:00