|
53 | 53 |
|
54 | 54 | ColumnManager*[A, B] = ref object
|
55 | 55 | pool: PeerPool[A, B]
|
| 56 | + cfg*: RuntimeConfig |
56 | 57 | amIsupernode*: bool
|
57 | 58 | custody_columns_set*: HashSet[ColumnIndex]
|
58 | 59 | custody_columns_list*: List[ColumnIndex, NUMBER_OF_COLUMNS]
|
@@ -131,6 +132,7 @@ proc initColumnSyncerAssist[A, B](man: ColumnManager[A, B]) =
|
131 | 132 |
|
132 | 133 | proc newColumnManager*[A, B](
|
133 | 134 | pool: PeerPool[A, B],
|
| 135 | + cfg: RuntimeConfig, |
134 | 136 | amIsupernode: bool,
|
135 | 137 | custody_columns_set: HashSet[ColumnIndex],
|
136 | 138 | custody_columns_list: List[ColumnIndex, NUMBER_OF_COLUMNS],
|
@@ -159,6 +161,7 @@ proc newColumnManager*[A, B](
|
159 | 161 |
|
160 | 162 | var res = ColumnManager[A, B](
|
161 | 163 | pool: pool,
|
| 164 | + cfg: cfg, |
162 | 165 | amIsupernode: amIsupernode,
|
163 | 166 | custody_columns_set: custody_columns_set,
|
164 | 167 | custody_columns_list: custody_columns_list,
|
@@ -226,9 +229,11 @@ proc checkDataColumns(data_columns: seq[DataColumnSidecars]):
|
226 | 229 | proc intersectionColumns[A, B](
|
227 | 230 | man: ColumnManager[A, B],
|
228 | 231 | peer: A): List[ColumnIndex, NUMBER_OF_COLUMNS] =
|
| 232 | + let remoteNodeId = |
| 233 | + fetchNodeIdFromPeerId(peer) |
229 | 234 | intersection(man.custody_columns_set,
|
230 |
| - resolve_column_sets_from_custody_groups(max(SAMPLES_PER_SLOT.uint64, |
231 |
| - peer.lookupCgcFromPeer()))) |
| 235 | + resolve_columns_from_custody_groups(remoteNodeId, max(SAMPLES_PER_SLOT.uint64, |
| 236 | + peer.lookupCgcFromPeer()).toHashSet())) |
232 | 237 |
|
233 | 238 | proc refreshColumnScoring[A, B](
|
234 | 239 | man: ColumnManager[A, B]) =
|
@@ -579,9 +584,12 @@ proc columnSyncStrategyImpartial[A, B](
|
579 | 584 | reason = error
|
580 | 585 | return
|
581 | 586 |
|
582 |
| - let serveable_columns = |
583 |
| - resolve_column_list_from_custody_groups(max(SAMPLES_PER_SLOT.uint64, |
584 |
| - peer.lookupCgcFromPeer())) |
| 587 | + let |
| 588 | + remoteNodeId = |
| 589 | + fetchNodeIdFromPeerId(peer) |
| 590 | + serveable_columns = |
| 591 | + man.cfg.resolve_columns_from_custody_groups(remoteNodeId, max(SAMPLES_PER_SLOT.uint64, |
| 592 | + peer.lookupCgcFromPeer())) |
585 | 593 | let columnData =
|
586 | 594 | if shouldGetDataColumns:
|
587 | 595 | let columns =
|
@@ -818,8 +826,9 @@ proc columnSyncWorkerGreedy[A, B](
|
818 | 826 | peer = await man.pool.acquire()
|
819 | 827 | if intersection(
|
820 | 828 | man.custody_columns_set,
|
821 |
| - resolve_column_sets_from_custody_groups(max(SAMPLES_PER_SLOT.uint64, |
822 |
| - peer.lookupCgcFromPeer()))): |
| 829 | + resolve_columns_from_custody_groups(fetchNodeIdFromPeerId(peer), |
| 830 | + max(SAMPLES_PER_SLOT.uint64, |
| 831 | + peer.lookupCgcFromPeer()).toHashSet())): |
823 | 832 | usefulPeers.add(peer)
|
824 | 833 | else:
|
825 | 834 | uselessPeers.add(peer)
|
|
0 commit comments