Commit Graph

415 Commits

Author SHA1 Message Date
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
Greg Fitzgerald 4f79a8a204 Use serialized_size - less fragile 2019-01-10 17:05:03 -08:00
jackcmay 0f8ea6872e
Add missing error counters and load_account test cases (#2327) 2019-01-08 09:20:25 -08:00
Pankaj Garg 91bd38504e
Use vote signer service in fullnode (#2009)
* Use vote signer service in fullnode

* Use native types for signature and pubkey, and address other review comments

* Start local vote signer if a remote service address is not provided

* Rebased to master

* Fixes after rebase
2019-01-05 12:57:52 -08:00
jackcmay 3f60d98163
Update comments (#2310) 2019-01-04 19:19:56 -08:00
Michael Vines 58f2598d5d Revert "Validators make a transaction to advertise their storage last_id"
This reverts commit a1759aed19.
2018-12-23 14:02:09 -08:00
Stephen Akridge a1759aed19 Validators make a transaction to advertise their storage last_id
* Also implement more storage contract logic
* Add transactions for proof validation,
* Move storage state members into system storage account userdata
2018-12-21 15:45:30 -08:00
Michael Vines fd562cb9e2 Rust 2018 cleanup 2018-12-14 21:57:15 -08:00
Michael Vines aaa5cd4615 Remove stray keygen 2018-12-14 21:57:15 -08:00
Stephen Akridge 7cdbbfa88e Storage stage updates
* Remove logging init from storage program: saw a crash in a test
  indicating the logger being init'ed twice.
* Add entry_height mining proof to indicate which segment the result is
  for
* Add an interface to get storage miner pubkeys for a given entry_height
* Add an interface to get the current storage mining entry_height
* Set the tvu socket to 0.0.0.0:0 in replicator to stop getting entries
  after the desired ledger segment is downloaded.
* Use signature of PoH height to determine which block to download for
  replicator.
2018-12-13 11:30:12 -08:00
Michael Vines 282d4a3563 Move solana-keygen into keygen/ 2018-12-13 01:06:40 -08:00
Michael Vines cafeef33c3 Relocate all keypair generation into one location: sdk/src/signature.rs 2018-12-13 01:06:40 -08:00
Greg Fitzgerald 0a83b17cdd
Upgrade to Rust 1.31.0 (#2052)
* Upgrade to Rust 1.31.0
* Upgrade nightly
* Fix all clippy warnings
* Revert relaxed version check and update
2018-12-07 20:01:28 -07:00
Michael Vines 214ed3667c Move system_transaction out of src/ 2018-12-05 10:49:06 -08:00
Michael Vines 122627dda2 Move loader_transaction out of src/ 2018-12-05 10:49:06 -08:00
Michael Vines 7af95eadcc Move vote_transaction out of src/ 2018-12-05 10:49:06 -08:00
Michael Vines 9ee858a00c Move budget_program out of src/ 2018-12-05 10:49:06 -08:00
Michael Vines 27d456bf93 Move storage_program out of src/ 2018-12-05 10:49:06 -08:00
Michael Vines ea6e042a6f Move vote_program out of src/ 2018-12-05 10:49:06 -08:00
Michael Vines a594f56c02 Add token_program.rs to sdk/ 2018-12-05 10:49:06 -08:00
Michael Vines f184d69c7a Add account userdata errors 2018-12-05 10:49:06 -08:00
Michael Vines 9a4f8199d6 Move system_program out of src/ 2018-12-05 10:49:06 -08:00
Michael Vines 63a758508a Add sdk native_loader.rs 2018-12-05 10:49:06 -08:00
Michael Vines 777a0a858e Move ProgramError into sdk/ 2018-12-03 13:50:00 -08:00
Sagar Dhawan 34c3a0cc1f
Add signature verification to gossip (#1937) 2018-12-01 12:00:30 -08:00
Michael Vines bad0b55ab6 Expose which keys signed the Transaction in the SDK 2018-11-30 08:16:23 -08:00
Michael Vines 3822c29415 Route program_id to program entrypoint 2018-11-17 19:42:03 -08:00
Michael Vines 38883d1de4 Clarify comment 2018-11-17 16:40:23 -08:00
Michael Vines d96a6b42a5 Move drone into its own crate 2018-11-16 20:42:21 -08:00
Michael Vines 6ac5700f2e Move metrics into its own crate 2018-11-16 15:10:07 -08:00
Michael Vines 5a8938209b Expose tick_height to native programs 2018-11-14 10:33:27 -08:00
Michael Vines 0bf2ff6138 Add convenience macro for native program entrypoint 2018-11-14 10:33:27 -08:00
Michael Vines e33f3a2562 Publish expected native program entrypoint in sdk/ 2018-11-14 10:33:27 -08:00
Michael Vines 15c00ea2ef Improve comments 2018-11-12 10:59:01 -08:00
Michael Vines 522876c808 Rename Account.program_id to Account.owner 2018-11-12 10:59:01 -08:00
Michael Vines 49f4be6a2b codemod --extensions rs loader_program_id loader 2018-11-12 10:59:01 -08:00
Greg Fitzgerald c9138f964b Change token type from i64 to u64
Fixes #1526
2018-11-05 15:25:26 -07:00
Michael Vines 40e945b0c8 Move token_program from src/ to programs/native/ 2018-11-02 18:13:02 -07:00
Michael Vines 1733beabf7 mv common/ sdk/ 2018-10-25 13:26:10 -07:00