Commit Graph

263 Commits

Author SHA1 Message Date
carllin a4035a3c65
Remove record locks and parent locks from accounts (#4633)
* Revert "Fix parent record locks usage in child banks (#4159)"

This reverts commit 69eeb7cf08.

* Revert "Fix DuplicateSignatures caused by races on frozen banks (#3819)"

This reverts commit 083090817a.

* Remove unused imports
2019-06-10 22:05:46 -07:00
Tyera Eulberg 807c69d97c
Slimmer implementation of credit-only accounts (#4592)
* Add credit-only debit/data check to verify_instruction

* Store credits and pass to accounts_db

* Add InstructionErrors and tests

* Relax account locks for credit-only accounts

* Collect credit-only account credits before passing to accounts_db to store properly

* Convert System Transfer  accounts to credit-only, and fixup test

* Functionalize collect_accounts to unit test

* Review comments

* Rebase
2019-06-10 20:50:02 -06:00
Rob Walker 37c2fa1d8d
add current to bank syscalls (#4581) 2019-06-07 11:41:34 -07:00
carllin c9d63204eb
Replace unneeded seqcst with relaxed on atomic operations (#4587) 2019-06-06 23:53:21 -07:00
Sagar Dhawan 688f8a669a
Add a storage accounts cache to Bank (#4578) 2019-06-06 17:40:01 -07:00
Michael Vines ff77789718
Collect fees at the end of a slot (#4525) 2019-06-03 18:40:20 -07:00
Rob Walker 482ef51502
register_tick() on the correct bank (#4506)
* skip syscall_id in hash and delta

* add more tests, skip syscalls
2019-06-03 09:04:26 -07:00
Tyera Eulberg 64e8a21d73
Add tick height syscall (#4497)
* Remove tick_height from entrypoint signature

* Impl tick_height syscall and use in storage program

* Properly remove tick height from bpf handling
2019-05-31 16:29:21 -06:00
Rob Walker 1c1d83bd56
skip syscall_id in hash and delta (#4500)
* skip syscall_id in hash and delta

* add more tests, skip syscalls
2019-05-31 12:26:45 -07:00
Sathish 182096dc1a
Create bank snapshots (#4244)
* Revert "Revert "Create bank snapshots (#3671)" (#4243)"

This reverts commit 81fa69d347.

* keep saved and unsaved copies of status cache

* fix format check

* bench for status cache serialize

* misc cleanup

* remove appendvec storage on purge

* fix accounts restore

* cleanup

* Pass snapshot path as args

* Fix clippy
2019-05-30 21:31:35 -07:00
Michael Vines 1de805e7cd
Add fees syscall to expose cluster fees into programs (#4472) 2019-05-30 15:18:48 -07:00
Rob Walker 441fed7a5b
check freeze before updating slot_hashes (#4448)
* check freeze before updating slot_hashes

* fixup
2019-05-28 12:25:55 -07:00
Tyera Eulberg 0e26ee854b
Add test indicating need for credit-only account handling (#4441)
* Add test indicating need for credit-only account handling

* Add commented correct future test lines
2019-05-28 11:57:22 -04:00
Michael Vines 9843c3a5cb Restrict transaction fee payers to system accounts (#4198)
automerge
2019-05-24 13:06:55 -07:00
Michael Vines cfe5afd34c
_id => _pubkey variable renaming (#4419)
* wallet: rename *_account_id to *_account_pubkey

* s/from_id/from_pubkey/g

* s/node_id/node_pubkey/g

* s/stake_id/stake_pubkey/g

* s/voter_id/voter_pubkey/g

* s/vote_id/vote_pubkey/g

* s/delegate_id/delegate_pubkey/g

* s/account_id/account_pubkey/g

* s/to_id/to_pubkey/g

* s/my_id/my_pubkey/g

* cargo fmt

* s/staker_id/staker_pubkey/g

* s/mining_pool_id/mining_pool_pubkey/g

* s/leader_id/leader_pubkey/g

* cargo fmt

* s/funding_id/funding_pubkey/g
2019-05-23 23:20:04 -07:00
Rob Walker 35e8f966e3
add freeze_lock() and fix par_process_entries() failure to detect self conflict (#4415)
* add freeze_lock and fix par_process_entries failure to detect self conflict

* fixup

* fixup
2019-05-23 17:35:15 -07:00
Michael Vines 2ed77b040a
create_genesis_block() now returns a struct (#4403) 2019-05-22 20:39:00 -07:00
Rob Walker 7ada8510c4
add slot_hashes to bank, remove phony slot_hashes_from_vote_instruction (#4401) 2019-05-22 19:07:56 -07:00
Michael Vines f079a78c5e Remove fee arg from system_transaction::* (#4346)
automerge
2019-05-20 10:03:19 -07:00
Pankaj Garg 9476fe5ce3
Use log levels for datapoint metrics (#4335)
* Use log levels for datapoint metrics

* address review comments

* fix cyclomatic complexity
2019-05-17 17:34:05 -07:00
Pankaj Garg b2ce5dc9f5
Adjust log level for counter metrics (#4323) 2019-05-17 07:00:06 -07:00
Rob Walker 87414de3e2
switch over to passive stakes (#4295)
* add failing test

* switch over to passive stakes

* test multiple stakers
2019-05-16 08:23:31 -07:00
Pankaj Garg 778bcbce50 Reduce log level for frequent log message and frequency for metrics datapoint (#4300)
automerge
2019-05-15 16:01:17 -07:00
Rob Walker 0c1191c3ee
rework staking_utils (#4283) 2019-05-14 16:15:51 -07:00
Rob Walker 216e9a61a0
expose stake directly from bank (#4281) 2019-05-14 13:35:14 -07:00
Rob Walker e8ad822111
get program names from programs (#4273)
* get program names from programs

* fixup
2019-05-14 10:44:16 -07:00
carllin 3bd921264a
Move EpochSchedule into own module (#4272) 2019-05-13 16:24:32 -07:00
Rob Walker 0d2574f8f0
get DLL names from programs that made the DLL (#4269)
* get program names from programs

* fixup
2019-05-13 14:17:44 -07:00
Rob Walker 23c696706b
add stake_accounts to banks' caches (#4267) 2019-05-13 12:33:23 -07:00
Jack May f567877d1d
Cleanup metrics (#4230) 2019-05-10 08:33:58 -07:00
Rob Walker 81fa69d347
Revert "Create bank snapshots (#3671)" (#4243)
This reverts commit abf2b300da.
2019-05-09 19:27:27 -07:00
Sathish abf2b300da Create bank snapshots (#3671)
* Be able to create bank snapshots

* fix clippy

* load snapshot on start

* regenerate account index from the storage

* Remove rc feature dependency

* cleanup

* save snapshot for slot 0
2019-05-09 19:27:06 -07:00
carllin ab3c988146 API for getting first and last slots in epoch (#4241)
automerge
2019-05-09 16:06:57 -07:00
Pankaj Garg 1a2b131ceb
Don't forward transactions that are expired or failed signature check (#4199) 2019-05-08 10:32:25 -07:00
Rob Walker b49f8c0984
reduce replicode, introduce passive staking support (#4207) 2019-05-07 22:22:43 -07:00
Michael Vines 7609a007c6
Add FeeCalculator to the genesis block (#4196) 2019-05-07 20:28:41 -07:00
carllin 69eeb7cf08
Fix parent record locks usage in child banks (#4159)
* Introduce record locks on txs that will be recorded

* Add tests for LockedAccountsResults

* Fix broken bench

* Exit process_entries on detecting conflicting locks within same entry
2019-05-07 15:51:35 -07:00
Rob Walker 8e400fc4bd
rework genesis (passive staking groundwork) (#4187)
* rework genesis

* fixup
2019-05-07 11:16:22 -07:00
Tyera Eulberg 71f9b44687
Add Confirmations parameter to RPC Subscriptions (#4154)
* Add optional depth parameter to pubsub, and store in subscriptions

* Pass bank_forks into rpc_subscription; add method to check depth before notify and impl for account subscriptions

* Impl check-depth for signature subscriptions

* Impl check-depth for program subscriptions

* Plumb fork id through accounts

* Use fork id and root to prevent repeated account notifications; also s/Depth/Confirmations

* Write tests in terms of bank_forks

* Fixup accounts tests

* Add pubsub-confirmations tests

* Update pubsub documentation
2019-05-06 08:31:50 -06:00
Rob Walker 7f75cc8906
update nightly to 2019-05-01 (#4111)
* update nightly to 2019-05-01

* cargo fmt

* cargo fmt

* increase bench timeout
2019-05-01 20:08:42 -07:00
carllin 73f250f03a
Make minimum warmup period 32 slots long (#4031)
* Make minimum warmup period 32 slots long

* PR fixes
2019-04-29 15:26:52 -07:00
anatoly yakovenko c2193a37ce
cleanup unused function (#4064) 2019-04-29 12:45:14 -07:00
anatoly yakovenko acba1d6f9e
Roots are added out of order to the accounts index (#4051)
* fix root race

* assert root order

* fixup! assert root order

* last root test

* update

* fix tests
2019-04-28 10:27:37 -07:00
anatoly yakovenko 3e14af5033
bast bank ancestor check (#4050) 2019-04-28 10:27:09 -07:00
sakridge aa0b67c93c
Use newer blockhash for recent_confirmed_blockhash api (#3995)
Oldest blockhash is sometimes too old and does not allow
for transactions to go through.
2019-04-25 16:57:25 -07:00
carllin ab11327e34
Fix mismatch between leader/validator bank votability (#3942)
* Fix mismatch between leader/validator bank votability
2019-04-23 15:32:19 -07:00
Greg Fitzgerald 29698fcd38
Cleanup stragglers from move-to-transfer rename (#3947) 2019-04-23 13:30:42 -06:00
Jack May afb00432d4
Add BankClient support to bench-exchange (#3902) 2019-04-19 13:18:20 -07:00
carllin 512bfc93cb
Add a cache for leader schedules (#3841)
* Add a cache for leader schedules
2019-04-19 02:39:44 -07:00
anatoly yakovenko 1e20d449ce
`bank_height / slot` is the block drop rate (#3816)
* bank_height/slot would give is the block drop rate

* use metrics
2019-04-16 19:35:38 -07:00
anatoly yakovenko f73d38739a
Split AccountsDB from Accounts (#3808)
Split AccountsDB from Accounts
2019-04-16 13:32:22 -07:00
anatoly yakovenko 68fc303b9b
Rework Accounts for fast squash, hashing state and checkpoint recovery. (#3613)
* accounts rewrite

* ignore grow tests

* skip duplicate roots

* allow for a root race

* logger

* accounts_index tests

* tests

* tests
2019-04-15 17:15:50 -07:00
Rob Walker de52747950
remove max_tick_height replicode (#3765) 2019-04-14 19:15:31 -07:00
Sagar Dhawan 1e8f83a74a Use a better name for new api 2019-04-12 14:58:22 -07:00
Sagar Dhawan 1db80d79fc Update get recent blockhashes to return confirmed blockhashes only 2019-04-12 14:58:22 -07:00
carllin 787dc5748a
Fixed DuplicateSigs (#3727)
* Fixed DuplicateSigs by not recording errors in signature cache of bank
2019-04-11 11:51:34 -07:00
Greg Fitzgerald 8ada4bfd1f Remove test now covered by Vote crate 2019-04-11 10:53:11 -07:00
Greg Fitzgerald 5d4624e75f Use Bank::add_instruction_processor to bypass manual build step 2019-04-11 10:53:11 -07:00
Rob Walker f1e7237c09
vote_api cleanup (#3710)
* vote_api cleanup

* fixups

* fixup

* remove unused code

* revert removal of serialize and deserialize

* ...

* increase coverage, bootstrap staking

* Sagar's STAKE to my VOTE
2019-04-10 17:52:47 -07:00
Sagar Dhawan c0808d01f8 Add tests 2019-04-10 15:51:00 -07:00
Sagar Dhawan 7fd5e51168 Make sure bank 0 is votable and correctly designate signer 2019-04-10 15:51:00 -07:00
Rob Walker d30049b8eb
test for debit of TX fees on full process_transaction() (#3643)
* fix double debit of TX fees

* add test that fails when removing that line

* put that line back in

* comments
2019-04-05 16:55:58 -07:00
Rob Walker a5b5248a09
move vote_accounts up (#3647) 2019-04-05 14:23:00 -07:00
Rob Walker 9f046a023e
move transaction_count up (#3618)
* move transaction_count up

* fixup
2019-04-05 10:42:25 -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
Greg Fitzgerald a0041cec97 Rename Runtime to MessageProcessor 2019-04-02 12:49:26 -06:00
Greg Fitzgerald fa1c1e3734 Rename native programs to native instruction processors 2019-04-02 10:36:19 -06:00
Greg Fitzgerald 0a9f063d3e Rename native_program.rs to instruction_processor_utils.rs
Prefer the term "instruction processor" over "program". Reserve
the term "native" for the loader and shared object it loads.
Compiling an instruction processor to BPF shouldn't imply changing
to a non-native entrypoint.
2019-04-02 10:36:19 -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 8660c3581e
Add squashing metrics (#3573) 2019-03-29 21:21:59 -07:00
Greg Fitzgerald 5646daa820 Delete lots of fee parameters
So many zeros!
2019-03-29 19:21:51 -06:00
Greg Fitzgerald 7896e8288d Replace Transaction::fee with a FeeCalculator 2019-03-29 19:21:51 -06:00
Greg Fitzgerald 3b516c0710 Fix build 2019-03-29 14:56:29 -06:00
Greg Fitzgerald 31f8b6d352 Integrate Message into Transaction 2019-03-29 13:03:29 -07:00
anatoly yakovenko 10239c3b3c
Replace recursive status cache with a single global fast status cache (#3541)
Fast Status Cache
2019-03-29 10:03:55 -07:00
Greg Fitzgerald cecdb7061e Remove blockhash parameter from Bank::transfer
That parameter is an artifact from the Loom days, when I thought
Bank should implement the same interace as ThinClient.
2019-03-27 08:51:10 -06:00
Greg Fitzgerald ca2ac1e5ea Remove a mostly unused Transaction constructor 2019-03-26 15:46:58 -07:00
Rob Walker 215b07c1a9
remove status_cache.freeze (#3506) 2019-03-26 11:56:25 -07:00
Greg Fitzgerald df333e8b6e Move new_move_many to SystemInstruction 2019-03-26 09:22:29 -07:00
Greg Fitzgerald acedf4ca5a Move Instruction into its own module 2019-03-23 20:31:55 -07:00
Rob Walker 31b8743052
delay freeze of status_cache until squash (#3453) 2019-03-22 22:14:56 -07:00
Sathish 06b0c98c75
Remove accounts when the fork is removed (#3384)
* Fix test

* Cleanup accounts when the fork is removed

* Update test to check for deleted accounts
2019-03-21 17:36:10 -07:00
anatoly yakovenko 148e08a8a5
Enable cluster tests (#3372)
* Cluster tests

* stable!

* fixup! stable!

* fixup! fixup! stable!

* fixup! fixup! fixup! stable!

* fixup! fixup! fixup! fixup! stable!

* fixed space

* add getNumBlocksSinceSignatureConfirmation entry for the json rpc docs

* Check in upcoming epochs for potential leadership slots in next_leader_slot()
2019-03-21 07:43:21 -07:00
Stephen Akridge bcb190a12a Remove erroneous comment 2019-03-20 16:15:25 -07:00
Rob Walker df9fd2bc0b
stop copying Blooms (#3379)
* stop copying Blooms

* fixup

* clippy
2019-03-20 11:06:39 -07:00
Michael Vines 0dc364c17a Relocate transaction reference verification to join the other validity checks 2019-03-20 07:46:01 -07:00
Carl 5e21268ca0 PR comments 2019-03-18 20:46:11 -07:00
Carl b38e3bef01 Modify bank_forks to support squashing/filtering new root and also don't remove parents from bank_forks when inserting, otherwise we lose potential fork points when querying blocktree for child slots 2019-03-18 20:46:11 -07:00
Greg Fitzgerald c09accb685 Rename StaticEntrypoint to ProcessInstruction 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 24d9138067 Abandon Builder pattern 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 7b4568b9bf Migrate to sign_checked() 2019-03-15 09:06:54 -06:00
Sagar Dhawan 3f2fc21bb3
Rename hash_queue and fix boundary condition (#3289) 2019-03-14 11:56:36 -07:00