Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
  • Loading branch information
hwwhww and ralexstokes authored May 7, 2024
1 parent 9c1acbb commit 950136c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions specs/_features/eip7594/das-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@ def get_custody_columns(node_id: NodeID, custody_subnet_count: uint64) -> Sequen
assert custody_subnet_count <= DATA_COLUMN_SIDECAR_SUBNET_COUNT

subnet_ids: List[uint64] = []
tmp_id = uint256(node_id)
i = uint256(node_id)
while len(subnet_ids) < custody_subnet_count:
# Overflow prevention
if tmp_id == UINT256_MAX:
tmp_id = NodeID(0)
if i == UINT256_MAX:
i = NodeID(0)

subnet_id = (
bytes_to_uint64(hash(uint_to_bytes(uint256(tmp_id)))[0:8])
bytes_to_uint64(hash(uint_to_bytes(uint256(i)))[0:8])
% DATA_COLUMN_SIDECAR_SUBNET_COUNT
)
if subnet_id not in subnet_ids:
subnet_ids.append(subnet_id)
tmp_id += 1
i += 1

assert len(subnet_ids) == len(set(subnet_ids))

Expand Down

0 comments on commit 950136c

Please sign in to comment.