Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.5.0 phase 1 quick cleanups #767

Merged
merged 2 commits into from
Mar 13, 2019
Merged
Changes from 1 commit
Commits
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
26 changes: 13 additions & 13 deletions specs/core/1_shard-data-chains.md
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def verify_custody_subkey_reveal(pubkey: bytes48,
```python
def verify_signed_challenge_message(message: Any, pubkey: bytes48) -> bool:
return bls_verify(
message_hash=signed_root(message, 'signature'),
message_hash=signed_root(message),
pubkey=pubkey,
signature=message.signature,
domain=get_domain(state, get_current_epoch(state), DOMAIN_CUSTODY_INTERACTIVE)
Expand Down Expand Up @@ -607,8 +607,8 @@ Verify that `len(block.body.branch_challenges) <= MAX_BRANCH_CHALLENGES`.
For each `challenge` in `block.body.branch_challenges`, run:

```python
def process_branch_challenge(challenge: BranchChallenge,
state: BeaconState):
def process_branch_challenge(state: BeaconState,
challenge: BranchChallenge):
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
# Check that it's not too late to challenge
assert slot_to_epoch(challenge.attestation.data.slot) >= get_current_epoch(state) - MAX_BRANCH_CHALLENGE_DELAY
assert state.validator_registry[responder_index].exit_epoch >= get_current_epoch(state) - MAX_BRANCH_CHALLENGE_DELAY
Expand Down Expand Up @@ -643,8 +643,8 @@ Verify that `len(block.body.branch_responses) <= MAX_BRANCH_RESPONSES`.
For each `response` in `block.body.branch_responses`, if `response.responding_to_custody_challenge == False`, run:

```python
def process_branch_exploration_response(response: BranchResponse,
state: BeaconState):
def process_branch_exploration_response(state: BeaconState,
response: BranchResponse):
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
challenge = get_branch_challenge_record_by_id(response.challenge_id)
assert verify_merkle_branch(
leaf=response.data,
Expand All @@ -664,8 +664,8 @@ def process_branch_exploration_response(response: BranchResponse,
If `response.responding_to_custody_challenge == True`, run:

```python
def process_branch_custody_response(response: BranchResponse,
state: BeaconState):
def process_branch_custody_response(state: BeaconState,
response: BranchResponse):
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
challenge = get_custody_challenge_record_by_id(response.challenge_id)
responder = state.validator_registry[challenge.responder_index]
# Verify we're not too late
Expand Down Expand Up @@ -718,8 +718,8 @@ Verify that `len(block.body.interactive_custody_challenge_initiations) <= MAX_IN
For each `initiation` in `block.body.interactive_custody_challenge_initiations`, use the following function to process it:

```python
def process_initiation(initiation: InteractiveCustodyChallengeInitiation,
state: BeaconState):
def process_initiation(state: BeaconState,
initiation: InteractiveCustodyChallengeInitiation):
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
challenger = state.validator_registry[initiation.challenger_index]
responder = state.validator_registry[initiation.responder_index]
# Verify the signature
Expand Down Expand Up @@ -771,8 +771,8 @@ Verify that `len(block.body.interactive_custody_challenge_responses) <= MAX_INTE
For each `response` in `block.body.interactive_custody_challenge_responses`, use the following function to process it:

```python
def process_response(response: InteractiveCustodyChallengeResponse,
state: State):
def process_response(state: BeaconState,
response: InteractiveCustodyChallengeResponse):
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
challenge = get_custody_challenge_record_by_id(state, response.challenge_id)
responder = state.validator_registry[challenge.responder_index]
# Check that the right number of hashes was provided
Expand Down Expand Up @@ -804,8 +804,8 @@ Verify that `len(block.body.interactive_custody_challenge_continuations) <= MAX_
For each `continuation` in `block.body.interactive_custody_challenge_continuations`, use the following function to process it:

```python
def process_continuation(continuation: InteractiveCustodyChallengeContinuation,
state: State):
def process_continuation(state: BeaconState,
continuation: InteractiveCustodyChallengeContinuation):
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
challenge = get_custody_challenge_record_by_id(state, continuation.challenge_id)
challenger = state.validator_registry[challenge.challenger_index]
responder = state.validator_registry[challenge.responder_index]
Expand Down