Commit Graph

388 Commits

Author SHA1 Message Date
TristanDebrunner 0c4cb76acf
Add GPU based PoH verification (#4524)
* Add GPU poh verify

* Switch to single PoH verify function

* Add EntrySlice verify tests with hashes and txs

* Add poh-verify benchmarks
2019-06-08 10:21:43 -06:00
Rob Walker 37c2fa1d8d
add current to bank syscalls (#4581) 2019-06-07 11:41:34 -07:00
Michael Vines 492cc93850
Limit short_vec length to u16, usize is overkill for our usage (#4588) 2019-06-06 20:18:41 -07:00
Rob Walker fd9fd43e83
add solana_name_id, reassociate names with modules, modularize id tests (#4580) 2019-06-06 19:27:49 -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 028e111fbc
remove payer from vote instructions (#4475) 2019-05-31 11:45:17 -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 c05c3e69ca
add tests and groom naming (#4467) 2019-05-29 10:08:03 -07: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
Tyera Eulberg 943cd0a24a
Add credit-only info to AccountMetadata (#4405)
* Add credit-only flag to AccountMeta, default to false

* Sort keys by is_credit_only within signed/unsigned groupings

* Process and de-dupe program keys along with other account keys

* Add message helper functions

* Fix test

* Improve comment

* s/is_credit_only/is_debitable

* Add InstructionKeys helper struct, and simplify program_position method
2019-05-23 18:19:53 -04: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
Tyera Eulberg 99d2428041
Transaction format changes toward Credit-Only accounts (#4386)
* Add num_readonly_accounts slice

* Impl programs in account_keys

* Emulate current account-loading functionality using program-account_keys (breaks exchange_program_api tests)

* Fix test

* Add temporary exchange faucet id

* Update chacha golden

* Split num_credit_only_accounts into separate fields

* Improve readability

* Move message field constants into Message

* Add MessageHeader struct and fixup comments
2019-05-22 18:23:16 -04:00
Rob Walker 578c2ad3ea
add bank hash to votes (#4381) 2019-05-21 21:45:38 -07:00
Rob Walker 41a377013f fix spelling (#4378)
automerge
2019-05-21 17:13:21 -07:00
Rob Walker 58295b825d
introduce syscalls (#4373) 2019-05-21 15:19:41 -07:00
Michael Vines f079a78c5e Remove fee arg from system_transaction::* (#4346)
automerge
2019-05-20 10:03:19 -07:00
Michael Vines 392a39dd54
Poh subsystem cleanup, genesis plumbing, enable real PoH on edge testnet (#4292)
* Remove unused PohServiceConfig::Step

* Clarify variable name

* Poh::hash() now takes an iteration counter

* man -> max

* Inline functions with single call site

* Move PohServiceConfig into GenesisBlock

* Add plumbing to enable real PoH on testnets

* Batch hashes to improve PoH hash rate

* Ensure a constant hashes_per_tick

* Remove PohEntry mixin field

* Poh/PohEntry no longer maintains tick_height

* Ensure a constant hashes_per_tick

* ci/localnet-sanity.sh: Use real PoH

* Rework Poh/PohService to keep PohRecorder unlocked as much as possible while hashing
2019-05-18 14:01:36 -07:00
Rob Walker 431cc82032
add Transaction::partial_sign() (#4333)
* add partial sign

* nits
2019-05-17 18:55:57 -07:00
Rob Walker 7bfb60f82e add impl FromStr for Signature (#4315)
automerge
2019-05-16 14:54:31 -07:00
Greg Fitzgerald fff1631a8b
Return a better error when a program account isn't found (#4310) 2019-05-16 11:32:27 -06:00
Pankaj Garg c9b86018c6
Filter out all unprocessed transactions before forwarding them (#4266)
* Filter out all unprocessed transactions before forwarding them

* fix clippy
2019-05-13 14:40:05 -07:00
Michael Vines a2e3a92b01
Extend GetBlockHash RPC API to include the fee scehdule for using the returned blockhash (#4222) 2019-05-13 12:49:37 -07:00
Tyera Eulberg 1b68da7572 Use solana-ed25519-dalek v0.2.0 (#4264)
automerge
2019-05-13 09:51:59 -07:00
Pankaj Garg 133be2df51
Check for transaction forwarding delay to detect an expired transaction before forwarding it (#4249)
Also refactored code for forwarding packets, and added test for it
2019-05-10 14:28:38 -07:00
Tyera Eulberg 06a93dcb43
Move to solana-ed25519-dalek (#4248) 2019-05-10 15:26:46 -06:00
Rob Walker 5f72650c7f
add derive Debug to Keypair (#4236) 2019-05-09 11:41:11 -07:00
Rob Walker 994515d0f2
add impl PartialEq for Keypair (#4233)
* add-impl-PartialEq-for-Keypair

* clippy

* do the TODO, improve wrapper comments
2019-05-09 11:03:14 -07:00
Rob Walker f7680752e7 make gen_keypair_file take &str (#4232)
automerge
2019-05-08 23:00:48 -07:00
Michael Vines 7609a007c6
Add FeeCalculator to the genesis block (#4196) 2019-05-07 20:28:41 -07:00
Michael Vines d10bde656a
Pass payer key into get_keys() (#4203) 2019-05-07 18:48:31 -07:00
Michael Vines d9e18a71ec
Pay program loading fees from a system account (#4190) 2019-05-07 15:00:54 -07:00
Rob Walker 8e400fc4bd
rework genesis (passive staking groundwork) (#4187)
* rework genesis

* fixup
2019-05-07 11:16:22 -07:00
Rob Walker 675a78aaa1
get vote_instruction off bank for tests (#4086)
* get vote_instruction off bank for tests

* clippy
2019-04-30 15:11:08 -07:00
Sagar Dhawan 18e398131d
Fix issues with bench-tps (#4005) 2019-04-27 08:39:29 -07:00
Michael Vines e71ab55288
Rename in-tree program_ids to be base-58 human readable (#4001) 2019-04-25 17:58:49 -07:00
Sagar Dhawan a3c302c36a Add signature polling to SyncClient (#3996)
automerge
2019-04-25 12:46:40 -07:00
Tyera Eulberg 5a79676b8a Custom error decoder (#3783)
automerge
2019-04-25 10:29:44 -07:00
Greg Fitzgerald 29698fcd38
Cleanup stragglers from move-to-transfer rename (#3947) 2019-04-23 13:30:42 -06:00
Tyera Eulberg e0acd48944
Write bench-tps in terms of client (#3904)
* Write bench-tps in terms of client

* Add transactions_addr method for logging

* Move cluster config outside do_bench_tps

* Add BankClient test
2019-04-19 15:04:36 -06:00
sakridge f4e40d2c41
Add bench-exchange tx send metrics (#3890) 2019-04-18 22:31:25 -07:00
Tyera Eulberg a9cfae486c
Revert-revert migrate to ed25519-dalek crate (#3877)
* Revert "Revert "Migrate from ring to ed25519-dalek, take 2 (#3844)" (#3868)"

This reverts commit 6a878602f2.

* Fix Signature::verify method
2019-04-18 14:37:20 -06:00
Tyera Eulberg 6a878602f2
Revert "Migrate from ring to ed25519-dalek, take 2 (#3844)" (#3868)
This reverts commit e9b82bacda.
2019-04-18 11:47:34 -06:00
Tyera Eulberg e9b82bacda
Migrate from ring to ed25519-dalek, take 2 (#3844)
* Migrate from ring to ed25519-dalek

* Move gen_keypair_file test to a more appropriate location

* Fixup bench-exchange and add helper fn for single deterministic keypair

* Update golden
2019-04-18 10:38:32 -06:00
Greg Fitzgerald 80f3568062
Upgrade to Rust 1.34.0 (#3781)
* Upgrade to Rust 1.34.0

* Remove redundant closures

Thanks Clippy!
2019-04-15 15:56:08 -06:00
Tyera Eulberg d31989f878 CustomError from Vec->u32 2019-04-11 13:59:48 -07:00
Jack May d0f46d6a8a
Cleanup client traits and create super trait (#3728) 2019-04-11 00:25:14 -07:00
carllin 4f232cbc27
Make MAX_RECENT_BLOCKHASHES <= MAX_HASH_AGE_IN_SECONDS (#3679)
* Make MAX_RECENT_BLOCKHASHES == MAX_HASH_AGE_IN_SECONDS
2019-04-09 11:45:25 -07:00
Tyera Eulberg 90c1300bb6 Plumb TransactionError through Rpc 2019-04-05 22:09:29 -06: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 d3844ef32a Add AsyncClient 2019-04-05 10:22:05 -07:00
Sagar Dhawan 0b23af324b
Refactor Storage Program (#3622)
* Refactor Storage Program

* Replace KeyedAccount trait with StorageAccount struct

* Implement State for Account, not StorageAccount

* Make State trait more generic

* Move validation check into function
2019-04-04 12:01:09 -07:00
Greg Fitzgerald 1598a02a7a Wrap all client errors with TransportError 2019-04-04 12:00:19 -06:00
Greg Fitzgerald 167f5bdc58 Add get_balance() and get_account_data() to SyncClient
Migrate tests to use them.
2019-04-04 12:00:19 -06:00
Greg Fitzgerald 5cd7bccdf3 Add SyncClient and use from BankClient 2019-04-04 12:00:19 -06: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 4c0bc1fd88 Add program_ids() methods
Added CompiledInstruction::program_id() so that we don't need to pass
around instruction indexes just for Message::program_id().

Also added Message.program_ids() that returns a slice so that we
can move those pubkeys into Message::account_keys.
2019-04-02 19:00:35 -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
Greg Fitzgerald fcef54d062 Add a constructor to generate random pubkeys 2019-03-31 16:23:18 -06: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 8e04fadb05 Cleanup magic numbers
Rename `num_signatures` to `num_required_signatures` to
disambiguate it from `tx.signatures.len()`.
2019-03-29 13:03:29 -07:00
Greg Fitzgerald 31f8b6d352 Integrate Message into Transaction 2019-03-29 13:03:29 -07:00
Greg Fitzgerald 98d60e6124 Expose a method for getting the Message from a Transaction
This currently constructs the message, but when message
is integrated, it can return a `&Message`.
2019-03-29 13:03:29 -07:00
Greg Fitzgerald 3759b0d2a5 Fix Blockstreamer test 2019-03-29 08:25:56 -06:00
Greg Fitzgerald c4bc710d3a Use Serde's `with` attribute to shorten length encodings in Transaction 2019-03-29 08:25:56 -06:00
Sathish Ambley 857dc2ba47 Remove custom serialization 2019-03-29 08:25:56 -06:00
Tyera Eulberg 37494c67d0 Add pubkey read/write tools
Co-authored-by: Tyera Eulberg <tyera@solana.com>
Co-authored-by: Tristan Debrunner <tristan@solana.com>
2019-03-28 20:04:32 -06: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
Greg Fitzgerald 4bca60861e Specialize GenericInstruction 2019-03-28 05:45:46 -06:00
Greg Fitzgerald 054ae3a3e3 Document current transaction size awkwardness 2019-03-27 14:27:20 -06:00
Greg Fitzgerald 5ce31168ef Remove Transaction::new_signed 2019-03-26 19:51:16 -07:00
Greg Fitzgerald b9ff70c8ab pub Transaction::new_unsigned
Offer an incremental path off Transaction::new_unsigned_instructions().
2019-03-26 20:06:05 -06:00
Greg Fitzgerald 77498c6efe Expose Message via the new default Transaction constructor 2019-03-26 20:06:05 -06:00
Greg Fitzgerald 8c69c40834 Make space for a new Transaction::new 2019-03-26 20:06:05 -06:00
Rob Walker d497b99abb
use solana_entrypoint directly (#3518) 2019-03-26 16:40:34 -07:00
Greg Fitzgerald ca2ac1e5ea Remove a mostly unused Transaction constructor 2019-03-26 15:46:58 -07:00
Greg Fitzgerald df333e8b6e Move new_move_many to SystemInstruction 2019-03-26 09:22:29 -07:00
Greg Fitzgerald b61aed7250 Minor cleanup 2019-03-25 20:31:13 -07:00
Rob Walker 34c051f183
add hash_fromstr (#3476) 2019-03-25 12:23:19 -07:00
Greg Fitzgerald 5c536e423c Inline InstructionCompiler
The object-oriented paradigm isn't helpful here; go functional.
2019-03-25 12:08:27 -06:00
Greg Fitzgerald 4efa144916 Generate a Message instead of a Transaction 2019-03-25 12:08:27 -06:00
Greg Fitzgerald f3936c21a3 Add message 2019-03-25 12:08:27 -06:00
Greg Fitzgerald b53cbdd9e6 Punt on the Script abstraction
Low ROI
2019-03-24 14:52:06 -06:00
Greg Fitzgerald acedf4ca5a Move Instruction into its own module 2019-03-23 20:31:55 -07:00
Jack May 6505221629
Add exchange program (#3444) 2019-03-22 21:07:36 -07:00
Greg Fitzgerald 5f41909098 Stop using VoteTransaction in Vote processor 2019-03-22 14:07:00 -06:00
Greg Fitzgerald 4bb88619fd Move entrypoint boilerplate into a macro 2019-03-21 15:27:49 -06:00
Greg Fitzgerald a8095e204f Cleanup SystemTransaction 2019-03-21 12:41:39 -07:00
Greg Fitzgerald d2415613de Migrate loader tests to BankClient 2019-03-21 09:19:24 -06:00
Greg Fitzgerald 58f071b7a0 Migrate loader to high-level instructions 2019-03-21 09:19:24 -06:00
Michael Vines 0dc364c17a Relocate transaction reference verification to join the other validity checks 2019-03-20 07:46:01 -07:00
Greg Fitzgerald 94b5835738 Make AccountMeta a traditional struct instead of a tuple struct 2019-03-19 17:22:39 -06:00
Greg Fitzgerald a4652a9aaf Label tuple with AccountMeta 2019-03-19 17:22:39 -06:00
Pankaj Garg 56fcc93ef5
Schedule node for consecutive slots as leader (#3353)
* Also tweak epoch and slot duration

* new test for leader schedule
2019-03-19 06:36:45 -07:00
Michael Vines 15aed9f320 Self 2019-03-18 18:34:08 -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
Greg Fitzgerald 122c7bc2ef Rename TransactionCompiler to Script and use it to replace the type alias 2019-03-18 08:22:54 -07:00
Greg Fitzgerald ae4d14a2ad Introducing Scripts
A sequence of instructions. A client compiles the script and then uses
the compiled script to construction a transaction. Then it adds a
adds a blockhash, signs the transaction, and sends it off for
processing.
2019-03-18 08:22:54 -07:00
Greg Fitzgerald 70b45de012 Get access to runtime errors in Budget unit-tests 2019-03-18 08:22:54 -07:00
Michael Vines e2c24481e4 wallet/ now only dev-depends on core/ 2019-03-16 21:40:39 -07:00
Greg Fitzgerald a88b36d718 Rename TransactionBuilder to TransactionCompiler 2019-03-15 14:46:44 -06:00
Greg Fitzgerald 24d9138067 Abandon Builder pattern 2019-03-15 14:46:44 -06:00
Greg Fitzgerald aca739b800 Boot fees from TransactionBuilder 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 4e51a444f4 Simplify TransactionBuilder::new_with_instructions 2019-03-15 09:06:54 -06:00
Greg Fitzgerald 42d5dde5b1 new_singleton -> new_with_instruction 2019-03-15 09:06:54 -06:00
Greg Fitzgerald 36fb0a0aef Add new preferred transaction constructors 2019-03-15 09:06:54 -06:00
Greg Fitzgerald 4d53be8350 Make it unappealing to build and sign transactions at the same time
Use a client to sign transactions. It'll need that keypair anyway
to resign new blockhashes on retries.
2019-03-15 09:06:54 -06:00
Greg Fitzgerald f8bf9ca218 Make safe transaction signing the default 2019-03-15 09:06:54 -06:00
Greg Fitzgerald 7b4568b9bf Migrate to sign_checked() 2019-03-15 09:06:54 -06:00
Greg Fitzgerald bd8502e87e Implement Transaction::new_unsigned with TransactionBuilder 2019-03-15 09:06:54 -06:00
Greg Fitzgerald 21815f26d5 Implement signed transaction using unsigned transaction 2019-03-15 09:06:54 -06:00
Greg Fitzgerald 8ef5195037 Don't test a transaction with a duplicate key 2019-03-15 09:06:54 -06:00
Greg Fitzgerald c1eec0290e
Rename userdata to data (#3282)
* Rename userdata to data

Instead of saying "userdata", which is ambiguous and imprecise,
say "instruction data" or "account data".

Also, add `ProgramError::InvalidInstructionData`

Fixes #2761
2019-03-14 10:48:27 -06:00
Greg Fitzgerald e58220282a Move TransactionError into the SDK 2019-03-13 21:26:57 -06:00
Greg Fitzgerald 296415945a Generalize error codes 2019-03-13 21:26:57 -06:00
Greg Fitzgerald 1de5ae1ef0 Remove SystemError from 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
Pankaj Garg 8d2bd2b30f Reduce ticks per second
- It's improving TPS. Temp fix for beacons timeframe
2019-03-13 17:50:53 -07:00
Michael Vines 1ee43a7633 Remove non-essential programs from runtime/ 2019-03-12 15:11:59 -05:00
Tyera Eulberg fe1676bc3a Review comments 2019-03-11 16:58:43 -06:00
Tyera Eulberg db5370c5df Add helper macro to implement bincode serialization of program-specific errors 2019-03-11 16:58:43 -06:00
Tyera Eulberg 804378e8f7 Add ProgramError::CustomError and truncate value to 32 bytes 2019-03-11 16:58:43 -06:00
anatoly yakovenko 0c592c52f6
Wake up replay stage when the poh bank is cleared. (#3211)
* wake up replay stage when the poh bank is cleared

* bump ticks per second

* Increase ticks per slot to match faster tick rate

* Remove check that working bank must be the bank for the greatest slot

* Make start_leader() skip starting TPU for slots we've already been leader for
2019-03-11 13:58:23 -07:00
Sagar Dhawan 78bb96ee51
Reduce bootstrap leader stake (#3218) 2019-03-11 13:29:44 -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
Rob Walker 0acdbc0d03 plumb staking_account and voting_keypair from multinode-demo to Vote (#3199)
* plumb staking_account and voting_keypair from bash to Vote
2019-03-08 19:29:08 -07:00
Greg Fitzgerald 94882418ab Simplify TransactionBuilder
A stepping stone to replacing all Transaction constructors with
TransactionBuilders.
2019-03-07 08:11:03 -07:00
Rob Walker 01fb76f4bd
add epoch warmup (#3166)
add epoch warmup
2019-03-06 16:32:23 -08:00
anatoly yakovenko 1c0cfb17a3 Start leader based on Poh tick height. (#3084)
* Start leader based on poh and test

* Equalize validator and leader stakes in LocalCluster

* Clear WorkingBank on poh_recorder reset
2019-03-05 17:56:51 -08:00
Michael Vines 53f09c44f3 Rename tokens to lamports in sdk/ 2019-03-05 17:28:06 -08:00
Greg Fitzgerald 885eeec3ed Boot storage program from the SDK 2019-03-05 07:16:33 -07:00
Greg Fitzgerald 5e9f802d7d Boot token_program from the SDK 2019-03-05 07:16:33 -07:00
Greg Fitzgerald 4f6d7702c5 Add a way to build unsigned transactions 2019-03-04 17:47:46 -07:00
Stephen Akridge 97274030b9 Add test with transaction with no signatures
Add checks for no signature
2019-03-04 16:42:52 -08:00
Greg Fitzgerald 2ec9bc9f05 Revive payments via Budget 2019-03-03 17:29:13 -07:00
Greg Fitzgerald 9c3e7e40cf Less pub 2019-03-02 17:36:51 -08:00
Michael Vines a9a7fc56eb Purge MAX_RECENT_TICK_HASHES 2019-03-02 17:04:42 -08:00
Greg Fitzgerald 398b78dd97
Delete duplicate file 2019-03-02 16:44:36 -08:00
Greg Fitzgerald 1edf6c361e
Move Vote program out of the SDK 2019-03-02 16:44:36 -08:00
Sagar Dhawan b99e3eafdd
Fix stakes not being setup correctly 2019-03-02 16:44:36 -08:00
Greg Fitzgerald e6486b2824
Move Budget out of the SDK 2019-03-02 16:44:36 -08:00
Michael Vines a94880574b block_hash => blockhash 2019-03-02 12:13:30 -07:00
Michael Vines 0f1582c196 cargo fmt 2019-03-02 12:13:30 -07:00
Michael Vines ea110efabd Rename AdvertiseStorageLastId to AdvertiseStorageRecentBlockHash 2019-03-02 12:13:30 -07:00
Michael Vines 176d5e0d37 Rename Transaction last_id field to recent_block_hash 2019-03-02 12:13:30 -07:00
Michael Vines d5de5bec4f Register a new last_id once per slot 2019-03-02 08:47:31 -08:00
Greg Fitzgerald db825b6e26 Fix vote program bugs
Also:

* Add an assertion to the transaction builder if not enough
keypairs were provided for all keys that require signatures.
* Expose bugs in the runtime.
2019-03-02 07:50:32 -07:00
Michael Vines fdc31e99df Clean up type casts 2019-03-01 13:38:17 -08:00
Michael Vines 67b6be66c8 Rename MAX_ENTRY_IDS 2019-03-01 13:38:17 -08:00
Rob Walker 38273427ad
have banks save vote_state by epoch to support stable leader schedules (#3019)
have banks save vote_state by epoch to support stable leader schedules
2019-03-01 11:54:28 -08:00
Michael Vines 224b705f8d Rename genesis_block.last_id() to genesis_block.hash() 2019-03-01 11:48:09 -08:00
Sagar Dhawan 20e4edec61
Refactor Vote Program Account setup (#2992) 2019-02-28 17:08:45 -08:00
Greg Fitzgerald 485ccd20e4 Use TransactionBuilder in the Rewards transaction 2019-02-28 10:53:26 -08:00
Greg Fitzgerald a79caf7795 Test transaction with a fee 2019-02-28 08:56:55 -07:00
Greg Fitzgerald 404aa63147 Add TransactionBuilder 2019-02-28 08:56:55 -07:00
Greg Fitzgerald 4610706d9f Generalize instruction
For serialization: Instruction<u8, u8>
For users:         Instruction<Pubkey, (Pubkey, bool)>
For programs:      Instruction<Pubkey, (Pubkey, bool, Account)>
2019-02-28 08:56:55 -07:00
carllin 033a04129a Add lockouts to vote program (#2944)
* Add lockouts to vote program

* Rename MAX_VOTE_HISTORY TO MAX_LOCKOUT_HISTORY, change process_vote() to only pop votes after MAX_LOCKOUT_HISTORY + 1 votes have arrived

* Correctly calculate serialized size of an Option, rename root_block to root_slot
2019-02-26 22:19:31 -07:00
anatoly yakovenko 6dcb97af9e
Move PohService and PohRecorder out of banking_stage and into fullnode (#2852)
* Move PohService out of banking_stage and into fullnode.

* 10 second slots
2019-02-26 10:48:18 -08:00
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