From b40236685c1fd8bf016761dfa861e05686dc6d1f Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Wed, 13 Mar 2019 09:04:12 -0600 Subject: [PATCH] phase 1 nitpicks --- specs/core/1_shard-data-chains.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/specs/core/1_shard-data-chains.md b/specs/core/1_shard-data-chains.md index db68591e7..d8efe0c85 100644 --- a/specs/core/1_shard-data-chains.md +++ b/specs/core/1_shard-data-chains.md @@ -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) @@ -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): # 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 @@ -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): challenge = get_branch_challenge_record_by_id(response.challenge_id) assert verify_merkle_branch( leaf=response.data, @@ -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): challenge = get_custody_challenge_record_by_id(response.challenge_id) responder = state.validator_registry[challenge.responder_index] # Verify we're not too late @@ -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): challenger = state.validator_registry[initiation.challenger_index] responder = state.validator_registry[initiation.responder_index] # Verify the signature @@ -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): 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 @@ -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): 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]