diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 7104b7823..9415814ac 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -72,7 +72,7 @@ - [`compute_epoch_of_slot`](#compute_epoch_of_slot) - [`compute_start_slot_of_epoch`](#compute_start_slot_of_epoch) - [`compute_activation_exit_epoch`](#compute_activation_exit_epoch) - - [`compute_bls_domain`](#compute_bls_domain) + - [`compute_domain`](#compute_domain) - [Beacon state accessors](#beacon-state-accessors) - [`get_current_epoch`](#get_current_epoch) - [`get_previous_epoch`](#get_previous_epoch) @@ -771,10 +771,10 @@ def compute_activation_exit_epoch(epoch: Epoch) -> Epoch: return Epoch(epoch + 1 + ACTIVATION_EXIT_DELAY) ``` -#### `compute_bls_domain` +#### `compute_domain` ```python -def compute_bls_domain(domain_type: uint64, fork_version: bytes=b'\x00' * 4) -> int: +def compute_domain(domain_type: uint64, fork_version: bytes=b'\x00' * 4) -> int: """ Return the BLS domain for the ``domain_type`` and ``fork_version``. """ @@ -1010,7 +1010,7 @@ def get_domain(state: BeaconState, domain_type: uint64, message_epoch: Epoch=Non """ epoch = get_current_epoch(state) if message_epoch is None else message_epoch fork_version = state.fork.previous_version if epoch < state.fork.epoch else state.fork.current_version - return compute_bls_domain(domain_type, fork_version) + return compute_domain(domain_type, fork_version) ``` #### `get_indexed_attestation` @@ -1685,8 +1685,8 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None: if pubkey not in validator_pubkeys: # Verify the deposit signature (proof of possession) for new validators. # Note: The deposit contract does not check signatures. - # Note: Deposits are valid across forks, thus the deposit domain is retrieved directly from `compute_bls_domain` - domain = compute_bls_domain(DOMAIN_DEPOSIT) + # Note: Deposits are valid across forks, thus the deposit domain is retrieved directly from `compute_domain` + domain = compute_domain(DOMAIN_DEPOSIT) if not bls_verify(pubkey, signing_root(deposit.data), deposit.data.signature, domain): return diff --git a/specs/validator/0_beacon-chain-validator.md b/specs/validator/0_beacon-chain-validator.md index a7542878b..0e9583a07 100644 --- a/specs/validator/0_beacon-chain-validator.md +++ b/specs/validator/0_beacon-chain-validator.md @@ -99,7 +99,7 @@ To submit a deposit: - Pack the validator's [initialization parameters](#initialization) into `deposit_data`, a [`DepositData`](../core/0_beacon-chain.md#depositdata) SSZ object. - Let `amount` be the amount in Gwei to be deposited by the validator where `MIN_DEPOSIT_AMOUNT <= amount <= MAX_EFFECTIVE_BALANCE`. - Set `deposit_data.amount = amount`. -- Let `signature` be the result of `bls_sign` of the `signing_root(deposit_data)` with `domain=compute_bls_domain(DOMAIN_DEPOSIT)`. (Deposits are valid regardless of fork version, `compute_bls_domain` will default to zeroes there). +- Let `signature` be the result of `bls_sign` of the `signing_root(deposit_data)` with `domain=compute_domain(DOMAIN_DEPOSIT)`. (Deposits are valid regardless of fork version, `compute_domain` will default to zeroes there). - Send a transaction on the Ethereum 1.0 chain to `DEPOSIT_CONTRACT_ADDRESS` executing `def deposit(pubkey: bytes[48], withdrawal_credentials: bytes[32], signature: bytes[96])` along with a deposit of `amount` Gwei. *Note*: Deposits made for the same `pubkey` are treated as for the same validator. A singular `Validator` will be added to `state.validators` with each additional deposit amount added to the validator's balance. A validator can only be activated when total deposits for the validator pubkey meet or exceed `MAX_EFFECTIVE_BALANCE`. diff --git a/test_libs/pyspec/eth2spec/test/helpers/deposits.py b/test_libs/pyspec/eth2spec/test/helpers/deposits.py index 276fa617b..148bc9549 100644 --- a/test_libs/pyspec/eth2spec/test/helpers/deposits.py +++ b/test_libs/pyspec/eth2spec/test/helpers/deposits.py @@ -19,7 +19,7 @@ def build_deposit_data(spec, pubkey, privkey, amount, withdrawal_credentials, st def sign_deposit_data(spec, deposit_data, privkey, state=None): if state is None: # Genesis - domain = spec.compute_bls_domain(spec.DOMAIN_DEPOSIT) + domain = spec.compute_domain(spec.DOMAIN_DEPOSIT) else: domain = spec.get_domain( state,