Skip to content

Commit fdad206

Browse files
committed
Apply @dankrad's suggestion
1 parent 950136c commit fdad206

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

specs/_features/eip7594/das-core.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,18 @@ def get_custody_columns(node_id: NodeID, custody_subnet_count: uint64) -> Sequen
106106
assert custody_subnet_count <= DATA_COLUMN_SIDECAR_SUBNET_COUNT
107107

108108
subnet_ids: List[uint64] = []
109-
i = uint256(node_id)
109+
current_id = uint256(node_id)
110110
while len(subnet_ids) < custody_subnet_count:
111-
# Overflow prevention
112-
if i == UINT256_MAX:
113-
i = NodeID(0)
114-
115111
subnet_id = (
116-
bytes_to_uint64(hash(uint_to_bytes(uint256(i)))[0:8])
112+
bytes_to_uint64(hash(uint_to_bytes(uint256(current_id)))[0:8])
117113
% DATA_COLUMN_SIDECAR_SUBNET_COUNT
118114
)
119115
if subnet_id not in subnet_ids:
120116
subnet_ids.append(subnet_id)
121-
i += 1
117+
if current_id == UINT256_MAX:
118+
# Overflow prevention
119+
current_id = NodeID(0)
120+
current_id += 1
122121

123122
assert len(subnet_ids) == len(set(subnet_ids))
124123

0 commit comments

Comments
 (0)