add chunk challenge and response to block and operations
This commit is contained in:
parent
3851a26a0f
commit
3f0e58a8ed
|
@ -214,6 +214,8 @@ MAX_REVEAL_LATENESS_DECREMENT: 128
|
|||
# 2**8 (= 256)
|
||||
MAX_CUSTODY_KEY_REVEALS: 256
|
||||
MAX_EARLY_DERIVED_SECRET_REVEALS: 1
|
||||
MAX_CUSTODY_CHUNK_CHALLENGES: 4
|
||||
MAX_CUSTODY_CHUNK_CHALLENGE_RESP: 16
|
||||
MAX_CUSTODY_SLASHINGS: 1
|
||||
|
||||
# Reward and penalty quotients
|
||||
|
|
|
@ -215,6 +215,8 @@ CUSTODY_PERIOD_TO_RANDAO_PADDING: 8
|
|||
# 2**8 (= 256)
|
||||
MAX_CUSTODY_KEY_REVEALS: 256
|
||||
MAX_EARLY_DERIVED_SECRET_REVEALS: 1
|
||||
MAX_CUSTODY_CHUNK_CHALLENGES: 2
|
||||
MAX_CUSTODY_CHUNK_CHALLENGE_RESP: 8
|
||||
MAX_CUSTODY_SLASHINGS: 1
|
||||
|
||||
# Reward and penalty quotients
|
||||
|
|
|
@ -215,9 +215,11 @@ class BeaconBlockBody(Container):
|
|||
deposits: List[Deposit, MAX_DEPOSITS]
|
||||
voluntary_exits: List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS]
|
||||
# Custody game
|
||||
custody_slashings: List[SignedCustodySlashing, MAX_CUSTODY_SLASHINGS]
|
||||
chunk_challenges: List[CustodyChunkResponse, MAX_CUSTODY_CHUNK_CHALLENGES]
|
||||
chunk_challenge_responses: List[CustodyChunkResponse, MAX_CUSTODY_CHUNK_CHALLENGE_RESPONSES]
|
||||
custody_key_reveals: List[CustodyKeyReveal, MAX_CUSTODY_KEY_REVEALS]
|
||||
early_derived_secret_reveals: List[EarlyDerivedSecretReveal, MAX_EARLY_DERIVED_SECRET_REVEALS]
|
||||
custody_slashings: List[SignedCustodySlashing, MAX_CUSTODY_SLASHINGS]
|
||||
# Shards
|
||||
shard_transitions: Vector[ShardTransition, MAX_SHARDS]
|
||||
# Light clients
|
||||
|
|
|
@ -81,6 +81,7 @@ This document details the beacon chain additions and changes in Phase 1 of Ether
|
|||
| `MAX_CUSTODY_KEY_REVEALS` | `2**8` (= 256) |
|
||||
| `MAX_EARLY_DERIVED_SECRET_REVEALS` | `1` |
|
||||
| `MAX_CUSTODY_CHUNK_CHALLENGES` | `2**2` (= 4) |
|
||||
| `MAX_CUSTODY_CHUNK_CHALLENGE_RESPONSES` | `2**4` (= 16) |
|
||||
| `MAX_CUSTODY_SLASHINGS` | `1` |
|
||||
|
||||
### Reward and penalty quotients
|
||||
|
@ -297,6 +298,8 @@ def process_custody_game_operations(state: BeaconState, body: BeaconBlockBody) -
|
|||
for operation in operations:
|
||||
fn(state, operation)
|
||||
|
||||
for_ops(body.chunk_challenges, process_chunk_challenge)
|
||||
for_ops(body.chunk_challenge_responses, process_chunk_challenge)
|
||||
for_ops(body.custody_key_reveals, process_custody_key_reveal)
|
||||
for_ops(body.early_derived_secret_reveals, process_early_derived_secret_reveal)
|
||||
for_ops(body.custody_slashings, process_custody_slashing)
|
||||
|
@ -304,10 +307,6 @@ def process_custody_game_operations(state: BeaconState, body: BeaconBlockBody) -
|
|||
|
||||
#### Chunk challenges
|
||||
|
||||
Verify that `len(block.body.custody_chunk_challenges) <= MAX_CUSTODY_CHUNK_CHALLENGES`.
|
||||
|
||||
For each `challenge` in `block.body.custody_chunk_challenges`, run the following function:
|
||||
|
||||
```python
|
||||
def process_chunk_challenge(state: BeaconState, challenge: CustodyChunkChallenge) -> None:
|
||||
# Verify the attestation
|
||||
|
|
Loading…
Reference in New Issue