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