Commit Graph

8994 Commits

Author SHA1 Message Date
Jude Nelson
cb5ab9b447 test structure update 2019-03-09 18:51:12 -05:00
Jude Nelson
e72bc0fb9a document possibility of including a Stacks PoW solution in a leader block commit 2019-03-09 18:50:50 -05:00
Jude Nelson
2e471a937a update block snapshot to include a running sortition burn total and include a parent block back pointer 2019-03-09 18:50:27 -05:00
Jude Nelson
6f63b3d09a copyright update 2019-03-09 18:50:07 -05:00
Jude Nelson
175109845a move db-generic code to chainstate 2019-03-09 18:49:51 -05:00
Jude Nelson
24f26d9e3b block snapshots now include a parent pointer and a running total of the number of tokens burnt for the next upcoming sortition 2019-03-09 18:49:22 -05:00
Jude Nelson
70469cb5ee burnchain blocks now include parent backpointers; include a privatekey trait 2019-03-09 18:49:03 -05:00
Jude Nelson
f1684c87a4 add a test to ensure that the burn quota increments and decrements correctly 2019-03-09 18:48:37 -05:00
Jude Nelson
d2de680604 now implemented in util::secp256k1 2019-03-09 18:48:13 -05:00
Jude Nelson
f9844325a8 burnchain blocks now store parent pointers 2019-03-09 18:47:57 -05:00
Jude Nelson
b9e06f4409 make BurnchainTxInput::to_address_bits() a member method, not a static method 2019-03-09 18:47:40 -05:00
Jude Nelson
31337a95ab add c32 encode/decode to Bitcoin addresses (for now) 2019-03-09 18:47:15 -05:00
Jude Nelson
cad5a71fb4 run c32 tests 2019-03-09 18:46:59 -05:00
Jude Nelson
5ab17c6ec7 update/clarify SIP 003 per Aaron's feedback 2019-03-09 18:46:25 -05:00
Jude Nelson
8f92cd267d update MicroblocksInvData 2019-03-05 18:21:09 -05:00
Jude Nelson
5ab0d05d0d significantly revise the heuristics for promoting route and node diversity, and better describe the frontier set vs neighbor set distinction. also, the wire format example was wrong -- should be big-endian 2019-03-05 17:51:50 -05:00
Jude Nelson
5e25941ec4 lint more 2019-02-27 22:22:13 -05:00
Jude Nelson
9a4c2da56f lint 2019-02-27 22:21:28 -05:00
Jude Nelson
0ea56373ff add SIP 003 to describe the peer network 2019-02-27 22:19:11 -05:00
Jude Nelson
c2078ad55e Merge branch 'develop' into develop-jude 2019-02-19 14:09:34 -05:00
Aaron Blankstein
062c4da74c Merge pull request #921 from blockstack/review/smart-contract-021319
Code Review: Smart Contract VM 02/13/19
2019-02-19 13:01:47 -06:00
Aaron Blankstein
0634a0964c Merge branch 'feature/smart-contract-vm' into review/smart-contract-021319 2019-02-19 11:30:05 -06:00
Aaron Blankstein
29a0225531 light cleaning up of test functions 2019-02-19 11:28:30 -06:00
Aaron Blankstein
bb203956e7 rename MultiplyDefined error to VariableDefinedMultipleTimes 2019-02-19 10:40:22 -06:00
Aaron Blankstein
74e45cbcb8 implement partialeq, hash for ListData and TupleData manually: allows Value to derive. remove now uneccessary Hash traits. 2019-02-19 10:19:16 -06:00
Aaron Blankstein
f3177eece8 implement equality for Value enum 2019-02-19 09:47:23 -06:00
Jude Nelson
8a2f742694 add uint 2019-02-18 22:00:58 -05:00
Jude Nelson
aac244a5f6 burnchain::new can fail 2019-02-18 22:00:50 -05:00
Jude Nelson
ac60f8858e the check() method for operations returns a CheckResult enum now to encode specific kinds of errors (instead of a catch-all bool). Add tests for each check() method and make sure they all fail in the right way. 2019-02-18 22:00:01 -05:00
Jude Nelson
b6a6ee4fe6 implement sortition hashes -- a rolling hash over block headers from the PoW chain that gets mixed with a VRF seed 2019-02-18 21:59:30 -05:00
Jude Nelson
8eba37aab8 SortitionHash's will be stored in a BlockSnapshot, so make them insertable into rows 2019-02-18 21:58:52 -05:00
Jude Nelson
95a0d24057 flesh out unit tests; expand snapshot code to accomodate sortition results; add method to query the last successful sortition; add a few more methods needed for checking operations 2019-02-18 21:58:10 -05:00
Jude Nelson
038eba12a0 some type refactoring to better represent various burnchain configurations 2019-02-18 21:57:47 -05:00
Jude Nelson
60d36a3d3a refactor the burnchain "main loop" to only insert user burns that supported block commits in this block (and ignoring all others), and to make it easier to test cryptographic sortition. Add cryptographic sortition tests. 2019-02-18 21:57:04 -05:00
Jude Nelson
217c7f4e73 to_address_bits() should just return the 20-byte hash, not the scriptpubkey 2019-02-18 21:56:37 -05:00
Jude Nelson
e4dabe358d add macros and implementations for 256-bit and 512-bit integers (borrowed with gratitude from rust-bitcoin) 2019-02-18 21:56:11 -05:00
Jude Nelson
32883c8934 Update the BlockSnapshot code to generate a burn distribution over its blocks and select a winning block using cryptographic sortition. The burn distribution will be sampled using the hash of the PoW block header and the last successful sortition's VRF seed. 2019-02-18 21:55:20 -05:00
Jude Nelson
dde76d520c Separate out code and tests for calculating a burn distribution -- a Vec of BurnSamplePoints. This allows us to take a block's worth of block commits and user burns, and figure out the total burns behind each candidate block. This code also takes the integer range [0, 2**256 - 1) and partitions it into disjoint ranges representing sets of possible sortition hashes whose sizes are proportional to how much burn support there is behind each block. 2019-02-18 21:52:48 -05:00
Aaron Blankstein
241b3cc49f separate two kinds of contexts (local and global) into two types 2019-02-18 12:29:17 -06:00
Aaron Blankstein
8791851bbf use two types for public and private functions 2019-02-18 09:46:53 -06:00
Aaron Blankstein
476cd7f1a0 use [u8;20] array instead of vec for principal type 2019-02-18 09:28:48 -06:00
Aaron Blankstein
c62297dde7 handle the sender argument to contract execution 2019-02-18 09:18:24 -06:00
Aaron Blankstein
d062cd9859 return error from size() instead of panics on overflow. 2019-02-18 09:15:02 -06:00
Aaron Blankstein
96c6085362 add Principal type. implement c32 address decoding/encoding. 2019-02-15 17:28:28 -06:00
Aaron Blankstein
0056fe96c6 require type parameters in define-public 2019-02-14 15:32:50 -06:00
Aaron Blankstein
59de9365f9 use loose type admission for buffers and tuples as well as lists 2019-02-14 13:05:07 -06:00
Aaron Blankstein
1f6aac5b93 update admits() logic for buffers. add test for more complex type signature in a data map 2019-02-13 14:07:04 -06:00
Aaron Blankstein
bc24cc34ea oops, type forcing 2019-02-13 08:59:24 -06:00
Aaron Blankstein
233a26d100 do value size checks in type instantiations 2019-02-13 08:34:07 -06:00
Aaron Blankstein
961886bbcc drop the string-based type descriptors in favor of the structural descriptors from SIP-002 2019-02-12 09:56:02 -06:00