Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Updates for almost v0.8 #714

Merged
merged 192 commits into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
62580c4
rename MAX_DEPOSIT_AMOUNT ~> MAX_EFFECTIVE_BALANCE
ralexstokes Jun 11, 2019
80b5afc
Update validator record
ralexstokes Jun 11, 2019
f129fad
Make default values more ergonomic
ralexstokes Jun 12, 2019
c3437b2
Add default values for `Fork`
ralexstokes Jun 12, 2019
7f65224
Add new attestation helpers
ralexstokes Jun 13, 2019
3157a32
Make tuple updater more flexible
ralexstokes Jun 13, 2019
43e773c
Update committee helpers
ralexstokes Jun 13, 2019
f284c71
Update epoch processing helpers
ralexstokes Jun 13, 2019
defc011
Update generic helpers
ralexstokes Jun 13, 2019
ef3a845
Update how we handle effective balance
ralexstokes Jun 13, 2019
ce913d1
Update crosslinks
ralexstokes Jun 13, 2019
f5b8b4b
SlashableAttestation ~> use of IndexedAttestation
ralexstokes Jun 13, 2019
9b3f617
Update validator status helpers
ralexstokes Jun 13, 2019
2ee7411
Add validator helper
ralexstokes Jun 13, 2019
d397056
clean up unused code
ralexstokes Jun 13, 2019
21aec1c
Update state.previous_epoch
ralexstokes Jun 13, 2019
1f9d43d
Add stub for `is_genesis_trigger` function
ralexstokes Jun 13, 2019
fb0770e
Add default zero values
ralexstokes Jun 13, 2019
a13b05a
Update genesis logic
ralexstokes Jun 13, 2019
3e24159
Update AttestationData
ralexstokes Jun 13, 2019
a237ea1
Add default zero values for AttestationDataAndCustodyBit
ralexstokes Jun 13, 2019
c3ed19a
Update pending attestation
ralexstokes Jun 13, 2019
1b81037
Provide zero default values for HistoricalBatch
ralexstokes Jun 13, 2019
bab6b47
Update Eth1Data
ralexstokes Jun 13, 2019
b06ca13
Update DepositData
ralexstokes Jun 13, 2019
9cd0395
Update beacon block header
ralexstokes Jun 13, 2019
734f3af
Update proposer slashing
ralexstokes Jun 13, 2019
e566b9b
Provide zero default values for IndexedAttestation
ralexstokes Jun 13, 2019
1d8c25a
Provide zero default values for AttesterSlashing
ralexstokes Jun 13, 2019
d6f6284
Provide zero default values for Attestation
ralexstokes Jun 13, 2019
314a9f7
Update deposit
ralexstokes Jun 13, 2019
14f1df2
Provide default zero values for VoluntaryExit
ralexstokes Jun 13, 2019
126ce01
Provide default zero values for Transfer
ralexstokes Jun 13, 2019
ff24877
Update BeaconBlock and BeaconBlockBody
ralexstokes Jun 13, 2019
2c999b0
Update BeaconState
ralexstokes Jun 13, 2019
308e819
Consolidate tuple mutator implementation
ralexstokes Jun 13, 2019
f190daf
Update epoch processing helpers
ralexstokes Jun 20, 2019
45fb002
Update epoch processing
ralexstokes Jun 21, 2019
dc432ac
Clean up validator status helpers
ralexstokes Jun 24, 2019
0d55093
Use default value for pending validator
ralexstokes Jun 24, 2019
a6feefe
Clean up helpers
ralexstokes Jun 24, 2019
b08db99
Clean up epoch processing helpers
ralexstokes Jun 24, 2019
ddd6c6c
Clean up committee helpers
ralexstokes Jun 24, 2019
5a132c7
Add function `is_slashable_attestation_data` to attestation helpers
ralexstokes Jun 24, 2019
9367118
Update domain enum
ralexstokes Jun 24, 2019
601d7f1
Update per-block logic
ralexstokes Jun 24, 2019
91b0a5e
Update constants
ralexstokes Jun 24, 2019
98528c2
Remove unused imports
ralexstokes Jun 24, 2019
95d0c5e
Update constants
ralexstokes Jun 24, 2019
a31f462
Improve semantic content of name for SignatureDomain enum
ralexstokes Jun 24, 2019
027c1c4
Update constants
ralexstokes Jun 25, 2019
484dc34
Update change with deposit tree depth constant
ralexstokes Jun 25, 2019
4a5087d
Another pass to update types
ralexstokes Jun 25, 2019
1bab0ff
Another pass at updating helpers
ralexstokes Jun 25, 2019
e24ccbd
Add GENESIS_ACTIVE_VALIDATOR_COUNT
ralexstokes Jun 25, 2019
f25e987
Add genesis trigger (and tidy some of genesis code)
ralexstokes Jun 25, 2019
19ef58c
Update active index roots bounds check
ralexstokes Jun 25, 2019
2bfb14e
tidy helpers
ralexstokes Jun 25, 2019
cbedc9b
reduce code in genesis
ralexstokes Jun 25, 2019
faa22fb
Add some free functions to mirror the spec
ralexstokes Jun 25, 2019
353a9ba
Update state transition to mirror the spec
ralexstokes Jun 25, 2019
eaa55a9
Fix some linting issues with plugin
ralexstokes Jun 25, 2019
3adfe34
LATEST_ACTIVE_INDEX_ROOTS_LENGTH ~> EPOCHS_PER_HISTORICAL_VECTOR
ralexstokes Jun 25, 2019
30c0533
Update attestation helpers
ralexstokes Jun 25, 2019
c3dafa5
LATEST_RANDAO_MIXES_LENGTH ~> EPOCHS_PER_HISTORICAL_VECTOR
ralexstokes Jun 25, 2019
f8f2ef6
Remove concept of ``CommitteeIndex``
ralexstokes Jun 25, 2019
4a6a768
Update validator type
ralexstokes Jun 25, 2019
ed22ebe
Update Eth1Data type
ralexstokes Jun 25, 2019
117b7d2
Add default values
ralexstokes Jun 25, 2019
03eb3d9
Add defaults
ralexstokes Jun 25, 2019
b250a20
Update typing on tuple mutators
ralexstokes Jun 25, 2019
8f68eea
LATEST_SLASHED_EXIT_LENGTH ~> EPOCHS_PER_SLASHED_BALANCES_VECTOR
ralexstokes Jun 25, 2019
e9e3d85
Update names from change to BeaconState type
ralexstokes Jun 25, 2019
a469c82
Fix all mypy errors from earlier edits
ralexstokes Jun 25, 2019
fdff8f1
Linter fixes
ralexstokes Jun 25, 2019
c87f2eb
Remove unused file
ralexstokes Jun 25, 2019
3558532
Remove the inner `_utils`
ralexstokes Jun 25, 2019
9ec271a
Clean up deposit helpers
ralexstokes Jun 25, 2019
298608c
Code cleanup
ralexstokes Jun 26, 2019
621d977
Add default types
ralexstokes Jun 26, 2019
c28b8ab
Add tool to make a genesis state without requiring deposits
ralexstokes Jun 26, 2019
6097ff2
Remove old test
ralexstokes Jun 26, 2019
43f9860
Update validator with Gwei type
ralexstokes Jun 26, 2019
cb41f18
Clean up conftest
ralexstokes Jun 26, 2019
f0a0c88
Get tests runnable
ralexstokes Jun 26, 2019
2c20fa8
bugfix for helpers
ralexstokes Jun 27, 2019
f473e80
Use non-keyword symbol for loop variable
ralexstokes Jun 27, 2019
ddcb748
Fix generate_seed bug with underflow
ralexstokes Jun 27, 2019
bd70fcf
Provide correct default values for runtime-specified ssz vectors
ralexstokes Jun 27, 2019
fb0ef33
Rename test file
ralexstokes Jun 27, 2019
fed9b70
File reorg
ralexstokes Jun 27, 2019
4003b02
formatting change
ralexstokes Jun 27, 2019
42b0d55
refactor bugfix
ralexstokes Jun 27, 2019
e697d49
Fix tools/builder/validator test
ralexstokes Jun 27, 2019
66606b5
Indicate function is private to module
ralexstokes Jun 27, 2019
9e71e94
Use more general type to satisfy mypy
ralexstokes Jun 27, 2019
6f25c7c
Get `types` tests passing
ralexstokes Jun 27, 2019
062a929
Update names on BeaconBlock type
ralexstokes Jun 27, 2019
59eb2dc
Fix typo w/ tuple append in `process_eth1_data`
ralexstokes Jun 27, 2019
76a4d99
Fix bug with creation of mock genesis eth1 data
ralexstokes Jun 27, 2019
f5ae66c
Clean up VoluntaryExit builder tool
ralexstokes Jun 27, 2019
f951a55
Fix tests in DB module
ralexstokes Jun 27, 2019
8916f16
Update __str__ of AttestationData
ralexstokes Jun 27, 2019
df4aa6f
Update use of Attestation type
ralexstokes Jun 27, 2019
db67ee9
Bug fix on helpers and state transition
ralexstokes Jun 27, 2019
aee8864
Bug fix on mock block creation
ralexstokes Jun 27, 2019
73c7b06
Bug fix on mock attestation creation
ralexstokes Jun 27, 2019
fae5198
Fix typo w/ epoch processing helpers
ralexstokes Jun 27, 2019
2aa157b
Clean up unnecessary genesis slot/epoch fixtures
ralexstokes Jun 27, 2019
9c58f3c
reorg code to reflect spec
ralexstokes Jun 27, 2019
39feb2f
bugfix w/ epoch processing
ralexstokes Jun 27, 2019
c3fc6f1
pull slot transition into its own function so it can be tested
ralexstokes Jun 27, 2019
d214704
Clean up builder tools
ralexstokes Jun 27, 2019
1279b6c
rename file for clarity
ralexstokes Jun 27, 2019
c1500e2
update `process_slots` test
ralexstokes Jun 27, 2019
97a3664
Update block processing tests
ralexstokes Jun 27, 2019
22d5d44
Add ssz signing type to missing containers
ralexstokes Jun 27, 2019
c936891
Fix some formatting and names
ralexstokes Jun 27, 2019
74585c6
Update test genesis
ralexstokes Jun 27, 2019
c24d22b
Bug fixes for helpers
ralexstokes Jun 28, 2019
4bf0954
Rework builder tools
ralexstokes Jun 28, 2019
9409a8f
Fix tests for deposit helpers
ralexstokes Jun 28, 2019
43c7a8b
Fix tests for genesis
ralexstokes Jun 28, 2019
c394ec4
Fix proposer slashing validation tests
ralexstokes Jun 28, 2019
738342e
Use consistent name for builder tools
ralexstokes Jun 28, 2019
4a00d00
Add tests for validator status helpers
ralexstokes Jun 28, 2019
35b851a
Add todo note for later
ralexstokes Jun 28, 2019
62e7b3d
Fix configurability of genesis validators in testing
ralexstokes Jun 28, 2019
4a285c2
Fix committee helpers tests
ralexstokes Jun 28, 2019
0a51b27
Fix helpers tests
ralexstokes Jun 28, 2019
422b8af
refactor of `get_winning_crosslink...`
ralexstokes Jun 29, 2019
0b1bc71
Most epoch processing helpers except for `get_winning_crosslink...`
ralexstokes Jun 29, 2019
9cb560b
fix test_validate_attestation_slot
ChihChengLiang Jun 29, 2019
cefe707
fix comment
ChihChengLiang Jun 29, 2019
22cdf4e
Finish epoch processing helpers tests
ralexstokes Jun 29, 2019
39b302d
Formatting, use double-quoted strings
ralexstokes Jun 29, 2019
38f6fb2
Restore deposit emulation after changing pubkeys for fixture
ralexstokes Jun 29, 2019
a55f2ce
Add BLS key generation caching
ralexstokes Jun 29, 2019
6bc48c0
Restore invariant that validators have real pubkeys
ralexstokes Jun 29, 2019
1a03947
Fix typo
ralexstokes Jun 29, 2019
c48025c
Fix tests with voluntary exit validation
ralexstokes Jun 29, 2019
decbe08
Add tests for attestation helpers
ralexstokes Jun 29, 2019
b30fea5
Update tests for block validation
ralexstokes Jun 29, 2019
5ba53f9
Fix operation processing tests
ralexstokes Jun 29, 2019
3b88b3b
Test crosslink validity for attestations
ralexstokes Jun 30, 2019
0539ef3
test_validate_attestation_source_epoch_and_root
ChihChengLiang Jun 30, 2019
885ec93
Update eth1 data tests
ralexstokes Jun 30, 2019
81e0fa8
fix p2p-proto/bcc
ChihChengLiang Jun 30, 2019
4248e1b
Update justification and finality tests
ralexstokes Jun 30, 2019
8973d97
Add config validity conditions to testing harness
ralexstokes Jul 1, 2019
9f8ad2f
Pull PendingAttestation builder tools out from test files
ralexstokes Jul 1, 2019
8e1ff0a
Small refactor on epoch processing
ralexstokes Jul 1, 2019
78904a6
Fix crosslink tests
ralexstokes Jul 1, 2019
43c719d
Bug fix on epoch processing
ralexstokes Jul 1, 2019
265108e
Refactor final updates in epoch processing for easier testing
ralexstokes Jul 1, 2019
1782bf7
add default attestation
ChihChengLiang Jul 1, 2019
bdd90d1
remove mock_attestation
ChihChengLiang Jul 1, 2019
7521f01
fix network_generator test
ChihChengLiang Jul 1, 2019
734fc45
Progress on epoch processing tests
ralexstokes Jul 1, 2019
6726a74
Expose slashing penalty logic for testing
ralexstokes Jul 1, 2019
dd17f15
Add tests for slashing penalties
ralexstokes Jul 1, 2019
9246a48
mypy fixes
ralexstokes Jul 1, 2019
55c0715
Expose `get_crosslink_committees_at_slot` helper
ralexstokes Jul 1, 2019
c17db39
epoch processing bug fix
ralexstokes Jul 1, 2019
91ac730
Linter fixes
ralexstokes Jul 1, 2019
718a689
Backport config fix from master
ralexstokes Jul 1, 2019
74a9b28
Fix shard : epoch length invariant
ralexstokes Jul 1, 2019
b26a410
Ensure test raises expected validation error
ralexstokes Jul 1, 2019
82762db
Fixes for bcc proto tests
ralexstokes Jul 1, 2019
2b8b30a
Get integration test passing
ralexstokes Jul 1, 2019
3b37cfc
Disable plugins and fixtures for now
ralexstokes Jul 1, 2019
95bd00a
Actually disable the plugin tests
ralexstokes Jul 1, 2019
7ccb6d9
Address linter
ralexstokes Jul 1, 2019
7f444c7
Ensure the dynamically generated pubkeys are present
ralexstokes Jul 1, 2019
dc95d20
Avoid a __repr__ error from a confused merge in CI
ralexstokes Jul 1, 2019
c257c79
Nicer CI config than what we had previously
ralexstokes Jul 2, 2019
e8f780c
Save pytest BLS key cache across circle ci runs
ralexstokes Jul 2, 2019
064e71d
Enhance BLS key cache to only store the expensive data
ralexstokes Jul 2, 2019
46117fc
Update beacon proposer getter
ralexstokes Jul 2, 2019
027844b
Reveal more fields in __repr__ of AttestationData
ralexstokes Jul 2, 2019
b08ae79
make a proper crosslink in the mock attestation utility
ralexstokes Jul 2, 2019
5938df8
Use clearer name on auxillary helper imports
ralexstokes Jul 2, 2019
b0e5981
Update validator plugin tests
ralexstokes Jul 2, 2019
d834c0c
re-enable plugin tests that should be passing now
ralexstokes Jul 2, 2019
1579332
Fix circle CI config
ralexstokes Jul 2, 2019
cefa0b4
Fix error from rebase
ralexstokes Jul 2, 2019
76a9789
Remove temporary "passing" class of plugin
ralexstokes Jul 2, 2019
ff86e96
Clean up linter comment via PR feedback
ralexstokes Jul 2, 2019
5d13336
remove default attestation
ChihChengLiang Jul 3, 2019
55b54d5
remove redefinition
ChihChengLiang Jul 3, 2019
5750a2e
fix get_ready_attestations and tests
ChihChengLiang Jul 8, 2019
6129606
update type signature for slot removal
ralexstokes Jul 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ common: &common
- ~/.cache/pip
- ~/.local
- ./eggs
- .pytest_cache/v/eth2/bls/key-cache
key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}

geth_steps: &geth_steps
Expand Down Expand Up @@ -304,12 +305,18 @@ jobs:
- image: circleci/python:3.6
environment:
TOXENV: py36-wheel-cli
py36-plugins:
py36-eth1-plugins:
<<: *common
docker:
- image: circleci/python:3.6
environment:
TOXENV: py36-plugins
TOXENV: py36-eth1-plugins
py36-eth2-plugins:
<<: *common
docker:
- image: circleci/python:3.6
environment:
TOXENV: py36-eth2-plugins

py37-rpc-state-quadratic:
<<: *common
Expand Down Expand Up @@ -384,12 +391,18 @@ jobs:
- image: circleci/python:3.7
environment:
TOXENV: py37-wheel-cli
py37-plugins:
py37-eth1-plugins:
<<: *common
docker:
- image: circleci/python:3.7
environment:
TOXENV: py37-eth1-plugins
py37-eth2-plugins:
<<: *common
docker:
- image: circleci/python:3.7
environment:
TOXENV: py37-plugins
TOXENV: py37-eth2-plugins

docker-image-build-test:
machine: true
Expand All @@ -408,11 +421,12 @@ workflows:
- py37-wheel-cli
- py37-p2p
- py37-eth2-core
- py37-eth2-fixtures
# temporarily disable fixtures tests while we update
# - py37-eth2-fixtures
- py37-eth2-integration
- py37-eth2-plugins
# - py37-libp2p
- py37-bls-bindings
- py37-plugins
- py37-eth1-plugins

- py37-rpc-state-quadratic
- py37-rpc-state-sstore
Expand All @@ -431,11 +445,12 @@ workflows:
- py36-wheel-cli
- py36-p2p
- py36-eth2-core
- py36-eth2-fixtures
# temporarily disable fixtures tests while we update
# - py36-eth2-fixtures
- py36-eth2-integration
- py36-eth2-plugins
# - py36-libp2p
- py36-bls-bindings
- py36-plugins
- py36-eth1-plugins

- py36-integration
- py36-lightchain_integration
Expand Down
116 changes: 0 additions & 116 deletions eth2/_utils/blobs.py

This file was deleted.

10 changes: 0 additions & 10 deletions eth2/_utils/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@ def bitwise_xor(a: Hash32, b: Hash32) -> Hash32:
return Hash32(result)


def is_power_of_two(value: int) -> bool:
"""
Check if ``value`` is a power of two integer.
"""
if value == 0:
return False
else:
return bool(value and not (value & (value - 1)))


def integer_squareroot(value: int) -> int:
"""
Return the integer square root of ``value``.
Expand Down
28 changes: 23 additions & 5 deletions eth2/_utils/tuple.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from typing import (
Any,
Callable,
Tuple,
TypeVar,
)
Expand All @@ -11,16 +13,19 @@
VType = TypeVar('VType')


def update_tuple_item(tuple_data: Tuple[VType, ...],
index: int,
new_value: VType) -> Tuple[VType, ...]:
def update_tuple_item_with_fn(tuple_data: Tuple[VType, ...],
index: int,
fn: Callable[[VType, Any], VType],
*args: Any) -> Tuple[VType, ...]:
"""
Update the ``index``th item of ``tuple_data`` to ``new_value``
Update the ``index``th item of ``tuple_data`` to the result of calling ``fn`` on the existing
value.
"""
list_data = list(tuple_data)

try:
list_data[index] = new_value
old_value = list_data[index]
list_data[index] = fn(old_value, *args)
except IndexError:
raise ValidationError(
"the length of the given tuple_data is {}, the given index {} is out of index".format(
Expand All @@ -30,3 +35,16 @@ def update_tuple_item(tuple_data: Tuple[VType, ...],
)
else:
return tuple(list_data)


def update_tuple_item(tuple_data: Tuple[VType, ...],
index: int,
new_value: VType) -> Tuple[VType, ...]:
"""
Update the ``index``th item of ``tuple_data`` to ``new_value``
"""
return update_tuple_item_with_fn(
tuple_data,
index,
lambda *_: new_value
)
Empty file removed eth2/beacon/_utils/__init__.py
Empty file.
132 changes: 0 additions & 132 deletions eth2/beacon/_utils/random.py

This file was deleted.

Loading