-
Notifications
You must be signed in to change notification settings - Fork 146
Conversation
19479cc
to
0ba687b
Compare
@hwwhww not to delay things but do we want to wait for ethereum/py-ssz#58 to be incorporated -- should let us drop the it may change this PR to "Bump ssz to |
tests/eth2/beacon/conftest.py
Outdated
# SSZ | ||
@pytest.fixture(scope="function", autouse=True) | ||
def override_length(config): | ||
BeaconState._meta.container_sedes.field_name_to_sedes["latest_randao_mixes"].length = config.LATEST_RANDAO_MIXES_LENGTH # noqa: E501 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about putting the field-name/vector length pairs in a dict and then setting all of them in a loop?
integration issue.
Fix the dependency between `BeaconBlockHeader`, `BeaconBlockBody` and `ProposerSlashing` by moving `BeaconBlockHeader` to `eth2/beacon/types/block_headers.py`
@@ -80,6 +83,8 @@ | |||
beacon_chain_config = BeaconChainConfig(chain_name='TestTestTest', genesis_data=genesis_data) | |||
chain_class = beacon_chain_config.beacon_chain_class | |||
|
|||
override_vector_length(XIAO_LONG_BAO_CONFIG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @ChihChengLiang, @mhchia
After this PR, it requires overriding SSZ Vector length from config before using eth2.beacon.types.*
classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of comments, but almost all of them about the same thing.
eth2/beacon/types/block_headers.py
Outdated
def __repr__(self) -> str: | ||
return '<BlockHeader #{0} {1}>'.format( | ||
self.slot, | ||
encode_hex(self.signing_root)[2:10], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encode_hex(self.signing_root)[2:10], | |
encode_hex(self.root)[2:10], |
IMO it could be confusing if we use the signing root here because it's possible that two headers only differ by their signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. I think that's because we now use signing_root
as:
previous_block_root
- the key in
ChainDB
We can output both signing_root
and root
.
db60596
to
304c96a
Compare
What was wrong?
Fixed #409, #365
Bump to the new SSZ.
Note that it requires ethereum/py-ssz#64 PR merged.
How was it fixed?
Vector
sedespy-ssz
root
property for the hash tree rootpy-ssz
signing_root
propertyssz.tree_hash_root
for calculatingBeaconState.latest_active_index_roots
BeaconBlockHeader
,BeaconBlockBody
andProposerSlashing
are twisted together. This PR movesBeaconBlockHeader
toeth2/beacon/types/block_headers.py
so thatProposerSlashing
can importeth2.beacon.types.block_headers
Cute Animal Picture