874 Commits

Author SHA1 Message Date
Greg Fitzgerald
2fbdec59cb Generalize access to staked nodes 2019-02-25 08:49:43 -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
Greg Fitzgerald
5541eedcc4 Reject modifications to userdata if not owned by the program 2019-02-22 16:18:10 -07:00
Greg Fitzgerald
f0f55af35b Add scheduler config to genesis
Anything that affects how the ledger is interpreted needs to be
in the genesis block or someplace on the ledger before later
parts of the ledger are interpreted. We currently don't have an
on-chain program for cluster parameters, so that leaves only
the genesis block option.
2019-02-21 17:29:55 -08:00
Stephen Akridge
f77788447c Debug for Account
Derive prints the full userdata vec which is questionably useful.
2019-02-21 14:57:32 -08:00
Carl
9e1c5e1ab0 switch vote program to use slot height instead of tick height, change confirmation computation to use slots 2019-02-21 15:31:53 -07:00
Greg Fitzgerald
94f9ac0332 DRY up GenesisBlock 2019-02-19 20:34:58 -08: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
Greg Fitzgerald
d357640fbf Centralize decentralized timing constants 2019-02-18 19:46:58 -08:00
Greg Fitzgerald
132c664e18 No longer modify external userdata 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
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
4e4a1643c4 Boot SystemInstruction::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
Greg Fitzgerald
48671a1728 Let native_loader own native executable accounts 2019-02-13 20:55:36 -08:00
Greg Fitzgerald
72b6ec4aa8 Add native program account constructor 2019-02-13 20:55:36 -08:00
Greg Fitzgerald
c178fc7249 Rewrite get_votes()
Panic if deserialize fails.
2019-02-13 10:05:28 -07:00
Greg Fitzgerald
41554f433b Fix VoteTransaction::get_votes() 2019-02-13 10:05:28 -07: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
d1945c29d7 Don't depend on solana_native_loader for IDs in the SDK 2019-02-07 08:23:44 -08:00
Greg Fitzgerald
549f9676f1 Allow validators to accumulate credits for voting 2019-02-05 14:24:49 -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
9c07a8c26a VoteProgram -> VoteState 2019-02-01 16:03: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
Greg Fitzgerald
85e7046caf Use signer for signing transactions, not constructing them 2019-01-29 18:35:05 -07:00
Greg Fitzgerald
c741a960b9 Generalize Transaction::new to accept anything that implements KeypairUtil 2019-01-29 18:35:05 -07:00
Greg Fitzgerald
33f921235d Improve message-signing ergonomics 2019-01-26 14:57:22 -07:00
Sathish
e0f046b7a5
Optimize Transaction/Instruction serialization with custom routine (#2515)
* Optimize transaction serialization with custom routine to reduce the serialized size.

* Update serialized_size to accept self as parameter

* Optimize serialize / deserialize operations
2019-01-24 21:14:15 -08:00
Greg Fitzgerald
d666ebc558 Add tests for vote_program 2019-01-21 18:05:52 -07:00
Stephen Akridge
abbb037888 Implement storage contract logic 2019-01-21 08:36:49 -08: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
Mark
72c7139d8c
Allow chained BudgetExpr via indirection (#2461)
* Allow chained BudgetExpr via indirection

Change `And`, `Or`, and `After` expressions to contain
`Box<BudgetExpr>`s instead of directly holding payments

* run cargo fmt
2019-01-16 18:51:50 -06:00
Tyera Eulberg
fec47a09a9 Add test from drone business logic; remove flaky, mis-placed integration test 2019-01-15 12:53:09 -07:00
Greg Fitzgerald
37cb218437 Drop the serialization length 2019-01-10 17:05:03 -08:00
Greg Fitzgerald
4f79a8a204 Use serialized_size - less fragile 2019-01-10 17:05:03 -08:00
jackcmay
0f8ea6872e
Add missing error counters and load_account test cases (#2327) 2019-01-08 09:20:25 -08:00
Pankaj Garg
91bd38504e
Use vote signer service in fullnode (#2009)
* Use vote signer service in fullnode

* Use native types for signature and pubkey, and address other review comments

* Start local vote signer if a remote service address is not provided

* Rebased to master

* Fixes after rebase
2019-01-05 12:57:52 -08:00
jackcmay
3f60d98163
Update comments (#2310) 2019-01-04 19:19:56 -08:00
Michael Vines
58f2598d5d Revert "Validators make a transaction to advertise their storage last_id"
This reverts commit a1759aed1964eee328c6d7ae126e2adb4d501ee2.
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
fd562cb9e2 Rust 2018 cleanup 2018-12-14 21:57:15 -08:00
Michael Vines
aaa5cd4615 Remove stray keygen 2018-12-14 21:57:15 -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
282d4a3563 Move solana-keygen into keygen/ 2018-12-13 01:06:40 -08:00
Michael Vines
cafeef33c3 Relocate all keypair generation into one location: sdk/src/signature.rs 2018-12-13 01:06:40 -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
214ed3667c Move system_transaction out of src/ 2018-12-05 10:49:06 -08:00
Michael Vines
122627dda2 Move loader_transaction out of src/ 2018-12-05 10:49:06 -08:00