Commit Graph

94 Commits

Author SHA1 Message Date
Greg Fitzgerald
694add9919 Move budget-specific and system-specific tx constructors into traits
These functions pull in budget-specific and system-specific
dependencies that aren't needed by the runtime.
2018-09-26 14:17:15 -06:00
carllin
e7383a7e66 Validator to leader (#1303)
* Add check in window_service to exit in checks for leader rotation, and propagate that service exit up to fullnode

* Added logic to shutdown Tvu once ReplicateStage finishes

* Added test for successfully shutting down validator and starting up leader

* Add test for leader validator interaction

* fix streamer to check for exit signal before checking socket again to prevent busy leaders from never returning

* PR comments - Rewrite make_consecutive_blobs() function, revert genesis function change
2018-09-25 15:41:29 -07:00
Rob Walker
407b2682e8 remove dead code 2018-09-24 23:12:09 -07:00
Rob Walker
be31da3dce lastidnotfound step 2: (#1300)
lastidnotfound step 2:
  * move "record stage", aka poh_service into banking stage
  * remove Entry.has_more, is incompatible with leader rotation
  * rewrite entry_next_hash in terms of Poh
  * simplify and unify transaction hashing (no embedded nulls)
  * register_last_entry from banking stage, fixes #1171 (w00t!)
  * new PoH doesn't generate empty ledger entries, so some fixes necessary in 
         multinode tests that rely on that (e.g. giving validators airdrops)
  * make window repair less patient, if we've been waiting for an answer, 
          don't be shy about most recent blobs
   * delete recorder and record stage
   * make more verbost  thin_client error reporting
   * more tracing in window (sigh)
2018-09-21 21:01:13 -07:00
Anatoly Yakovenko
431692d9d0 Use a Drop trait to keep track of lifetimes for recycled objects.
* Move recycler instances to the point of allocation
* sinks no longer need to call `recycle`
* Remove the recycler arguments from all the apis that no longer need them
2018-09-19 16:59:42 -06:00
Carl
062f654fe0 formatted code 2018-09-19 10:48:05 -06:00
Carl
98b47d2540 Added check in broadcast stage to exit after transmitting last blob before leader rotation. Also added tests 2018-09-19 10:48:05 -06:00
Carl
f28ba3937b Added check in write stage to exit when scheduled entry_height for leader rotation is detected 2018-09-19 10:48:05 -06:00
anatoly yakovenko
6ec0e42220 budget as separate contract and system call contract (#1189)
* budget and system contracts and verification

* contract check_id methods
* system call contract
* verify contract execution rules
* move system into its own file
* allocate before transfer for budget
* store error in budget context
* budget contract and tests without bank
* moved budget of of bank
2018-09-17 13:36:31 -07:00
Michael Vines
4196cf43e8 cargo fmt 2018-09-14 16:37:49 -07:00
anatoly yakovenko
c34d911eaf Migrate Budget DSL to use the Account state (#979)
* Migrate Budget DSL to use the Account state instead of global bank data structures.

* Serialize Instruction into Transaction::userdata.
* Store the pending set in the Account::userdata
* Enforce the token balance rules on contract execution. This becomes the entry point for generic contracts.
* This pr will have a performance impact on the bank. The next set of changes will fix this by locking each account during multi threaded execution of all the contracts.
* With this change a contract transaction needs to store its state under an address. That address could be the destination of the tokens, or any random address. For the latter, an extra step would be needed to claim the tokens which isn't implemented by budget_dsl at the moment.
* test tracking issue 1157
2018-09-07 20:18:36 -07:00
Rob Walker
c44c5f0b09 take into account size of an Entry (#1116) 2018-09-05 05:07:58 +09:00
Greg Fitzgerald
2aa72cc72e Return a Vec from to_blobs() instead of using a mut parameter 2018-09-04 07:50:23 -10:00
Greg Fitzgerald
8cc030ef84 Use Vec instead of VecDeque for SharedBlobs 2018-09-04 07:50:23 -10:00
Greg Fitzgerald
3ab12076e8 Convert voting functions to methods
More idiomatic Rust.
2018-09-04 05:53:58 -10:00
Anatoly Yakovenko
79d24ee227 fixed test according to @rob-solana 2018-08-16 14:44:51 -07:00
anatoly yakovenko
88d6fea999 Revert "Accounts with state (#954)"
This reverts commit c23fa289c3.
2018-08-15 19:44:39 -07:00
anatoly yakovenko
c23fa289c3 Accounts with state (#954)
* Account type with state

* fixed test according to @rob-solana
2018-08-15 14:32:11 -07:00
Rob Walker
f784500fbb fixups
fixes #907
2018-08-13 21:07:26 -07:00
Greg Fitzgerald
2727067b94 Move winow into its own module 2018-08-13 20:17:16 -06:00
Rob Walker
e8da903c6c move tmp_ledger back to target dir 2018-08-13 16:52:53 -07:00
Rob Walker
35de159d00 better error messages 2018-08-10 19:53:58 -07:00
Rob Walker
546a1e90d5 clippy fixups 2018-08-10 19:53:58 -07:00
Rob Walker
96d6985895 rework read_ledger, LedgerWriter, and LedgerWindow for recover()
fixes #910
2018-08-10 18:07:23 -07:00
Rob Walker
bbf9ea89c5 add some flushing to ledger 2018-08-10 11:41:31 -07:00
Greg Fitzgerald
c2bbe4344e Rename KeyPair to Keypair 2018-08-09 13:41:37 -06:00
Greg Fitzgerald
ca7d4c42dd Rename cur_hashes to num_hashes 2018-08-09 10:15:10 -06:00
Rob Walker
c64e2acf8b set destination address when for ledger window repair responses 2018-08-07 23:31:01 -07:00
Rob Walker
999534248b fixups 2018-08-07 17:27:53 -07:00
Rob Walker
fbc754ea25 plug in LedgerWindow
fixes #872
2018-08-07 17:27:53 -07:00
Rob Walker
2a0025bb57 get buffered IO back for ledger 2018-08-07 15:34:15 -07:00
Rob Walker
3beb38ac8a /tmp/farf no good on multi-user machine 2018-08-06 14:53:40 -07:00
Rob Walker
0514f5e573 sync() apparently imposes a serious performance penalty 2018-08-06 08:51:41 -07:00
Rob Walker
9fabd34156 remove trace! calls, re-arrange replicate_requests to have the bank earlier 2018-08-06 08:51:41 -07:00
Rob Walker
039ed01abf on 2nd thought: do not copy_ledger() for this test 2018-08-06 08:51:41 -07:00
Rob Walker
ead0eb2754 move copy_ledger() back into ledger.rs
Don't recover() for copy(), as copy() is already tolerant of things
    recover() guards against.  Note: recover() is problematic if the ledger is
    "live", i.e. is currently being written to.
2018-08-06 08:51:41 -07:00
Rob Walker
c3db2df7eb tweak random access ledger
* add recover_ledger() to deal with expected common ledger corruptions
  * add verify_ledger() for future use cases (ledger-tool)
  * increase ledger testing
  * allow replicate stage to run without a ledger
  * ledger-tool to output valid json
2018-08-06 08:51:41 -07:00
Rob Walker
ee6c15d2db start on ledger recovery with a description of what that might mean 2018-08-06 08:51:41 -07:00
Rob Walker
692b125391 Revert "Revert "fixups""
This reverts commit e2c68d8775.
2018-08-06 08:51:41 -07:00
Rob Walker
5193819d8e Revert "Revert "plug in new ledger""
This reverts commit 57e928d1d0.
2018-08-06 08:51:41 -07:00
Rob Walker
57e928d1d0 Revert "plug in new ledger"
This reverts commit 46d9ba5ca0.
2018-08-03 10:24:51 -07:00
Rob Walker
e2c68d8775 Revert "fixups"
This reverts commit b72e91f681.
2018-08-03 10:24:51 -07:00
Rob Walker
b72e91f681 fixups 2018-08-02 21:50:47 -07:00
Rob Walker
46d9ba5ca0 plug in new ledger 2018-08-02 21:50:47 -07:00
Tyera Eulberg
448b8b1c17 Add Hash wrapper and supporting traits 2018-08-01 17:00:51 -07:00
Tyera Eulberg
bcfaf5d994 Rebase ledger change 2018-08-01 16:15:14 -07:00
Stephen Akridge
6693386bc5 Lower errors to warnings so they don't print during tests
Negative tests should trigger the warnings, but errors look like
something is wrong.
2018-08-01 16:56:12 -06:00
Rob Walker
0aba74935b fixups 2018-08-01 14:42:58 -07:00
Rob Walker
4eb666d4f9 provide ledger::copy() 2018-08-01 14:42:58 -07:00
Rob Walker
d5e0cf81ff fixups 2018-08-01 14:42:58 -07:00