Skip to content

Commit c95d1df

Browse files
authored
State that effective balance should be used (#4218)
1 parent 03befe3 commit c95d1df

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

specs/fulu/validator.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ document and used throughout.
5050
| Name | Value | Description |
5151
| - | - | - |
5252
| `VALIDATOR_CUSTODY_REQUIREMENT` | `8` | Minimum number of custody groups an honest node with validators attached custodies and serves samples from |
53-
| `BALANCE_PER_ADDITIONAL_CUSTODY_GROUP` | `Gwei(32 * 10**9)` | Balance increment corresponding to one additional group to custody |
53+
| `BALANCE_PER_ADDITIONAL_CUSTODY_GROUP` | `Gwei(32 * 10**9)` | Effective balance increment corresponding to one additional group to custody |
5454

5555
## Helpers
5656

@@ -110,15 +110,15 @@ A node with validators attached downloads and custodies a higher minimum of cust
110110
determined by `get_validators_custody_requirement(state, validator_indices)`. Here, `state` is the
111111
latest finalized `BeaconState` and `validator_indices` is the list of indices corresponding to validators
112112
attached to the node. Any node with at least one validator attached, and with the sum of the
113-
balances of all attached validators being `total_node_balance`, downloads and custodies
113+
effective balances of all attached validators being `total_node_balance`, downloads and custodies
114114
`total_node_balance // BALANCE_PER_ADDITIONAL_CUSTODY_GROUP` custody groups per slot, with a minimum
115115
of `VALIDATOR_CUSTODY_REQUIREMENT` and of course a maximum of `NUMBER_OF_CUSTODY_GROUPS`. The node
116-
SHOULD dynamically adjust its custody groups following any changes to the balances of attached
117-
validators.
116+
SHOULD dynamically adjust its custody groups following any changes to the effective balances of
117+
attached validators.
118118

119119
```python
120120
def get_validators_custody_requirement(state: BeaconState, validator_indices: Sequence[ValidatorIndex]) -> uint64:
121-
total_node_balance = sum(state.balances[index] for index in validator_indices)
121+
total_node_balance = sum(state.validators[index].effective_balance for index in validator_indices)
122122
count = total_node_balance // BALANCE_PER_ADDITIONAL_CUSTODY_GROUP
123123
return min(max(count, VALIDATOR_CUSTODY_REQUIREMENT), NUMBER_OF_CUSTODY_GROUPS)
124124
```
@@ -127,9 +127,10 @@ This higher custody is advertised in the node's Metadata by setting a higher `cu
127127
and in the node's ENR by setting a higher `custody_group_count`. As with the regular custody
128128
requirement, a node with validators MAY still choose to custody, advertise and serve more than
129129
this minimum. As with the regular custody requirement, a node MUST backfill columns when syncing. In
130-
addition, when the validator custody requirement increases, due to an increase in the total balance
131-
of the attached validators, a node MUST backfill columns from the new custody groups. However, a
132-
node MAY wait to advertise a higher custody in its Metadata and ENR until backfilling is complete.
130+
addition, when the validator custody requirement increases, due to an increase in the total
131+
effective balance of the attached validators, a node MUST backfill columns from the new custody
132+
groups. However, a node MAY wait to advertise a higher custody in its Metadata and ENR until
133+
backfilling is complete.
133134

134135
*Note*: The node SHOULD manage validator custody (and any changes during its lifetime) without any
135136
input from the user, for example by using existing signals about validator metadata to compute the

0 commit comments

Comments
 (0)