Commit Graph

510 Commits

Author SHA1 Message Date
Greg Fitzgerald ce6257a069 Delete misplaced unit-tests
These tests were from back in the day when Bank(then-called Accountant)
would call `verify_plan()` on all transactions. Nowadays `verify_plan`
is only useful to the client. At can be used to ensure a transaction
won't trigger runtime errors.
2019-03-18 08:22:54 -07:00
Greg Fitzgerald 7b28d3a231 Move Budget's verify_plan() into tests
This functionality is supposed to be the the interpreter
2019-03-18 08:22:54 -07:00
Greg Fitzgerald ea01ff2aab Add pubkey to BudgetExpr::new_cancelable_future_payment for wallet 2019-03-18 08:22:54 -07:00
Greg Fitzgerald 3369019943 Add BudgetExpr::new_cancelable_authorized_payment 2019-03-18 08:22:54 -07:00
Greg Fitzgerald dbd4176b97 Move script constructors into a separate module 2019-03-18 08:22:54 -07:00
Greg Fitzgerald 122c7bc2ef Rename TransactionCompiler to Script and use it to replace the type alias 2019-03-18 08:22:54 -07:00
Greg Fitzgerald 99671472d1 Migrate config tests to Bank 2019-03-18 08:22:54 -07:00
Greg Fitzgerald 0c0716abfb Move Bank-based tests into unit-tests 2019-03-18 08:22:54 -07:00
Greg Fitzgerald c09accb685 Rename StaticEntrypoint to ProcessInstruction 2019-03-18 08:22:54 -07:00
Greg Fitzgerald ae4d14a2ad Introducing Scripts
A sequence of instructions. A client compiles the script and then uses
the compiled script to construction a transaction. Then it adds a
adds a blockhash, signs the transaction, and sends it off for
processing.
2019-03-18 08:22:54 -07:00
Greg Fitzgerald 55cdbedb52 Allow tests to add instruction processors
Make runtime a private module again.
2019-03-18 08:22:54 -07:00
Greg Fitzgerald ee39f31d81 Add Runtime object. Allow any number of static loaders. 2019-03-18 08:22:54 -07:00
Greg Fitzgerald 70b45de012 Get access to runtime errors in Budget unit-tests 2019-03-18 08:22:54 -07:00
Michael Vines 5f58e9cd6e Config program - useful for storing/updating simple config items on chain 2019-03-15 16:39:45 -07:00
Greg Fitzgerald 24d9138067 Abandon Builder pattern 2019-03-15 14:46:44 -06:00
Greg Fitzgerald aca739b800 Boot fees from TransactionBuilder 2019-03-15 14:46:44 -06:00
Greg Fitzgerald e091aa87ea More precise constructor names 2019-03-15 14:46:44 -06:00
Greg Fitzgerald 968022a1b0 Instruction name swap
* Instruction -> GenericInstruction
* Instruction<u8, u8> -> CompiledInstruction
* Instruction<Pubkey, (Pubkey, bool)> -> Instruction
2019-03-15 14:46:44 -06:00
Greg Fitzgerald 8306c1841c Fix build 2019-03-15 09:06:54 -06:00
Greg Fitzgerald 4d53be8350 Make it unappealing to build and sign transactions at the same time
Use a client to sign transactions. It'll need that keypair anyway
to resign new blockhashes on retries.
2019-03-15 09:06:54 -06:00
Greg Fitzgerald c1eec0290e
Rename userdata to data (#3282)
* Rename userdata to data

Instead of saying "userdata", which is ambiguous and imprecise,
say "instruction data" or "account data".

Also, add `ProgramError::InvalidInstructionData`

Fixes #2761
2019-03-14 10:48:27 -06:00
Greg Fitzgerald e58220282a Move TransactionError into the SDK 2019-03-13 21:26:57 -06:00
Greg Fitzgerald 4ca4038d54 Rename BankError to TransactionError 2019-03-13 21:26:57 -06:00
Greg Fitzgerald c14cce4c85 Add InstructionError for runtime instruction errors 2019-03-13 21:26:57 -06:00
Sagar Dhawan c1e726da87 Remove comment 2019-03-12 15:32:41 -07:00
Sagar Dhawan 7d7528eb18 Fix test_bank_storage 2019-03-12 15:32:41 -07:00
Michael Vines 1ee43a7633 Remove non-essential programs from runtime/ 2019-03-12 15:11:59 -05:00
Michael Vines 3d2b7dd1ef Move programs/system into runtime/ 2019-03-12 11:30:58 -05:00
Michael Vines 6899bd7099
0.13.0 2019-03-11 16:21:19 -07:00
Tyera Eulberg fe1676bc3a Review comments 2019-03-11 16:58:43 -06:00
Tyera Eulberg 1a9ef37251 Update programs using simple error mapping to use CustomError 2019-03-11 16:58:43 -06:00
Rob Walker 195a880576
pass Pubkeys as refs, copy only where values needed (#3213)
* pass Pubkeys as refs, copy only where values needed

* Pubkey is pervasive

* fixup
2019-03-09 19:28:43 -08:00
Rob Walker 0acdbc0d03 plumb staking_account and voting_keypair from multinode-demo to Vote (#3199)
* plumb staking_account and voting_keypair from bash to Vote
2019-03-08 19:29:08 -07:00
Greg Fitzgerald 7a4ccc8719 Fix Budget's payment_with_fee test
Fee is now independent of the contract.
2019-03-07 19:18:53 -07:00
Greg Fitzgerald 3dc22e7323 Simulate auto-creation of system accounts 2019-03-07 19:18:53 -07:00
Greg Fitzgerald 17dcd1f62a Resurrect the tests 2019-03-07 19:18:53 -07:00
Greg Fitzgerald a277f3e816 Migrate to TransactionBuilder
This code wasn't updated after we started batching instructions.
The current code does allocations instead of using CreateAccount.
The runtime shouldn't allow that, so getting this code out of the
way before we lock down the runtime.
2019-03-07 19:18:53 -07:00
Greg Fitzgerald 10b16753af Remove 'new' constructor 2019-03-07 19:18:53 -07:00
Greg Fitzgerald 4d58bf4b28 Don't use solana_entrypoint in static libraries 2019-03-07 12:42:13 -07:00
Greg Fitzgerald 505f77b108 Move a more generic process_transaction to runtime.rs 2019-03-07 12:42:13 -07:00
Greg Fitzgerald 5b672f8921 Generalize Budget tests to work on multi-ix txs 2019-03-07 12:42:13 -07:00
Greg Fitzgerald 97f2c96a7e Add a transaction and instruction 2019-03-06 15:04:15 -07:00
Greg Fitzgerald 5979627258 Add authorized voter 2019-03-06 15:04:15 -07:00
Michael Vines 9491999a95 Remove remaining erc20 references 2019-03-05 17:56:44 -08:00
Michael Vines e2d30db7e1 Rename tokens to lamports 2019-03-05 17:56:44 -08:00
Michael Vines 3129e299e4 Rename tokens to lamports in programs/ 2019-03-05 17:56:44 -08:00
Michael Vines 53f09c44f3 Rename tokens to lamports in sdk/ 2019-03-05 17:28:06 -08:00
Greg Fitzgerald ca99ebaaf4 Add way to create account with delegate in 1 tx 2019-03-05 16:14:57 -07:00
Rob Walker b9e878ee80
slot_height considered harmful (#3135)
* slot_height considered harmful
* fix test_tick_slot_epoch_indexes
2019-03-05 14:18:29 -08:00
Tyera Eulberg 33c4c7e511 Split up long test 2019-03-05 15:16:51 -07:00
Tyera Eulberg b67ac22336 Replace superfluous integration tests with needed one 2019-03-05 15:16:51 -07:00
Tyera Eulberg 6ff2572ebe Refactor system entrypoint to use helper fns; add unit tests 2019-03-05 15:16:51 -07:00
Greg Fitzgerald 52fc974cdf The funder is not a staker 2019-03-05 12:46:18 -07:00
Tyera Eulberg f506b0a224 Fix test: Prevent SystemInstruction CreateAccount from overwriting accounts in use 2019-03-05 09:33:27 -07:00
Tyera Eulberg 202adb1bf1 Create failing test 2019-03-05 09:33:27 -07:00
Greg Fitzgerald 885eeec3ed Boot storage program from the SDK 2019-03-05 07:16:33 -07:00
Greg Fitzgerald 5e9f802d7d Boot token_program from the SDK 2019-03-05 07:16:33 -07:00
dependabot[bot] e4be57c3b6 Bump libc from 0.2.49 to 0.2.50
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.49 to 0.2.50.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.49...0.2.50)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-05 07:14:51 -07:00
Sagar Dhawan dc42c12f2b
Revert to more consistent naming (#3114) 2019-03-04 17:50:19 -08:00
Michael Vines 03d6c9a552 Defeature bpf_loader; bpf_{c,rust} features now confined to programs/bpf 2019-03-04 11:02:37 -08:00
Michael Vines d0be16b49a Remove duplicated code 2019-03-04 11:02:37 -08:00
Greg Fitzgerald 2ec9bc9f05 Revive payments via Budget 2019-03-03 17:29:13 -07:00
Greg Fitzgerald e8ae603a01 Add failing test for a Budget payment 2019-03-03 17:29:13 -07:00
Greg Fitzgerald 8ec10d4de9 Simplify Budget's serialize 2019-03-03 14:24:53 -08:00
Greg Fitzgerald baca3e6b6b Cleanup Budget
* BudgetProgram -> BudgetState
* Instruction -> BudgetInstruction
* Move BudgetState into its own module
* BudgetInstruction::NewBudget -> BudgetInstruction::InitializeAccount
* BudgetInstruction::new_budget -> BudgetInstruction::new_initialize_account
2019-03-03 14:49:35 -07:00
Greg Fitzgerald fc5fcd6cd4 Move native_loader into solana_runtime 2019-03-03 10:59:08 -07:00
Michael Vines 33496ffea2 Adjust paths 2019-03-02 22:11:48 -08:00
Michael Vines b8b7de5522 Script can now be run from any directory 2019-03-02 22:11:48 -08:00
Michael Vines 109101c2dc Cleanup features and fix build errors 2019-03-02 22:11:48 -08:00
Greg Fitzgerald 44322124c8 Update paths 2019-03-02 22:11:48 -08:00
Greg Fitzgerald 41b5899856 Move programs/Cargo.toml into bpf/ 2019-03-02 22:11:48 -08:00
Greg Fitzgerald b830449f23 Move top-level native program tests to their respective crates 2019-03-02 22:11:48 -08:00
Greg Fitzgerald 037fcf6b3d Bump all native programs up a level
Don't categorize programs by a single backend.
2019-03-02 22:11:48 -08:00
Greg Fitzgerald 3f4ff3f7b5 Delete duplicate file 2019-03-02 18:57:11 -07:00
Greg Fitzgerald 9c3e7e40cf Less pub 2019-03-02 17:36:51 -08:00
Greg Fitzgerald 1edf6c361e
Move Vote program out of the SDK 2019-03-02 16:44:36 -08:00
Greg Fitzgerald e6486b2824
Move Budget out of the SDK 2019-03-02 16:44:36 -08:00
Michael Vines a94880574b block_hash => blockhash 2019-03-02 12:13:30 -07:00
Michael Vines 0f1582c196 cargo fmt 2019-03-02 12:13:30 -07:00
Michael Vines 258cf21416 Purge remaining last_id (now called block_hash) 2019-03-02 12:13:30 -07:00
Michael Vines 2bfad87a5f Rename Bank.last_id() to Bank.last_block_hash() 2019-03-02 12:13:30 -07:00
Michael Vines 81cd461591 Rename storage_last_id to storage_block_hash 2019-03-02 12:13:30 -07:00
Michael Vines ea110efabd Rename AdvertiseStorageLastId to AdvertiseStorageRecentBlockHash 2019-03-02 12:13:30 -07:00
Michael Vines 176d5e0d37 Rename Transaction last_id field to recent_block_hash 2019-03-02 12:13:30 -07:00
Michael Vines 5f5d779ee1 Move src/ into core/src. Top-level crate is now called solana-workspace 2019-03-02 09:52:18 -08:00
Greg Fitzgerald 7b849b042c Split rewards_program.rs 2019-03-02 10:11:37 -07:00
Michael Vines fcbcf000c4 Use a valid last_id 2019-03-02 08:47:31 -08:00
Greg Fitzgerald 986c54de58 Comment out test that's not actually testing anything
@sakridge, fyi
2019-03-02 07:50:32 -07:00
Greg Fitzgerald 49b7e67585 Return program error from process_transaction()
Our unit-test helper `process_transaction()` wasn't returning
program errors, which made testing programs tedious and
counter-intuitive.
2019-03-02 07:50:32 -07:00
Greg Fitzgerald db825b6e26 Fix vote program bugs
Also:

* Add an assertion to the transaction builder if not enough
keypairs were provided for all keys that require signatures.
* Expose bugs in the runtime.
2019-03-02 07:50:32 -07:00
dependabot[bot] 269a82f796 Bump serde_derive from 1.0.88 to 1.0.89
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.88 to 1.0.89.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.88...v1.0.89)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-01 20:15:49 -07:00
dependabot[bot] 771a88665c Bump serde from 1.0.88 to 1.0.89
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.88 to 1.0.89.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.88...v1.0.89)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-01 15:51:11 -07:00
Greg Fitzgerald c53c351759 Rename erc20 to token-program
Everything it uses already had that name, just the crate was never
renamed.
2019-03-01 10:47:38 -07:00
Jack May b9524217fe
Update rust example to use BPF enabled infrastructure (#2974) 2019-02-28 22:05:11 -08:00
Sagar Dhawan 20e4edec61
Refactor Vote Program Account setup (#2992) 2019-02-28 17:08:45 -08:00
Greg Fitzgerald 485ccd20e4 Use TransactionBuilder in the Rewards transaction 2019-02-28 10:53:26 -08:00
Michael Vines 0dc5af62ff Standardize on 'use log::*' for easy access to all log level macros 2019-02-27 21:16:23 -08:00
carllin 033a04129a Add lockouts to vote program (#2944)
* Add lockouts to vote program

* Rename MAX_VOTE_HISTORY TO MAX_LOCKOUT_HISTORY, change process_vote() to only pop votes after MAX_LOCKOUT_HISTORY + 1 votes have arrived

* Correctly calculate serialized size of an Option, rename root_block to root_slot
2019-02-26 22:19:31 -07:00
Jack May 0174945853
Program tests now check signature status (#2965) 2019-02-26 17:09:57 -08:00
Jack May 78841532f7
Add Rust helpers (#2959) 2019-02-26 15:17:38 -08:00
Jack May ba5077701d
Avoid possible simplified lowering of passed struct (#2938) 2019-02-25 17:05:59 -08:00
Jack May 2be7896157
Pull in latest rBPF that includes Rust dependent changes (#2929) 2019-02-25 12:42:48 -08:00
Jack May 35aefdf1db
Reduce test noise (#2907) 2019-02-22 16:27:19 -08:00
Stephen Akridge 66891d9d4e Don't use global storage account
Other accounts would not be able to modify the system accounts userdata.
2019-02-22 15:59:55 -08:00
dependabot[bot] 6bca577d6d Bump libc from 0.2.48 to 0.2.49
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.48 to 0.2.49.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-22 16:45:14 -07:00
Greg Fitzgerald f5400ccefc Ignore storage test
@sakridge is working on a fix.
2019-02-22 16:18:10 -07:00
Greg Fitzgerald a56d717ea8 Add a check that shows why the storage program is failing 2019-02-22 16:18:10 -07:00
Jack May b69475937f
Program tests depend on native/noop (#2873) 2019-02-21 12:22:55 -08:00
Greg Fitzgerald dda0a1f39b Move storage tests out of Bank 2019-02-19 17:26:33 -07:00
Greg Fitzgerald b9bb92099e Go object-oriented
Easy to imagine a trait here that's implemented using a Bank or
a testnet.
2019-02-19 10:59:06 -07:00
Greg Fitzgerald 64dcc31ac7 Migrate Rewards test from runtime to Bank 2019-02-19 10:59:06 -07:00
Greg Fitzgerald dde886f058 Move Bank to its own crate
Also:
* counters.rs to solana_metrics
* genesis_block.rs to solana_sdk
2019-02-19 07:17:04 -07:00
dependabot[bot] e42c95a327 Bump bincode from 1.1.1 to 1.1.2
Bumps [bincode](https://github.com/TyOverby/bincode) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/TyOverby/bincode/releases)
- [Commits](https://github.com/TyOverby/bincode/compare/v1.1.1...v1.1.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-16 13:58:37 -07:00
dependabot[bot] 38aed0c886 Bump serde_derive from 1.0.87 to 1.0.88
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.87 to 1.0.88.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.87...v1.0.88)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-16 04:57:32 -08:00
dependabot[bot] 02801b3e75 Bump serde from 1.0.87 to 1.0.88
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.87 to 1.0.88.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.87...v1.0.88)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-16 05:02:10 -07:00
Greg Fitzgerald 132c664e18 No longer modify external userdata 2019-02-15 18:36:55 -07:00
Greg Fitzgerald 288645aeb7 Add rewards integration test 2019-02-15 18:36:55 -07:00
Greg Fitzgerald 55f06f5bad Make vote_program available to reward_program tests
Making `solana_vote_program` is not an option because
then vote_program's entrypoint conflicts with reward_program's
entrypoint.

This unfortunately turns the SDK into a dumping ground for all
things shared between vote_program and other programs. Better
would be to create a solana-vote-api crate similar to the
solana-rewards-api crate.
2019-02-15 18:36:55 -07:00
Greg Fitzgerald a2cb18bfe9 Only require voting account to be signed 2019-02-15 18:36:55 -07:00
Greg Fitzgerald d35b3754a2 Reorg
Now clients can use all the libraries to create transactions
and disect account data without needing to be constrained about
what can be compiled into a shared object or BPF.

Likewise, program development can move forward without being
concerned with bloating the shared object.
2019-02-15 18:36:55 -07:00
Greg Fitzgerald 7f3aca15dd Add a library for creating Rewards transactions
And move out of the SDK
2019-02-15 18:36:55 -07:00
Greg Fitzgerald 2c5cbaff25 Add unit-test for Rewards program 2019-02-15 18:36:55 -07:00
Greg Fitzgerald 134cd7ab04 Add Rewards program 2019-02-15 18:36:55 -07:00
Greg Fitzgerald 4e4a1643c4 Boot SystemInstruction::Spawn 2019-02-14 13:26:46 -07:00
Greg Fitzgerald e1e84d4465 Don't reassign owner in Spawn 2019-02-14 13:26:46 -07:00
Greg Fitzgerald 4a0009365e Use Account::owner as loader for executable accounts 2019-02-14 13:26:46 -07:00
dependabot[bot] 3849b8ece4 Bump bincode from 1.0.1 to 1.1.1 (#2709)
* Bump bincode from 1.0.1 to 1.1.1

Bumps [bincode](https://github.com/TyOverby/bincode) from 1.0.1 to 1.1.1.
- [Release notes](https://github.com/TyOverby/bincode/releases)
- [Commits](https://github.com/TyOverby/bincode/commits)

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

* update autocfg 0.1.1 => 0.1.2
2019-02-14 12:46:22 -06:00
Michael Vines da5b777ee7 Purge Default::default() 2019-02-09 10:12:32 -08:00
Tyera Eulberg 3c6af52a71
Fix pay-to-self Accounts bug (#2682)
* Add failing tests

* Fix tests

* Plumb AccountLoadedTwice error

* Fixup budget cancel actions to not depend on duplicate accounts

* Use has_duplicates

* Update budget-based golden
2019-02-07 12:14:10 -07:00
Greg Fitzgerald 731e5e1291 Boot lua loader
Good fun, but unnecessary and I haven't been updating the rlua
dependency. If someone wants this, it can be developed outside
the solana repo.
2019-02-07 10:25:11 -07:00
Greg Fitzgerald d1945c29d7 Don't depend on solana_native_loader for IDs in the SDK 2019-02-07 08:23:44 -08:00
Jack May 5f565c92c9
cargo incremental builds breaks Rust BPF, locally disable it (#2674) 2019-02-06 13:59:10 -08:00
Greg Fitzgerald 549f9676f1 Allow validators to accumulate credits for voting 2019-02-05 14:24:49 -07:00
dependabot[bot] 85333c5d62 Bump serde_derive from 1.0.85 to 1.0.87
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.85 to 1.0.87.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.85...v1.0.87)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-04 17:07:01 -07:00
dependabot[bot] 32f19c5c19 Bump serde from 1.0.85 to 1.0.87
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.85 to 1.0.87.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.85...v1.0.87)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-04 09:08:09 -07:00
Greg Fitzgerald 511d8275d6 Document current vote program semantics
And add a new 'staker_id' VoteState member variable to offer a path to
work our way out.  Update leader scheduler to use staker_id, but
continue setting it to 'from_id' for the moment.

No functional changes here.
2019-02-01 16:03:46 -08:00
Greg Fitzgerald 0a9226ec8e Use voting helper 2019-02-01 16:03:46 -08:00
Greg Fitzgerald 9c07a8c26a VoteProgram -> VoteState 2019-02-01 16:03:46 -08:00
Greg Fitzgerald 6058bfb687 Simplify voting helpers 2019-02-01 16:03:46 -08:00
Michael Vines d62c9ac309 Create program/ crate avoid / crate dependency on bpfloader
The bpfloader crate was triggering cargo to perform excessive rebuilds
of in-workspace dependencies.  Unclear why exactly, but seems related to
the special dual crate-type employed by bpfloader.
2019-02-01 12:42:46 -08:00
Greg Fitzgerald dad0bfe447 Replace transaction traits with structs
Also:
* SystemTransaction::new -> new_account
* SystemTransaction::new_create -> new_program_account
2019-02-01 11:38:25 -08:00
Michael Vines bfaf5634a1 .unwrap() in tests instead of assert!()ing .is_ok() for a better failure message 2019-01-28 16:10:32 -08:00
Jack May 9abc500269
Fix BPF C tests and run as part of CI (#2540) 2019-01-24 12:15:37 -08:00
dependabot[bot] a7503050c2 Bump libc from 0.2.47 to 0.2.48
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.47 to 0.2.48.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.47...0.2.48)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-23 18:22:05 -08:00
Jack May a0bc8b8af3
BPF programs can support up to 5 arguments (#2528) 2019-01-23 09:55:08 -08:00
dependabot[bot] b1109b813e Bump byteorder from 1.3.0 to 1.3.1
Bumps [byteorder](https://github.com/BurntSushi/byteorder) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/BurntSushi/byteorder/releases)
- [Changelog](https://github.com/BurntSushi/byteorder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/byteorder/compare/1.3.0...1.3.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-22 09:58:48 -08:00
Greg Fitzgerald d666ebc558 Add tests for vote_program 2019-01-21 18:05:52 -07:00
dependabot[bot] b0149a54d8 Bump serde_derive from 1.0.84 to 1.0.85
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.84 to 1.0.85.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.84...v1.0.85)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-21 11:25:42 -07:00
Stephen Akridge abbb037888 Implement storage contract logic 2019-01-21 08:36:49 -08:00
dependabot[bot] 200d5e62c2 Bump byteorder from 1.2.7 to 1.3.0
Bumps [byteorder](https://github.com/BurntSushi/byteorder) from 1.2.7 to 1.3.0.
- [Release notes](https://github.com/BurntSushi/byteorder/releases)
- [Changelog](https://github.com/BurntSushi/byteorder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/byteorder/compare/1.2.7...1.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-21 09:07:17 -07:00
dependabot[bot] b748942d6a Bump serde from 1.0.84 to 1.0.85
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.84 to 1.0.85.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.84...v1.0.85)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-21 08:25:24 -07:00
Stephen Akridge 1fd7bd7ede Storage fixes
* replicators generate their sample values
* fixes to replicator block height logic
2019-01-18 13:05:35 -08:00
dependabot[bot] e9116736cd Bump libc from 0.2.46 to 0.2.47
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.46 to 0.2.47.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.46...0.2.47)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-15 08:56:16 -07:00
Jak May b2afd1ea0b
Bump rbpf to 0.1.9 (#2422) 2019-01-15 00:42:30 -08:00
Jack May a6773ad442 Specify entrypoint when building rust programs 2019-01-14 20:13:01 -08:00
Jak May e9a0b3a8f3
Add BPF-to-BPF and PC relative call tests (#2395) 2019-01-11 19:33:08 -08:00
Jak May 23c43ed21b
Multi-file BPF C builds (#2393) 2019-01-11 15:33:21 -08:00
jackcmay 56b6ed6730
Rerun build if any file in a directory has changed (#2343) 2019-01-09 09:56:23 -08:00
Greg Fitzgerald 30b662df39 Remove clones in native programs 2019-01-04 13:38:03 -07:00
dependabot[bot] c4259fc8cc Bump libc from 0.2.45 to 0.2.46
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.45 to 0.2.46.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.45...0.2.46)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-03 09:13:03 -07:00
dependabot[bot] 8c5614daa1 Bump serde_derive from 1.0.82 to 1.0.84
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.82 to 1.0.84.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.82...v1.0.84)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-02 15:54:13 -08:00
dependabot[bot] eb668c6466 Bump serde from 1.0.82 to 1.0.84
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.82 to 1.0.84.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.82...v1.0.84)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-01-02 16:42:35 -07:00
jackcmay a461c5682d
First stab at Rust BPF (#2269)
First stab at Rust BPF
2019-01-02 15:12:42 -08:00
Michael Vines 58f2598d5d Revert "Validators make a transaction to advertise their storage last_id"
This reverts commit a1759aed19.
2018-12-23 14:02:09 -08:00
Stephen Akridge a1759aed19 Validators make a transaction to advertise their storage last_id
* Also implement more storage contract logic
* Add transactions for proof validation,
* Move storage state members into system storage account userdata
2018-12-21 15:45:30 -08:00
Michael Vines 0e567381fb
v0.12.0 2018-12-19 17:03:28 -08:00
Michael Vines fc56e1e517 Correct crate-type to match other native programs 2018-12-17 15:17:13 -08:00
Michael Vines 0f4837980f Switch noop from println to solana_logger 2018-12-17 14:56:12 -08:00
Michael Vines fd562cb9e2 Rust 2018 cleanup 2018-12-14 21:57:15 -08:00
Michael Vines 6ac466c0a4 Move src/logger.rs into logger/ crate to unify logging across the workspace 2018-12-14 13:10:43 -08:00
Michael Vines 60f3aeb4ef clippy fix 2018-12-13 23:40:26 -08:00
Michael Vines 092edabd2d Add homepage field to all crates 2018-12-13 22:25:27 -08:00
Stephen Akridge 7cdbbfa88e Storage stage updates
* Remove logging init from storage program: saw a crash in a test
  indicating the logger being init'ed twice.
* Add entry_height mining proof to indicate which segment the result is
  for
* Add an interface to get storage miner pubkeys for a given entry_height
* Add an interface to get the current storage mining entry_height
* Set the tvu socket to 0.0.0.0:0 in replicator to stop getting entries
  after the desired ledger segment is downloaded.
* Use signature of PoH height to determine which block to download for
  replicator.
2018-12-13 11:30:12 -08:00
Michael Vines 59a094cb77 Ensure bpf_c files exist to avoid accidental rebuilds as the tree changes 2018-12-12 17:30:41 -08:00
jackcmay cefbb7c27d
Fix shared object relcations with multiple static arrays (#2121) 2018-12-12 08:41:45 -08:00
Pankaj Garg 9243bc58db
Metrics for window repair (#2106)
* Metrics for window repair

- Also increase max repair length

* fix vote counters, and add repair window graph

* update per node graphs

* revert max repair length change
2018-12-11 15:43:41 -08:00
jackcmay 935524f20c
Fix eh frame relocation (#2109)
* Exclude .eh_frame
2018-12-11 12:14:41 -08:00
jackcmay 5847961fec
Fix BPF loader messages (#2098) 2018-12-11 11:20:26 -08:00
dependabot[bot] 40d7f5eff8 Bump libc from 0.2.44 to 0.2.45
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.44 to 0.2.45.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.44...0.2.45)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-11 11:52:27 -07:00
jackcmay e3dfd7b1ab
Allow BPF structure passing and returning (#2100)
* Add BPF struct passing and returning tests
2018-12-11 09:03:37 -08:00
dependabot[bot] 166945a461 Bump serde from 1.0.81 to 1.0.82
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.81 to 1.0.82.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.81...v1.0.82)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-11 08:53:20 -08:00
dependabot[bot] 46866be21d Bump serde_derive from 1.0.81 to 1.0.82
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.81 to 1.0.82.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.81...v1.0.82)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-11 09:21:11 -07:00
Michael Vines d7032aeb43 Add vote instruction debug log 2018-12-10 13:24:14 -08:00
Jack May 337c2bfd29 Fix spelling 2018-12-10 09:31:17 -08:00
dependabot[bot] 67f8916aa8 Bump serde from 1.0.80 to 1.0.81
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.80 to 1.0.81.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.80...v1.0.81)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-10 08:38:52 -08:00
dependabot[bot] 1e755f261f Bump serde_derive from 1.0.80 to 1.0.81
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.80 to 1.0.81.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.80...v1.0.81)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-10 08:56:45 -07:00
Michael Vines f5569e76db Relocate native programs to deps/ subdirectory of the current executable
This layout is `cargo build` compatible, no post-build file moves
required.
2018-12-08 16:31:01 -08:00
Michael Vines 73b9ee9e84 Add solana_ prefix to native_loader program
This allows its logging to show up in the default RUST_LOG=solana=info
log setting
2018-12-08 11:04:45 -08:00
Greg Fitzgerald 0a83b17cdd
Upgrade to Rust 1.31.0 (#2052)
* Upgrade to Rust 1.31.0
* Upgrade nightly
* Fix all clippy warnings
* Revert relaxed version check and update
2018-12-07 20:01:28 -07:00
Michael Vines 632425c7d7 Move native_loader under programs/native/ 2018-12-05 14:32:42 -08:00
Michael Vines 59e6bd115e system_program must be a static lib as it allocates Account memory 2018-12-05 10:49:06 -08:00
Michael Vines 6e9b8e21ae Drop new-style Result return to avoid error-type wrangling
Plus a backtrace at the point of failure is always nice
2018-12-05 10:49:06 -08:00
Michael Vines affa76f81d Initialize logger 2018-12-05 10:49:06 -08:00
Michael Vines 9ee858a00c Move budget_program out of src/ 2018-12-05 10:49:06 -08:00
Michael Vines 27d456bf93 Move storage_program out of src/ 2018-12-05 10:49:06 -08:00
Michael Vines ea6e042a6f Move vote_program out of src/ 2018-12-05 10:49:06 -08:00
Michael Vines 9a4f8199d6 Move system_program out of src/ 2018-12-05 10:49:06 -08:00
Michael Vines ae0be1e857 Remove bpf_loader.rs 2018-12-05 10:49:06 -08:00
Michael Vines d010cac8a5 Remove token_program.rs 2018-12-05 10:49:06 -08:00
jackcmay 0cb5ae41c6
Enable BPF shared objects (#2012)
* Switch to BPF ELF shared objects (.so)
2018-12-04 22:03:32 -08:00
Michael Vines e52f3f34a4 Autoinstall dependencies in the SDK itself 2018-12-01 10:47:59 -08:00
Michael Vines 7c3e6e8e86 Move bpf-sdk to sdk/bpf 2018-12-01 10:47:59 -08:00
jackcmay b00011a3f1
Use custom LLVM (#1971)
BPF SDK uses custom LLVM
2018-11-30 14:33:29 -08:00
Michael Vines bad0b55ab6 Expose which keys signed the Transaction in the SDK 2018-11-30 08:16:23 -08:00
jackcmay 0c091c1b24
Dockerized LLVM (#1914)
Optionally build with dockererized custom llvm
2018-11-28 14:41:53 -08:00
Michael Vines 83c0711760 Rename SolKeyedAccounts to SolKeyedAccount 2018-11-27 15:36:04 -08:00
Michael Vines ec0a56cb9c Tokens are unsigned 2018-11-27 10:14:37 -08:00
Michael Vines f0d24a68ee Configure -rpath to locate libcriterion 2018-11-26 21:16:42 -08:00
Michael Vines c7f678688d Stub out log functions when building tests 2018-11-26 15:41:49 -08:00
Michael Vines 7bf4c08f70 Add BPF C unittest framework 2018-11-26 12:25:29 -08:00
Michael Vines 826ac80e62 Avoid subverting bool return value 2018-11-26 09:11:40 -08:00
Michael Vines 4506584c48 Employ stdbool.h, add stub wchar.h 2018-11-26 09:11:40 -08:00
dependabot[bot] ca39486d06 Bump libc from 0.2.43 to 0.2.44
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.43 to 0.2.44.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.43...0.2.44)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-22 12:32:38 -07:00
jackcmay 59163e2dd9
Optimize some CI stuff (#1880)
* CI Optimizations
2018-11-21 12:16:16 -08:00
Michael Vines c1af48bd85 Rename program_id => owner 2018-11-18 16:24:13 -08:00
Michael Vines 3822c29415 Route program_id to program entrypoint 2018-11-17 19:42:03 -08:00
dependabot[bot] c6c8351fca Update env_logger requirement from 0.5.12 to 0.6.0
Updates the requirements on [env_logger](https://github.com/sebasmagri/env_logger) to permit the latest version.
- [Release notes](https://github.com/sebasmagri/env_logger/releases)
- [Commits](https://github.com/sebasmagri/env_logger/commits/v0.6.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-17 16:30:44 -08:00
Michael Vines 201a4b7b2a
Advance input pointer correctly 2018-11-17 10:30:21 -08:00
Jack May 96e03eca14 Remove unused dependency 2018-11-15 15:13:50 -08:00
Jack May 659dfbf51f cargo:rerun always triggers if file does not exist 2018-11-15 14:59:54 -08:00
jackcmay 39c87fd103
Add BPF benchmarks 2018-11-14 12:06:06 -08:00
Michael Vines 2ad2fdd235
Remove inline simple program to avoid maintenance burden 2018-11-14 10:39:22 -08:00
Michael Vines 1fda4b77ef Expose tick_height to bpf programs 2018-11-14 10:33:27 -08:00
Michael Vines 5a8938209b Expose tick_height to native programs 2018-11-14 10:33:27 -08:00
Michael Vines 0bf2ff6138 Add convenience macro for native program entrypoint 2018-11-14 10:33:27 -08:00
Jack May f99fae3c61 Use exact solana-rbpf version, not maintaining backward compatibility 2018-11-13 17:45:46 -08:00
Michael Vines 860dcdb449 Stubs for some libc headers 2018-11-13 17:44:46 -08:00
Michael Vines 70cebaf74a Add size_t/ssize_t/sol_memset/sol_strlen 2018-11-13 17:44:46 -08:00
Michael Vines 317fe19da7 Fix INC_DIRS usage 2018-11-13 17:44:46 -08:00
Michael Vines 522876c808 Rename Account.program_id to Account.owner 2018-11-12 10:59:01 -08:00
Michael Vines 49f4be6a2b codemod --extensions rs loader_program_id loader 2018-11-12 10:59:01 -08:00
Michael Vines e702515312 Add basic C++ support 2018-11-12 09:08:40 -08:00
Michael Vines def7d156f6 codemod --extensions sh '#!/usr/bin/env bash -e' '#!/usr/bin/env bash\nset -e' 2018-11-11 16:24:36 -08:00
Michael Vines 33aab094ef codemod --extensions sh '#!/bin/bash' '#!/usr/bin/env bash' 2018-11-11 16:24:36 -08:00
Rob Walker 3ccbf81646
Update README.md 2018-11-07 13:04:14 -08:00
Rob Walker 2e38cd98c0
Update README.md 2018-11-07 12:58:24 -08:00
jackcmay 1075a73902 Elf relocations (#1724)
Use relocatable BPF ELFs
2018-11-07 09:40:23 -08:00
Greg Fitzgerald c9138f964b Change token type from i64 to u64
Fixes #1526
2018-11-05 15:25:26 -07:00
Michael Vines ed09b2bdb8
Document BPF C program limitations 2018-11-04 12:31:38 -08:00
Michael Vines 40e945b0c8 Move token_program from src/ to programs/native/ 2018-11-02 18:13:02 -07:00
carllin 298bd6479a
Add first leader to genesis (#1681)
* Add first leader to genesis entries, consume in genesis.sh

* Set bootstrap leader in the bank on startup, remove instantiation of bootstrap leader from bin/fullnode

* Remove need to initialize bootstrap leader in leader_scheduler, now can be read from genesis entries

* Add separate interface new_with_leader() in mint for creating genesis leader entries
2018-11-02 14:32:05 -07:00
Michael Vines b8534a402d
shell 2018-11-01 15:25:27 -07:00
Michael Vines 45b9a7f8e9
shell 2018-11-01 14:40:21 -07:00
Michael Vines 6b777b066a Find clang 7 better
If LLVM_DIR is defined, use it to locate clang.  Otherwise use brew on
macOS, and assume clang-7 otherwise
2018-11-01 09:48:38 -07:00
Michael Vines 1e01088698 Improve clang install info for Linux 2018-11-01 09:48:38 -07:00
Michael Vines 3ea0651078 Rename sol_bpf.h to solana_sdk.h 2018-10-31 23:46:34 -07:00
Michael Vines 776b1c2294 sol_bpf.h improvements
- Define NULL
- Add sol_memcmp()
- Use sizeof() more
- Add SOL_ARRAY_SIZE
- Make sol_deserialize() more flexible
2018-10-31 23:46:34 -07:00
Michael Vines 5ecb9da801 Fix up bpf numeric types 2018-10-31 20:53:44 -07:00
jackcmay 38ee5c4dfb
Program may not exit (#1669)
Cap max executed instructions, report number of executed instructions
2018-10-31 10:59:56 -07:00
jackcmay aca2f9666d
Fix deps (#1672) 2018-10-31 10:12:17 -07:00