Commit Graph

159 Commits

Author SHA1 Message Date
Paul Hauner
01f3b2f0c1
Update BeaconChain w/ new genesis code 2018-12-13 17:33:53 +11:00
Paul Hauner
493a16ac18
Update attestation_validator for spec updates 2018-12-13 17:33:16 +11:00
Paul Hauner
96c2012434
Add canonical_hash method to BeaconState 2018-12-13 17:32:48 +11:00
Paul Hauner
220a5bad76
Add clone method to some types 2018-12-13 17:32:17 +11:00
Paul Hauner
06e1ee0e5f
Add extra params to ChainSpec 2018-12-13 16:01:04 +11:00
Paul Hauner
4f0a223579
Change some ShardAndCommittee -> ShardCommittee 2018-12-13 12:28:37 +11:00
Paul Hauner
6847e68c5e
Move genesis code into its own crate 2018-12-13 12:27:45 +11:00
Paul Hauner
bf49c881d5
Introduce un-tested BeaconState genesis code. 2018-12-12 18:36:12 +11:00
Paul Hauner
56dc73fbd1
Update some shard u16 to u64
This is pretty hacky, is just serving my purpose for `BeaconChain`.
These structs will need to be fully updated to the latest spec.
2018-12-12 18:35:31 +11:00
Paul Hauner
92786520e4
Update (hacky) validator induction and shuffling.
This allows the `BeaconChain` struct to be updated but it doesn't bring
these functions in line with the spec.
2018-12-12 18:32:19 +11:00
Paul Hauner
c944c435e2
Update CrosslinkRecord to latest spec
Addresses #100
2018-12-12 18:30:20 +11:00
Paul Hauner
89bea5b5e8
Update BeaconState rename ShardCommittee
Both structs are now consistent with the spec.

Addresses #100
2018-12-12 18:25:21 +11:00
Paul Hauner
211d3961a0
Add ChainSpec structure.
It includes all constants from the
[Constants](https://github.com/ethereum/eth2.0-specs/blob/master/specs/core/0_beacon-chain.md#attestation)
section in the spec, except for things that are clearly enums.

My reasoning is that these enums are not so much "chain specification"
and this struct should be reserved for items that "configure" the chain.
2018-12-12 16:08:01 +11:00
Paul Hauner
4d0641636e
Rename AttestationRecord -> Attestation 2018-12-12 12:16:11 +11:00
Paul Hauner
4fdc2e4ac6
Merge branch 'master' into attestation-update 2018-12-12 09:45:14 +11:00
Paul Hauner
f29d7961fd
Merge pull request #87 from ralexstokes/fix-boolean-bitfield-serde-bug
Fix boolean bitfield serde bug
2018-12-12 09:36:54 +11:00
Alex Stokes
6c2c42e6b7
Adds custom std::cmp::PartialEq impl
Two bitfields now match if they contain the same information.

There were some discrepancies before when comparing fields with the same
bits set but came from different sources, e.g. off the wire vs created
in memory, due to the existence of unset bits in the high byte.
2018-12-10 20:34:35 -08:00
Alex Stokes
1ffd9e10b3
Fixes bug with attestation validation that arose from change to API 2018-12-10 20:33:43 -08:00
Alex Stokes
4d43de1cea
rustfmt edits 2018-12-10 20:32:44 -08:00
Paul Hauner
3ae82c0710
Strip out anitquated parts of chain crate 2018-12-10 10:48:02 +11:00
Paul Hauner
7ea701aa30
Remove old block processing code 2018-12-10 09:54:25 +11:00
Paul Hauner
a35a28f522
Remove old validation crate 2018-12-10 09:48:41 +11:00
Paul Hauner
0f9482f9d1
Complete attestation_validation, bar tests 2018-12-10 09:33:57 +11:00
Paul Hauner
a8bfa4d733
Add more attestation validation tests 2018-12-07 08:59:05 +11:00
Paul Hauner
2d2da001b9
Implement tests for attestation validation 2018-12-06 19:50:33 +11:00
Paul Hauner
36bda7502b
Implement signature verification test 2018-12-06 18:41:22 +11:00
Paul Hauner
3533b8b892
Add untested attestation validation logic 2018-12-06 18:16:03 +11:00
Paul Hauner
d4b6d81c9d
Merge branch 'beacon-state-pub-fields' into attestation-update 2018-12-05 09:46:50 +11:00
Paul Hauner
140df1a689
Make all BeaconState fields public (doh!) 2018-12-05 09:45:03 +11:00
Alex Stokes
564f13be5f fixes bug with serialization logic for boolean bitfield
should match the python impl
2018-12-03 20:46:11 -08:00
Paul Hauner
e0360edde0
Update ssz_utils for new AttestationRecord. 2018-12-04 14:50:47 +11:00
Paul Hauner
6e0daec1da
Update AttestationData struct 2018-12-04 14:50:32 +11:00
Paul Hauner
bedc1abec0
Add failing boolean bitfield test 2018-12-03 17:13:39 +11:00
Paul Hauner
1e3fd1ff80
Add ssz encode/decode for AttestationData 2018-12-03 16:19:31 +11:00
Paul Hauner
430bc224a4
Update BeaconState object
Also adds the following structs:

- AttestationData
- ForkData
- PendingAttestationRecord

The `AttestationRecord` object has _not_ been updated.
2018-12-03 14:29:05 +11:00
Paul Hauner
54db7b5272
Merge pull request #76 from sigp/state-merge
Add new `State` type and dependant types

Closes #73
2018-11-27 15:10:06 +11:00
Paul Hauner
3ed4de65d2
Add new State type and dependant types 2018-11-25 15:39:50 +11:00
mjkeating
d6bf1a6119 removed unnecessary call to saturated_sub() in vec_shuffle 2018-11-23 19:29:03 -08:00
Paul Hauner
f65888226a Add some extra tests for boolean-bitfield 2018-11-22 14:18:08 -08:00
Alex Stokes
a695382260 Run cargo fmt that got clobbered in merge 2018-11-20 12:54:35 -08:00
Alex Stokes
11cdf66079 Remove warning about unused import 2018-11-20 12:51:51 -08:00
Alex Stokes
57dcad149f Fixes bug with ssz encoding of BooleanBitfield 2018-11-20 12:40:13 -08:00
Alex Stokes
031b7bf225 Add method to calculate the underlying number of bytes
Required for part of attestation validation logic
2018-11-20 12:40:13 -08:00
Alex Stokes
72cf7ad1bd Begin updating tests to reflect changes to bitfield 2018-11-20 12:40:13 -08:00
Alex Stokes
832d1bd295 Update bitfield to expand size when writing out-of-bounds 2018-11-20 12:38:23 -08:00
Alex Stokes
37b05e1a5b get tests passing (except one) 2018-11-20 12:38:23 -08:00
Alex Stokes
a9decd3aed Simplifies the boolean-bitfield implementation to use bit-vec crate 2018-11-20 12:34:28 -08:00
Paul Hauner
900ffac5e0
Run rustfmt globally.
Using `$ cargo fmt` in the root. Closes #68.
2018-11-04 15:35:55 +01:00
Paul Hauner
46da9b670f
Add untested minimum viable block processing 2018-10-30 15:49:32 +01:00
Paul Hauner
7f21fd325e
Add initial works on extending the chain 2018-10-25 10:14:43 +02:00