disable peer quota

This commit is contained in:
Agnish Ghosh 2024-10-01 20:43:30 +05:30
parent 1b5e9cf891
commit 4bd6ead294
3 changed files with 12 additions and 5 deletions

View File

@ -66,6 +66,8 @@ type
DataColumnSidecars* = seq[ref DataColumnSidecar]
DataColumnSidecarList* = List[ColumnIndex, NUMBER_OF_COLUMNS]
DataColumnIdentifier* = object
block_root*: Eth2Digest
index*: ColumnIndex

View File

@ -336,7 +336,6 @@ proc getDataColumnSidecars[A, B](man: SyncManager[A, B], peer: A,
localNodeId.get_custody_column_list(max(SAMPLES_PER_SLOT.uint64,
localCustodySubnetCount))
debug "Checking valid custody peers before range request", request = req
doAssert(not(req.isEmpty()), "Request must not be empty!")
debug "Requesting data column sidecars from peer", request = req
@ -372,6 +371,9 @@ func groupDataColumns*[T](req: SyncRequest[T],
grouped[block_idx].add(data_column_sidecar)
inc column_cursor
debugEcho "Column Cursor"
debugEcho column_cursor
if column_cursor != len(data_columns):
# we reached end of blocks without consuming all data columns so either
# the peer we got too few blocks in the paired request, or the
@ -642,7 +644,7 @@ proc syncStep[A, B](man: SyncManager[A, B], index: int, peer: A)
let groupedDataColumns = groupDataColumns(req, blockData, dataColumnData)
if groupedDataColumns.isErr():
# peer.updateScore(PeerScoreNoValues)
man.queue.push(req)
# man.queue.push(req)
# warn "Received data columns is inconsistent",
# data_columns_map = getShortMap(req, dataColumnData), request = req, msg=groupedDataColumns.error()
return

View File

@ -24,7 +24,7 @@ const
## Allow syncing ~64 blocks/sec (minus request costs)
blobResponseCost = allowedOpsPerSecondCost(1000)
## Multiple can exist per block, they are much smaller than blocks
dataColumnResponseCost = allowedOpsPerSecondCost(1000)
dataColumnResponseCost = allowedOpsPerSecondCost(8000)
## 1 blob has an equivalent memory of 8 data columns
type
@ -484,12 +484,15 @@ p2pProtocol BeaconSync(version = 1,
if blockIds[i].slot.epoch >= dag.cfg.DENEB_FORK_EPOCH and
not dag.head.executionValid:
continue
let uncompressedLen = uncompressedLenFramed(bytes).valueOr:
warn "Cannot read data column sidecar size, database, corrupt",
bytes = bytes.len(), blck = shortLog(blockIds[i])
continue
peer.awaitQuota(dataColumnResponseCost, "data_column_sidecars_by_range/1")
peer.network.awaitQuota(dataColumnResponseCost, "data_column_sidecars_by_range/1")
# peer.awaitQuota(dataColumnResponseCost, "data_column_sidecars_by_range/1")
# peer.network.awaitQuota(dataColumnResponseCost, "data_column_sidecars_by_range/1")
await response.writeBytesSZ(
uncompressedLen, bytes,
peer.network.forkDigestAtEpoch(blockIds[i].slot.epoch).data)