db899a2813
Inline LeaderSchedule::new_from_bank()
...
Breaks circular dependency and offers more flexibility in bank's
usage.
2019-02-25 08:49:43 -08:00
aad0d90fdd
Use epoch_height to generate schedule instead of last_id
...
I had suggested the last_id, but that puts an unnecessary dependency
on LastIdsQueue. Using epoch height is pretty interesting in that
given the same set of stakers, you simply increment the seed once
per epoch.
Also, tighten up the LeaderSchedule code.
2019-02-25 08:49:43 -08:00
72b4834446
Add Bank::prev_slot_leader() and Bank::next_slot_leader()
2019-02-25 08:49:43 -08:00
ec48c58df1
Award tx fees to validators in new leader schedule
...
Also, generalize the leader_schedule functions a bit to allow for
prev_slot_leader and next_slot_leader, should they be needed.
2019-02-25 08:49:43 -08:00
0947ec59c9
Expose the new leader schedule functionality from the bank.
2019-02-25 08:49:43 -08:00
ba7d121724
Switch to Bank::staked_nodes(); want node_id, not staker_id
...
Also, update LeaderScheduler's code to use node_id as well.
Unfortuntely, no unit tests for this, because there's currently
only one way to set staker_id/node_id, and they are both set
to the same value.
2019-02-24 07:52:44 -07:00
a1070e9572
Split ActiveStakers over Bank and LeaderScheduler
2019-02-24 07:52:44 -07:00
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
11c7aab023
Add some unit-tests
2019-02-22 16:18:10 -07:00
5541eedcc4
Reject modifications to userdata if not owned by the program
2019-02-22 16:18:10 -07:00
c07b6c30a1
Remove special casing of ProgramError in blocktree processor
...
- Also refactor bank.rs and add unit tests
2019-02-22 12:13:05 -08:00
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
3e8d96a95b
fix failing tests
2019-02-21 16:35:23 -08:00
9713a3ac02
fix clippy warnings
2019-02-21 16:35:23 -08:00
5c9777970d
moved fee collection code to runtime
2019-02-21 16:35:23 -08:00
c142a82ae0
Charge transaction fee even in case of ProgramError
2019-02-21 16:35:23 -08:00
f76ac94d70
Remove leader_schedule_offset public method
...
Also,
* Rename the private variable to include units.
* Better doc
2019-02-21 12:28:11 -08:00
32caa55d67
Offer a way to get the leader_schedule from any Bank instance
2019-02-21 12:28:11 -08:00
f6ff33db8e
* add merge_parents(), which means 'eat your parent' ( #2851 )
...
* add is_root(), which is false if the bank has a parent
* use is_root() for store_slow and store_accounts to decide whether to purge on zero balance
2019-02-21 12:08:50 -08:00
40977fa99f
More forward-looking test
2019-02-21 10:54:25 -07:00
f4df8ff5b3
Add slot_height() and epoch_height() methods to Bank
2019-02-21 10:54:25 -07:00
13d018e3e1
Fix stake selection for the Data Plane ( #2863 )
...
* Update data-plane to use stakes instead of a bank directly
* Rename get_stakes to staked_nodes
2019-02-20 21:38:16 -08:00
3c62e2332e
Cleanup stakes for gossip ( #2860 )
2019-02-20 20:02:47 -08:00
b8f6280fe5
Move hash_internal_state tests into runtime
...
This was intended as a Bank test, but only in blocktree_processor
because of its dependency on Entry, which solana_runtime doesn't
know about.
2019-02-20 16:13:26 -08:00
822bebea46
Allow multiple forks without regenerating the hash
2019-02-20 16:13:26 -08:00
582a7192ec
Hold Bank's own parent hash instead of the parent's
2019-02-20 16:13:26 -08:00
9848de6cda
Remove special case in Bank::deposit()
...
And use it to process the genesis block.
2019-02-20 08:12:37 -07:00
a33921ed34
address review comments
2019-02-20 08:12:37 -07:00
2e75ff27ac
Fix test
2019-02-20 08:12:37 -07:00
a27cdf55e7
Credit transaction fees to the slot leader
2019-02-20 08:12:37 -07:00
dda0a1f39b
Move storage tests out of Bank
2019-02-19 17:26:33 -07:00
04f54655c2
Minor cleanup
2019-02-19 15:53:31 -08:00
dc5590f2bf
unuse std ( #2833 )
2019-02-19 15:27:07 -08:00
64dcc31ac7
Migrate Rewards test from runtime to Bank
2019-02-19 10:59:06 -07:00
36546b4c4c
Expose a Bank API for adding native programs
...
Also use it to tighten up the code to add the builtin programs.
2019-02-19 10:20:27 -07:00
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
cdb2a7bef3
Move runtime benchmark
2019-02-07 09:46:06 -08:00
5128d7d6c3
Move runtime.rs into its own crate
2019-02-07 09:46:06 -08:00