Commit Graph

212 Commits

Author SHA1 Message Date
Hsiao-Wei Wang f2df4bf5c8
Merge branch 'dev' into refactor-spec-builder2 2021-04-19 23:14:30 +08:00
Sam.An 9e4f5c1879
changed alphabet string to string module.
changed alphabet string to string module.
2021-04-19 22:41:45 +09:00
Hsiao-Wei Wang 5349645a8f
Rename `SpecAdjustment` to `SpecBuilder` and add `build_spec` interface 2021-04-16 11:29:10 +08:00
Hsiao-Wei Wang e8c3d28a86
Merge branch 'dev' into refactor-spec-builder2 2021-04-16 11:03:57 +08:00
Danny Ryan 2ac19be198
Merge pull request #2331 from BenSchZA/BenSchZA-patch-1
Update variable name ALTAIR_INVAIANT_CHECKS to INVARIANT in `setup.py`
2021-04-15 07:20:14 -05:00
Danny Ryan 2baeee463d
Merge pull request #2322 from mkalinin/merge-cleanup
Merge cleanups and improvements
2021-04-15 07:17:55 -05:00
BenSchZA 35fea7a11b Update copy INVAIANT to INVARIANT 2021-04-14 21:37:25 +02:00
Danny Ryan 320172fb08
fix lint 2021-04-14 08:02:09 -05:00
Alex Stokes 18fc7c0498
Merge pull request #2311 from ralexstokes/add-altair-val-tests
Add some basic tests for Altair validator guide
2021-04-12 15:19:44 -07:00
Alex Stokes 4bf6331c21
update remerkleable 2021-04-12 15:11:21 -07:00
Hsiao-Wei Wang 79230c5f68
Update pyspec builder 2021-04-10 03:04:27 +08:00
Hsiao-Wei Wang 3320ebb865
Fix typo and add `SpecAdjustment.fork` property 2021-04-09 22:39:12 +08:00
Hsiao-Wei Wang ceb352be12
Refactor `imports_and_predefinitions` into `imports` and `preparations` 2021-04-09 22:17:01 +08:00
Hsiao-Wei Wang 1ffa436836
Update `imports_and_predefinitions` 2021-04-09 21:28:58 +08:00
Hsiao-Wei Wang 658ede2191
Refactor pyspec builder with `SpecAdjustment` classes 2021-04-09 21:12:05 +08:00
Danny Ryan af9ea0efb6
Merge branch 'dev' into merge-exe 2021-04-09 07:21:51 -05:00
Hsiao-Wei Wang 6e8b4b3ea9
Add eth2spec.merge.spec 2021-04-08 05:57:16 +08:00
Hsiao-Wei Wang 0bbef67efe
Add ALTAIR_INVAIANT_CHECKS, checks the weight configurations 2021-04-06 00:08:30 +08:00
protolambda 1acb1d6f70
disable phase1 pyspec build 2021-03-26 22:37:32 +01:00
Hsiao-Wei Wang 2ce389216d
Executable Altair validator guide 2021-03-19 23:38:59 +08:00
Hsiao-Wei Wang 32d0c8087f
Fix `NEXT_SYNC_COMMITTEE_INDEX` 2021-03-15 23:17:59 +08:00
Hsiao-Wei Wang a2268a432c
Fix missing --cov-report 2021-03-15 19:20:36 +08:00
Hsiao-Wei Wang 310301236f
Fix typo 2021-03-12 20:29:28 +08:00
Hsiao-Wei Wang 22fe06829b
Refactor `objects_to_spec` 2021-03-12 20:26:26 +08:00
Hsiao-Wei Wang c34eae33d0
Merge branch 'dev' into lightclient-sync-exe 2021-03-12 00:49:29 +08:00
Hsiao-Wei Wang b44e576e95
LIGHTCLIENT_PATCH/HF1 -> ALTAIR 2021-03-11 21:32:00 +08:00
Danny Ryan c36106e630
put snappy in 'generator' extra dep build and use for generator builds 2021-03-10 17:18:11 -07:00
Danny Ryan 813608928c
Merge branch 'dev' into tests-compression 2021-03-10 16:43:02 -07:00
Danny Ryan 36b6f8c3bf
Merge branch 'dev' into lightclient-sync-exe 2021-03-10 16:25:01 -07:00
Danny Ryan fab27d17f0
Merge pull request #2223 from ethereum/bump-py_ecc
Bump py_ecc to v5.2.0
2021-03-10 16:19:14 -07:00
Hsiao-Wei Wang 91f6956b3a
Bump py_ecc to 5.2.0 2021-03-10 21:55:50 +08:00
Danny Ryan 6bd1efc73b
rename fork files 2021-03-08 17:16:13 -07:00
Danny Ryan 6df3de8506
Merge pull request #2199 from ethereum/turn_off_phase1_testgen
[testgen] turn off phase 1, turn on HF1, and refactoring
2021-02-22 13:28:19 -06:00
Justin a28b2d7349
Bump Milagro dependency for M1 support 2021-02-20 15:29:34 +00:00
Hsiao-Wei Wang e58dcb40ac
Clean up and kick the cache 2021-02-18 17:51:01 +08:00
Hsiao-Wei Wang 844c879f1c
Bump `py_ecc` and `milagro_bls_binding` (#2169)
* Bump py_ecc to v5.1.0 and milagro_bls_binding to v1.6.2

* python3.8 -> python3 for py39 compatibility

* fix

* Try python:3.9

* Revert: using Python3.8 in CI now
2021-01-05 21:00:52 +08:00
Hsiao-Wei Wang d01a4ad823
Fix depth calculation...again(!) and add unittests 2020-12-16 15:01:22 +08:00
Hsiao-Wei Wang bcde37c39f
Make `sync-protocol.md` pass the linter 2020-12-15 13:24:43 +08:00
Hsiao-Wei Wang acfe49e3f3
executable light client patch: beacon-chain.md (#2141)
* Bump remerkleable to 0.1.18

* Disable `sync-protocol.md` for now. Make linter pass

* Enable lightclient tests

* Use *new* `optional_fast_aggregate_verify`

* Fix ToC and codespell

* Do not run phase1 tests with Lightclient patch

* Fix the Eth1Data casting bug. Add a workaround.

* Fix `run_on_attestation` testing helper

* Revert

* Rename `optional_fast_aggregate_verify` to `eth2_fast_aggregate_verify`

* Apply Proto's suggestion

* Apply Danny's suggestion

* Fixing tests

* Fix after rebasing

* Rename `LIGHTCLIENT` -> `LIGHTCLIENT_PATCH`

* New doctoc

* Add lightclient patch configs

* fix gitignore light client patch generator output

* Upgrade state for light client patch

* Add `lightclient-fork.md` to deal the fork boundary and fix
`process_block_header`

* Misc cleanups

1) Add a summary note for every function that is changed.
2) Avoid changing `process_block` (instead only change `process_block_header`).
3) Rename `G2_INFINITY_POINT_SIG` to `G2_POINT_AT_INFINITY` to avoid `SIG` contraction.
4) Misc cleanups

* Update block.py

* Update beacon-chain.md

* Fix typo "minimal" -> "mainnet"

Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com>

* Use the new `BeaconBlockHeader` instead of phase 0 version

* Update config files

* Move `sync_committee_bits` and `sync_committee_signature` back to `BeaconBlockBody`

Co-authored-by: protolambda <proto@protolambda.com>
Co-authored-by: Justin <drakefjustin@gmail.com>
Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com>
2020-12-15 13:18:20 +08:00
Hsiao-Wei Wang 4df3547edf
Make `lightclient` patch pass the linter (#2133)
* Make `lightclient` an executable patch fork

* fix conflicts

* Fix ToC

* Lightclient -> Light client

* Try protolambda/remerkleable#8

* Fix sync-protocol.md ToC

* Build lightclient/sync-protocol

* Fix typo

Co-authored-by: vbuterin <v@buterin.com>

Co-authored-by: vbuterin <v@buterin.com>
2020-11-17 10:41:26 +08:00
Hsiao-Wei Wang 00a19e583e
Bump milagro_bls_binding to 1.5.0 2020-10-06 16:17:29 +08:00
Hsiao-Wei Wang 4d3ac72473
Bump milagro_bls_binding to `1.4.0`, handle the exception cases 2020-10-05 21:55:49 +08:00
Hsiao-Wei Wang 4613c6b333
Bump py_ecc to 5.0.0 2020-10-01 00:44:47 +08:00
Danny Ryan 68bcc19e09
Merge pull request #1957 from ethereum/testgenphase1
Enable test generation for phase1
2020-09-18 08:44:38 -06:00
Danny Ryan 177f88962e
Merge pull request #2073 from ethereum/weak-subjectivity-guide
Weak subjectivity guide
2020-09-17 12:07:19 -06:00
Danny Ryan 8bb05827ab
add weak-subjectivity.md to setup.py build and do final lint cleanups 2020-09-17 12:01:25 -06:00
Hsiao-Wei Wang 5374890da0
Merge branch 'dev' into testgenphase1 2020-09-17 21:11:49 +08:00
protolambda 28137a6176
Merge branch 'dev' into testgenphase1 2020-09-09 23:43:26 +02:00
Hsiao-Wei Wang 6e900f4fcc
Add more typings, no substantive change 2020-09-03 19:27:16 +08:00
ericsson a380f3e1b1 `ceillog2` accepts positive integers now 2020-09-01 11:07:44 +03:00
ericsson 6df35fc3b5 Make `cellog2` return `uint64` so that `CUSTODY_RESPONSE_DEPTH` has `uint64` type 2020-08-31 19:41:57 +03:00
Hsiao-Wei Wang 6289664260
Update testing context
1. Add `with_configs` decorator to assign available configs
2. Add `only_full_crosslink` decorator to detect if the configuation can
do full crosslinking
3. Add `context.is_pytest` flag: True if calling via pytest. False if
calling from test generator.
2020-08-12 21:50:14 +08:00
Hsiao-Wei Wang e3bbf3c702
Merge branch 'dev' into shard-fork-choice-fix 2020-07-29 23:55:30 +08:00
Hsiao-Wei Wang bd5346b624
Merge pull request #1989 from ethereum/enable-bls-citest
Enable Milagro BLS in CI
2020-07-29 23:54:53 +08:00
Hsiao-Wei Wang f6fd151872
Merge branch 'dev' into shard-fork-choice-fix 2020-07-29 00:15:41 +08:00
protolambda 230e5ce345
remove outdated hash cache, use less memory 2020-07-24 01:19:50 +02:00
Hsiao-Wei Wang e7f070d525
Use `hash_tree_root` to generate `ShardBlockHeader.body_root`
Include the mix-in length to the proof.
2020-07-24 02:09:25 +08:00
Hsiao-Wei Wang 8e82ca5d1a
Merge branch 'dev' into hwwhww/new_int_to_bytes_dev 2020-07-16 01:36:19 +08:00
Hsiao-Wei Wang 6e3a7ad8f2
Merge branch 'dev' into hwwhww/strict-uint64-2 2020-07-15 23:02:51 +08:00
Hsiao-Wei Wang bb3c360734
Handle the dependencies order of dataclass objects 2020-07-14 17:41:33 +08:00
protolambda bc35dc410b
fix block data root type, thanks @ericsson49 2020-07-08 15:40:49 +02:00
Hsiao-Wei Wang 2c0595da01
PR feedback from Danny 2020-06-30 00:11:43 +08:00
Hsiao-Wei Wang d3f2344e45
Add CustodySlashing block test and fix `get_attesting_indices` cache 2020-06-29 20:56:36 +08:00
protolambda 3b7617f51a
make extracted byte uint8 for bitshift, do not use negative slice indexing, avoid negative comparison in test 2020-06-26 16:14:27 +02:00
protolambda 3fb0257cbb
update remerkleable for uint and mypy improvements 2020-06-26 15:57:53 +02:00
Hsiao-Wei Wang 94c231cf98
Fix `ShardTransition.shard_data_roots` and add test
1. Fix `ShardTransition.shard_data_roots`: use `get_block_data_merkle_root` helper to calculate it.
2. Rework `get_valid_custody_chunk_response` testing helper: accept
`block_length_or_custody_data`
3. Add `test_with_custody_challenge_and_response` test
2020-06-26 01:46:45 +08:00
Hsiao-Wei Wang a061758a66
Use `encode_bytes` to implement `int_to_bytes`
Rename `bytes_to_int` to `bytes_to_uint64`

Use `encode_bytes` to implement `int_to_bytes`

Rename `int_to_bytes` to `uint_to_bytes` and move it to `ssz_impl.py`
2020-06-25 20:20:39 +08:00
Hsiao-Wei Wang 76840c9178
Merge branch 'dev' into hwwhww/strict-uint64 2020-06-19 17:01:04 +08:00
protolambda 41ebd51aff
Merge branch 'dev' into hwwhww/strict-uint64 2020-06-18 02:49:09 +02:00
protolambda 9b60a9b799
Avoid state usage in p2p validation, compute committee count per slot for epoch as a whole 2020-06-17 20:19:32 +02:00
Danny Ryan 759185632f
Merge branch 'dev' into phase1-validator 2020-06-16 16:07:20 -06:00
Danny Ryan 65a739fe41
Merge branch 'dev' into phase1-validator 2020-06-08 15:50:51 -06:00
Hsiao-Wei Wang 41cfa7fdf6
Merge branch 'dev' into dankrad-custody-256bit 2020-06-09 01:39:51 +08:00
Danny Ryan b1ff00aab0
Merge branch 'dev' into phase1-validator 2020-06-03 12:18:17 -06:00
Hsiao-Wei Wang 58e75c27ed
Merge branch 'dev' into hwwhww/shard_fork_choice 2020-06-04 00:56:25 +08:00
Danny Ryan d1647c28e0
Merge branch 'dev' into phase1-validator 2020-06-03 10:43:42 -06:00
Danny Ryan 3a4db69a20
Merge branch 'dev' into dankrad-custody-256bit 2020-06-01 18:45:22 -06:00
Hsiao-Wei Wang 63de59d5f6
Merge branch 'dev' into hwwhww/shard_fork_choice_3 2020-05-30 03:57:17 +08:00
Hsiao-Wei Wang 2dc041807a
Implement `get_start_shard` 2020-05-30 01:26:00 +08:00
Danny Ryan 7770accf96
Merge pull request #1803 from ethereum/fast-bls-option
BLS options for pyspec
2020-05-20 14:39:49 -06:00
protolambda 87005c6f10
milagro bls 1.3 with improved error handling 2020-05-20 22:32:47 +02:00
Danny Ryan 96f785e84b
ensure only forward progress with eth1data voting 2020-05-20 13:56:43 -06:00
Hsiao-Wei Wang f72d14a747
Bump `milagro_bls_binding` to 1.2.0
Also verify it in BLS test generator
2020-05-21 01:37:12 +08:00
protolambda 796e372c5e
remerkleable 0.1.16 2020-05-20 15:30:44 +02:00
Hsiao-Wei Wang 21a4143d99
Merge branch 'dev' into fast-bls-option 2020-05-20 16:26:43 +08:00
Hsiao-Wei Wang 4c5d2c25b3
Bump remerkleable to 0.1.15 2020-05-20 14:37:15 +08:00
Hsiao-Wei Wang ed194de26b
Bump py_ecc to v4.0.0 (IETF BLS v2 + H2C v7) 2020-05-13 02:27:51 +08:00
Hsiao-Wei Wang 78d83b6c7d
Bump py_ecc to v3.0.0 (IETF BLS v2 + H2C v6) 2020-05-12 12:21:35 +08:00
protolambda b1c2c6e3a2
Default BLS to ON, keep CI BLS off for now, add milagro option 2020-05-11 19:18:49 +02:00
Danny Ryan b2c36112f6
Merge branch 'dev' into v012x 2020-05-05 09:44:27 -06:00
Hsiao-Wei Wang dab5a936c4
wip shard fork choice rule 2020-05-05 21:41:46 +08:00
Hsiao-Wei Wang ee4c866575
Merge branch 'dev' into dankrad-custody-256bit-merging 2020-05-05 15:22:36 +08:00
Hsiao-Wei Wang 4558c7db4e
Reorg the file structure 2020-05-02 02:32:37 +08:00
Dankrad Feist ab2ee0e2c2
Restoring chunk challenges and testing 2020-04-24 17:06:27 +01:00
Hsiao-Wei Wang 6fdee75475
Fix phase0 types 2020-04-17 23:55:25 +08:00
protolambda 13d1303db8
update remerkleable; mul/div bound checks, update config loading 2020-04-06 18:40:09 +02:00
Danny Ryan d61b2991a0
fix lint 2020-04-02 16:58:39 -06:00
protolambda 93ff016e76
fix base-reward lru size, fix indent, change total-active-balance key 2020-03-23 20:35:50 +01:00
protolambda 33f8f4936d
Fix base-reward memoization bug, improve memoization with LRU, and improve misc rewards test 2020-03-20 21:15:13 +01:00
Danny Ryan 42499a01e7
Merge pull request #1657 from ethereum/fix-ssz-generic-tests
Fix generic SSZ tests, update remerkleable with small bugfix
2020-03-11 16:29:28 -06:00
protolambda 22620bfe5d
Fix generic SSZ tests, update remerkleable with small bugfix 2020-03-11 23:18:06 +01:00
Danny Ryan 81dc71c312
Merge pull request #1652 from ethereum/gossip-topics-with-fork-digest
Gossip topics with fork digest
2020-03-11 13:32:25 -06:00
Danny Ryan 36e48fba99
enforce must match target to match head to avoid perverse incentive path 2020-03-11 12:51:05 -06:00
Danny Ryan 0881e21dc5
cleanup gossip topic fork digest based on PR feedback 2020-03-11 12:02:31 -06:00
Danny Ryan 7e04989e29
add genesis_validators_root to beaconstate and utilize in sig domain separation as well as fork separation 2020-03-05 09:21:32 -07:00
protolambda 1a16e9a3ab
version eth2spec 2020-02-05 18:38:21 +01:00
protolambda 3184ade0f3
version stub 2020-02-01 11:22:01 +01:00
protolambda cd4e99f10e
Merge branch 'dev' into pkg-the-pyspec 2020-01-31 12:04:20 +01:00
protolambda 340549aed6
spec version -> spec fork 2020-01-31 11:52:30 +01:00
protolambda e118045a59
update remerkleable dependency 2020-01-28 02:31:39 +01:00
protolambda 7848500ea9
spec packaging; implement review suggestions from hww 2020-01-25 22:10:03 +01:00
protolambda 675d404c38
Package eth2spec for tooling and experimentation
See tests/core/pyspec/README.md for usage description.

This commit:
- refactors config loading to be part of the pyspec package
- updates requirements and main files to use new config loading
- cleans up the build script
- converts the build script to a distutil command
- runs pyspec build as part of build package command
- provides pyspecdev command to get editable spec python files
2020-01-25 01:57:11 +01:00