Commit Graph

84 Commits

Author SHA1 Message Date
Anatoly Yakovenko 8bae75a8a6 system contract tests 2018-09-17 14:34:55 -07:00
anatoly yakovenko 6ec0e42220
budget as separate contract and system call contract (#1189)
* budget and system contracts and verification

* contract check_id methods
* system call contract
* verify contract execution rules
* move system into its own file
* allocate before transfer for budget
* store error in budget context
* budget contract and tests without bank
* moved budget of of bank
2018-09-17 13:36:31 -07:00
Anatoly Yakovenko fd36954477 clippy 2018-09-15 05:12:53 -06:00
Michael Vines 9e6d3bf532
Correct spelling 2018-09-10 09:29:01 -07:00
anatoly yakovenko a89b611e9e
comments (#1165) 2018-09-09 07:07:38 -07:00
anatoly yakovenko c34d911eaf
Migrate Budget DSL to use the Account state (#979)
* Migrate Budget DSL to use the Account state instead of global bank data structures.

* Serialize Instruction into Transaction::userdata.
* Store the pending set in the Account::userdata
* Enforce the token balance rules on contract execution. This becomes the entry point for generic contracts.
* This pr will have a performance impact on the bank. The next set of changes will fix this by locking each account during multi threaded execution of all the contracts.
* With this change a contract transaction needs to store its state under an address. That address could be the destination of the tokens, or any random address. For the latter, an extra step would be needed to claim the tokens which isn't implemented by budget_dsl at the moment.
* test tracking issue 1157
2018-09-07 20:18:36 -07:00
Greg Fitzgerald 3ab12076e8 Convert voting functions to methods
More idiomatic Rust.
2018-09-04 05:53:58 -10:00
Greg Fitzgerald 90ae662e4d Fix packet header offset
And update transaction offsets to use the same approach as packet.rs.
Maybe this should be serialized_size(), but thanks to this
GenericArray update, those values are the same.
2018-08-26 14:27:19 -06:00
Greg Fitzgerald 60d8f5489f Update transaction layout offsets
24 less bytes in minimal transactions. 10% TPS boost?
2018-08-26 14:27:19 -06:00
Anatoly Yakovenko a284030ecc Account type with state
comments

fixups!

fixups!

fixups for a real Result<> from get_balance()

on 2nd thought, be more rigorous

Merge branch 'rob-solana-accounts_with_state' into accounts_with_state

update

review comments

comments

get rid of option
2018-08-16 14:44:51 -07:00
anatoly yakovenko 88d6fea999 Revert "Accounts with state (#954)"
This reverts commit c23fa289c3.
2018-08-15 19:44:39 -07:00
anatoly yakovenko c23fa289c3
Accounts with state (#954)
* Account type with state

* fixed test according to @rob-solana
2018-08-15 14:32:11 -07:00
Greg Fitzgerald bca2294655 cargo fmt 2018-08-09 13:41:37 -06:00
Greg Fitzgerald 4a980568ac Rename sig variables to signature
We'll avoid introducing three-letter terms to free up the namespace
for three-letter acronyms.

But recognize the term "sigverify", a verb, to verify a digital
signature.
2018-08-09 13:41:37 -06:00
Greg Fitzgerald ad331e6d56 Rename PublicKey type to Pubkey
Recognize pubkey as a noun meaning the public key of a keypair.
2018-08-09 13:41:37 -06:00
Greg Fitzgerald c2bbe4344e Rename KeyPair to Keypair 2018-08-09 13:41:37 -06:00
Tyera Eulberg 4d77fa900b Add Signature wrapper and supporting traits 2018-08-01 17:00:51 -07:00
Stephen Akridge 7ccd771ccc Only send sigverify to GPU if batch size is >64
Seems to be a decent crossover point for Xeon E5-2620 v4 8c,16t vs. nvidia 1080ti
2018-08-01 16:38:15 -07:00
Tyera Eulberg 7ff721e563 Replace pub field with AsRef impl 2018-08-01 16:15:14 -07:00
Tyera Eulberg cf70e5ff2f Handle wrapped PublicKey struct 2018-08-01 16:15:14 -07:00
Michael Vines 678b2870ff
i 2018-07-27 11:11:37 -07:00
Anatoly Yakovenko be2bf69c93 initial vote stage
wip

voting

wip

move voting into the replicate stage

update

fixup!

fixup!

fixup!

fixup!

fixup!

fixup!

fixup!

fixup!

fixup!

fixup!

update

fixup!

fixup!

fixup!

tpu processing votes in entries before write stage

fixup!

fixup!

txs

make sure validators have an account

fixup!

fixup!

fixup!

exit fullnode correctly

exit on exit not err

try 50

add delay for voting

300

300

startup logs

par start

100

no rayon

retry longer

log leader drop

fix distance

50 nodes

100

handle deserialize error

update

fix broadcast

new table every time

tweaks

table

update

try shuffle table

skip kill

skip add

purge test

fixed tests

rebase 2

fixed tests

fixed rebase

cleanup

ok for blobs to be longer then window

fix init window

60 nodes
2018-07-10 13:32:31 -06:00
Greg Fitzgerald 71f05cb23e Vet timestamp source from contract, not leader
Per @aeyakovenko, contracts shouldn't trust the network for
timestamps. Instead, pass the verified public key to the
contract and let it decide if that's a public key it wants
to trust the timestamp from.

Fixes #405
2018-07-09 08:40:07 -06:00
Greg Fitzgerald f2198c2e9a cargo fmt
rustc 1.27.0

```
$ cargo fmt --version
rustfmt 0.6.1-stable (49279d71 2018-05-08)
```
2018-06-22 22:23:55 -07:00
Greg Fitzgerald fe7d1cb81c Race -> Or
Thanks for the suggestion @FishmanL!
2018-06-07 17:11:03 -06:00
Greg Fitzgerald 3b8b2e030a Better docs for transaction 2018-06-07 09:25:36 -06:00
Anatoly Yakovenko e44e81bd17 fmt 2018-05-30 14:04:48 -06:00
Anatoly Yakovenko f5eedd2d19 fmt 2018-05-30 14:04:48 -06:00
Anatoly Yakovenko d327e0aabd warn on tx verify sig 2018-05-30 14:04:48 -06:00
Greg Fitzgerald 290dde60a0 Test invalid tokens and fees 2018-05-29 20:33:45 -07:00
Greg Fitzgerald 38623785f9 Add fee to Transaction
Fixes #161
2018-05-29 20:33:45 -07:00
Greg Fitzgerald ac0791826a plan.rs -> payment_plan.rs 2018-05-29 18:09:03 -06:00
Greg Fitzgerald d2622b7798 Allow for addtional smart contract languages
Fixes #159
2018-05-29 18:09:03 -06:00
Greg Fitzgerald f82cbf3a27 Move Budget EDSL into its own module 2018-05-29 18:09:03 -06:00
Greg Fitzgerald aa7e3df8d6 Plan -> Budget
Budget is now an EDSL. PaymentPlan is the interface to it.
2018-05-29 18:09:03 -06:00
Greg Fitzgerald ad00d7bd9c Move plan methods to a trait 2018-05-29 18:09:03 -06:00
Greg Fitzgerald 41efcae64b Remove dead code
History: we thought SigVerifyStage would use these, but it does
signature verification before deserializing transactions.
2018-05-29 10:38:58 -06:00
Greg Fitzgerald cf5671d058 tr -> tx
Missed a few.
2018-05-29 10:38:58 -06:00
Greg Fitzgerald 8d26be8b89 Run benchmarks in nightly
And name functions the same way as test functions
2018-05-26 00:36:50 -06:00
Greg Fitzgerald aaeb5ba52f tr -> tx 2018-05-25 16:47:21 -06:00
Greg Fitzgerald ecb3dbbb60 Add witness tx constructors 2018-05-24 10:10:41 -06:00
Greg Fitzgerald cc907ba69d Add Instruction type 2018-05-24 10:10:41 -06:00
Greg Fitzgerald 2e059f8504 Rename TransactionData to Contract
No longer a single place to get all the data that was signed.
2018-05-22 17:00:40 -06:00
Greg Fitzgerald 207b6686d1 Hoist last_id
First step in unifying Witness processing and Transaction processing
2018-05-22 17:00:40 -06:00
Jackson Sandland 44bf79e35f transaction.rs - panic cleanup 2018-05-10 18:24:33 -07:00
Jackson Sandland 02c573986b historian / transaction updates 2018-05-09 17:22:14 -07:00
Jackson Sandland 86c1aaf7d8 transaction.rs - panic cleanup 2018-05-08 22:46:22 -07:00
Greg Fitzgerald 51633f509d Fix test
The test was meant to ensure the signature covered the 'tokens'
field, but then when the 'plan' field was rolled in, Transaction::verify()
started failing because Plan::verify() failed. When Transaction::verify()
was split into two, the unexpected failure was exposed but went unnoticed.
This patch brings it back to its original intent, to ensure signature
verification fails if the network attempts to change the client's payment.
2018-04-11 22:17:21 -06:00
Greg Fitzgerald 705228ecc2 Remove redundant signs 2018-04-11 22:17:21 -06:00
Greg Fitzgerald 6fd32fe850 Cleanup constants 2018-04-06 15:43:05 -06:00