rm some unused code/imports (#6541)

This commit is contained in:
tersec 2024-09-11 03:45:37 +00:00 committed by GitHub
parent 9f7a1361bd
commit 1503c7dffe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 27 deletions

View File

@ -71,9 +71,6 @@ func len*(nodes: ProtoNodes): int =
func add(nodes: var ProtoNodes, node: ProtoNode) = func add(nodes: var ProtoNodes, node: ProtoNode) =
nodes.buf.add node nodes.buf.add node
func isPreviousEpochJustified(self: ProtoArray): bool =
self.checkpoints.justified.epoch + 1 == self.currentEpoch
# Forward declarations # Forward declarations
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------

View File

@ -9,13 +9,13 @@
# Uncategorized helper functions from the spec # Uncategorized helper functions from the spec
import import
std/[algorithm, hashes], std/algorithm,
results, results,
eth/p2p/discoveryv5/[node], eth/p2p/discoveryv5/[node],
./[helpers, digest], ./[helpers, digest],
./datatypes/[eip7594] ./datatypes/[eip7594]
proc sortedColumnIndices*(columnsPerSubnet: ColumnIndex, func sortedColumnIndices*(columnsPerSubnet: ColumnIndex,
subnetIds: HashSet[uint64]): subnetIds: HashSet[uint64]):
seq[ColumnIndex] = seq[ColumnIndex] =
var res: seq[ColumnIndex] = @[] var res: seq[ColumnIndex] = @[]
@ -26,7 +26,7 @@ proc sortedColumnIndices*(columnsPerSubnet: ColumnIndex,
res.sort res.sort
res res
proc sortedColumnIndexList*(columnsPerSubnet: ColumnIndex, func sortedColumnIndexList*(columnsPerSubnet: ColumnIndex,
subnetIds: HashSet[uint64]): subnetIds: HashSet[uint64]):
List[ColumnIndex, NUMBER_OF_COLUMNS] = List[ColumnIndex, NUMBER_OF_COLUMNS] =
var var
@ -36,10 +36,9 @@ proc sortedColumnIndexList*(columnsPerSubnet: ColumnIndex,
let index = DATA_COLUMN_SIDECAR_SUBNET_COUNT * i + subnetId let index = DATA_COLUMN_SIDECAR_SUBNET_COUNT * i + subnetId
res.add(ColumnIndex(index)) res.add(ColumnIndex(index))
res.sort() res.sort()
let list = List[ColumnIndex, NUMBER_OF_COLUMNS].init(res) List[ColumnIndex, NUMBER_OF_COLUMNS].init(res)
list
proc get_custody_column_subnets*(node_id: NodeId, func get_custody_column_subnets*(node_id: NodeId,
custody_subnet_count: uint64): custody_subnet_count: uint64):
Result[HashSet[uint64], cstring] = Result[HashSet[uint64], cstring] =
@ -76,7 +75,7 @@ proc get_custody_column_subnets*(node_id: NodeId,
ok(subnet_ids) ok(subnet_ids)
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/_features/eip7594/das-core.md#get_custody_columns # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/_features/eip7594/das-core.md#get_custody_columns
proc get_custody_columns*(node_id: NodeId, func get_custody_columns*(node_id: NodeId,
custody_subnet_count: uint64): custody_subnet_count: uint64):
seq[ColumnIndex] = seq[ColumnIndex] =
let let
@ -88,8 +87,7 @@ proc get_custody_columns*(node_id: NodeId,
sortedColumnIndices(ColumnIndex(columns_per_subnet), subnet_ids) sortedColumnIndices(ColumnIndex(columns_per_subnet), subnet_ids)
func get_custody_column_list*(node_id: NodeId,
proc get_custody_column_list*(node_id: NodeId,
custody_subnet_count: uint64): custody_subnet_count: uint64):
List[ColumnIndex, NUMBER_OF_COLUMNS] = List[ColumnIndex, NUMBER_OF_COLUMNS] =