Commit Graph

64 Commits

Author SHA1 Message Date
carllin 512bfc93cb
Add a cache for leader schedules (#3841)
* Add a cache for leader schedules
2019-04-19 02:39:44 -07:00
Rob Walker 67b8ad6a0f
fix entries.to_blobs() (#3882)
* * rename Entry::serialized_size() to Entry::to_blob_size() to better
    reduce confusion with bincode, et al. and to better reflect its
    real meaning

* fix implementation of to_blob_size() to actually return what happens
    when we do entries.to_blobs() (i.e. we serialize Vec<Entry>, not Entry)

* update tests to be more rigorous

* clippy
2019-04-18 14:45:41 -07:00
Pankaj Garg f2187780d2
Do not forward vote transactions (#3871) 2019-04-18 11:18:49 -07:00
Pankaj Garg 2f4a3ed190
Use a separate channel to process votes in banking stage (#3861)
- This will help expedite the vote processing on peer nodes
2019-04-17 21:07:45 -07:00
Mark E. Sinclair aa21f5343a Remove broken read().unwrap() call to a non-shared packet 2019-04-17 21:24:40 -05:00
Sagar Dhawan 9c2809db21
Delete SharedPackets (#3843)
* Delete SharedPackets

* Fix bench and sigverify
2019-04-17 18:15:50 -07:00
Pankaj Garg a2c8e3952f
Fixes to TPS calculation and reporting (#3836)
Fixes to TPS calculations and reporting
2019-04-17 15:37:01 -07:00
Pankaj Garg 2c745ce108
Shorten recv wait when there are buffered packets in banking stage (#3757)
- packets are buffered on leader rotation, when the next leader is
  unknown
- shortening the wait allows the banking stage to poll for next
  leader more frequently
2019-04-14 12:34:07 -07:00
Pankaj Garg ee35ed5250
Refactored buffered packet forwarding code (#3750)
- Added unit tests
- Don't consume packets if bank is not known
2019-04-13 23:19:54 -07:00
Pankaj Garg 44ebfa736a
Don't forward buffered packet to the same node (#3712)
- instead, process the packets
2019-04-11 17:23:45 -07:00
Stephen Akridge 2c93062f54 Improve banking_stage performance messages
Use transaction count instead of batch count,
and set the recv_start from when we finished processing
the previous batch to get a more accurate number.
2019-04-09 14:54:12 -07:00
Greg Fitzgerald 46e6911ec1 Add get_signature_status() to SyncClient
And move bank::Result to transaction module.
2019-04-05 10:22:05 -07:00
Greg Fitzgerald 35298e01a8 Remove Instruction wrapper structs and name functions after enum fields 2019-04-03 13:34:27 -07:00
Greg Fitzgerald 867f6f107b Rename SystemInstruction::Move to SystemInstruction::Transfer 2019-04-03 08:35:57 -06:00
Greg Fitzgerald 43bb813cbe Rename 'new_account' to 'new_user_account'
And 'new_program_account' to 'new_account'
2019-04-02 21:24:42 -06:00
carllin d228b6467c
Implement finalizer so that all locked accounts are dropped (#3585)
* Implement finalizer so that all locked accounts are dropped when finalizer goes out of scope

* Add test for tx error with lock conflict

* Fix double unlock from destructor running after a call to unlock
2019-04-02 03:55:42 -07:00
Greg Fitzgerald fcef54d062 Add a constructor to generate random pubkeys 2019-03-31 16:23:18 -06:00
carllin f886b3b12b
Fix resetting PohRecorder to wrong bank (#3553)
* Check whether future slot already has transmission
2019-03-29 20:00:36 -07:00
Stephen Akridge 0887832b00 Early exit if buffered packets is empty 2019-03-29 13:40:07 -07:00
Greg Fitzgerald 2ab50cbae8 Move untested code out of SDK
verify_signature() was only used in a test that was testing
binary layout. It only worked because the test transaction only
had one signature.

from() was only used by verify_signature() and that's something
we'd typically called `pubkey()`.

hash() didn't return the hash of the Transaction, as you might
guess. It's only used for PoH, so move it into Entry.
2019-03-28 14:24:59 -06:00
Stephen Akridge 0482f153d0 Lower a bunch of debug
Can't afford to be printing on every transaction error, it will slow
the system down.
2019-03-28 12:24:47 -07:00
Anatoly Yakovenko 6bfe497ab5 remove leader confirmaiton 2019-03-27 08:41:41 -07:00
Greg Fitzgerald acedf4ca5a Move Instruction into its own module 2019-03-23 20:31:55 -07:00
Sathish e1a3708844
Ensure accounts are unlocked (#3458) 2019-03-23 13:30:56 -07:00
anatoly yakovenko 52f6c33ff9
Make sure banking stage is recording with the same bank that it read (#3447)
* make sure banking stage is recording with the same bank that it read with
2019-03-22 14:17:39 -07:00
Pankaj Garg d7ff6645a9 change pubkey to ref 2019-03-20 16:55:01 -07:00
Pankaj Garg 1824e09d0a find next leader slot before resetting working bank in Poh recorder 2019-03-20 16:55:01 -07:00
Michael Vines 0dc364c17a Relocate transaction reference verification to join the other validity checks 2019-03-20 07:46:01 -07:00
Pankaj Garg 1be7ee51be Fix potential crash in banking stage 2019-03-19 12:06:42 -07:00
Rob Walker c70412d7bb
move core tests to core (#3355)
* move core tests to core

* remove window

* fix up flaky tests

* test_entryfication needs a singly-threaded banking_stage

* move core benches to core

* remove unnecessary dependencies

* remove core as a member for now, test it like runtime

* stop running tests twice

* remove duplicate runs of tests in perf
2019-03-18 22:08:21 -07:00
Greg Fitzgerald 8d032aba9d Merge InstructionError and ProgramError
From the user's perspective, it's just an instruction error.
For program-specific errors, we still have
InstructionError::CustomError.
2019-03-18 10:39:20 -06:00
Pankaj Garg 66fb1bbb2e
Give last leader some grace ticks to catch up (#3299)
* Wait for last leader for some ticks

* New tests and fixed existing tests
2019-03-15 13:22:16 -07:00
carllin 36763d0802
Cleanup entry.rs packing code (#3303) 2019-03-15 12:48:32 -07: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 6a89c68a1d Add utility function to help get System error out of ProgramError 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
Stephen Akridge 959961b596 Modified test 2019-03-13 18:18:27 -07:00
carllin cb3eeace56
Replay Stage start_leader() can use wrong parent fork() (#3238)
*  Make sure start_leader starts on the last voted block, not necessarily the biggest indexed bank in frozen_slots()

* Fix tvu test
2019-03-12 17:42:53 -07:00
Stephen Akridge f8e07ef5a3 banking_stage_entryfication fails when run as cargo test
Add some retry for getting entries from the channel.
2019-03-11 14:13:32 -07:00
Carl a4b6d181a2 rename forwarder ports to tpu_via_blobs 2019-03-11 14:07:17 -07:00
Pankaj Garg 0b8c5d807d code cleanup 2019-03-11 14:07:17 -07:00
Pankaj Garg e201136eee more review comments 2019-03-11 14:07:17 -07:00
Pankaj Garg 55f660d5f9 address review comments 2019-03-11 14:07:17 -07:00
Carl a4acc631ee Refactor packing packets into blobs into separate packets_to_blob() function in packets.rs 2019-03-11 14:07:17 -07:00
Carl cd1a9faacd Batch packet forwarding in banking stage 2019-03-11 14:07:17 -07:00
Pankaj Garg fe1f67ea9a clippy errors 2019-03-11 14:07:17 -07:00
Pankaj Garg 069ce71256 fix clippy 2019-03-11 14:07:17 -07:00
Pankaj Garg e3cacb9296 Buffer unprocessed packets if next leader is the current node 2019-03-11 14:07:17 -07: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