Move new phase 1 changes into the spec#1483
Conversation
Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>
Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>
Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>
Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>
Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>
Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>
Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>
Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>
Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>
…config presets effective. Also fix more lint and consistency problems.
| assert data.beacon_block_root == get_block_root_at_slot(state, state.slot - 1) | ||
| # Type 2: delayed attestations | ||
| else: | ||
| assert state.slot - compute_start_slot_at_epoch(compute_epoch_at_slot(data.slot)) < SLOTS_PER_EPOCH |
There was a problem hiding this comment.
- Does that mean now we cannot include delayed attestation at the epoch boundary, i.e.,
state.slotis 64 anddata.slotis 63? I think it's okay to narrow down the range of acceptable delayed attestation (less thanSLOTS_PER_EPOCH?) for saving computation effort, but IMO we should make it accept the delayed attestation of slot N at the epoch boundary N+1. - Need to check the upper bound of valid
data.slot.
dangerousfood
left a comment
There was a problem hiding this comment.
Definition for BeaconState.online_countdown is not present or in PR #1427
… and immediate processing, since custody data is bounded
|
Comments on custody spec / beaconchain shard management, after working with the experimental code and discussing with Vitalik:
|
|
Also, |
|
In the method |
|
@dangerousfood Thanks. It was pointed out in the earlier PR already though. I think it's related to the shard-rotation TODO that's left. Will look into it 👍 |
|
|
||
| from importlib import reload | ||
|
|
||
| reload(spec_phase0) |
There was a problem hiding this comment.
A comment is probably a good idea, oops. Why: the presets are loaded into another module for the full test run. When spec phase 0 and 1 modules are initialized, they override any of the constants with these presets. And this ensures that the spec module is loaded after the correct configuration is loaded. Result: no re-initialization code in the spec code-gen, just reload and done.
| custody_slashings: List[CustodySlashing, MAX_CUSTODY_SLASHINGS] | ||
| custody_key_reveals: List[CustodyKeyReveal, MAX_CUSTODY_KEY_REVEALS] | ||
| early_derived_secret_reveals: List[EarlyDerivedSecretReveal, MAX_EARLY_DERIVED_SECRET_REVEALS] | ||
| # Shards |
There was a problem hiding this comment.
CustodySlashing, CustodyKeyReveal, EarlyDerivedSecretReveal types are not currently defined within the spec.
There was a problem hiding this comment.
They are part of the custody spec document. Currently only referencing the epoch processing functions correctly. Will add references to type definitions and custody operations processing later.
|
clsing in favor of #1504 |
This PR continues the work of @vbuterin and #1427 contributors, rebases it to the latest branch dev branch (with v0.9.1 changes too), and refactors it for integration into the pyspec:
specs/old. Some of it may still be relevant. To be removed from the spec once the last details are integrated well in the new docs.And I'm probably missing part of the new picture still, this is not my domain.More discussion helper. implemented custody revamp with the (simplified/faster) custody slashings 🎉Phase 0 and phase 1 are namespaced as modulesSame as previousPhase 1 type definitions overrule the phase 0 definitions. However, they inherit the phase0 types to make the new types compatible with the previous phase0 functions.Override with spec-builder. Imports from more modules result in import-loops and inheritance issues. Not to mention config reload problems.WIP: make pyspec SSZ correctly pick up that the super-type (phase 0) field annotations should be ignored in favor of the sub-type (phase 1) fieldsSee above