mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-04 16:25:10 +00:00
parent
7a1fe5707c
commit
85134eb24b
@ -226,6 +226,13 @@ type
|
|||||||
defaultValue: none(TrustedDigest)
|
defaultValue: none(TrustedDigest)
|
||||||
name: "trusted-block-root" .}: Option[TrustedDigest]
|
name: "trusted-block-root" .}: Option[TrustedDigest]
|
||||||
|
|
||||||
|
disablePoke* {.
|
||||||
|
hidden
|
||||||
|
desc: "Disable POKE functionality for gossip mechanisms testing"
|
||||||
|
defaultValue: defaultDisablePoke
|
||||||
|
defaultValueDesc: $defaultDisablePoke
|
||||||
|
name: "disable-poke" .}: bool
|
||||||
|
|
||||||
case cmd* {.
|
case cmd* {.
|
||||||
command
|
command
|
||||||
defaultValue: noCommand .}: PortalCmd
|
defaultValue: noCommand .}: PortalCmd
|
||||||
|
@ -166,7 +166,8 @@ proc run(config: PortalConf) {.raises: [CatchableError].} =
|
|||||||
config.tableIpLimit,
|
config.tableIpLimit,
|
||||||
config.bucketIpLimit,
|
config.bucketIpLimit,
|
||||||
config.bitsPerHop,
|
config.bitsPerHop,
|
||||||
config.radiusConfig
|
config.radiusConfig,
|
||||||
|
config.disablePoke
|
||||||
)
|
)
|
||||||
streamManager = StreamManager.new(d)
|
streamManager = StreamManager.new(d)
|
||||||
|
|
||||||
|
@ -170,6 +170,7 @@ type
|
|||||||
radiusCache: RadiusCache
|
radiusCache: RadiusCache
|
||||||
offerQueue: AsyncQueue[OfferRequest]
|
offerQueue: AsyncQueue[OfferRequest]
|
||||||
offerWorkers: seq[Future[void]]
|
offerWorkers: seq[Future[void]]
|
||||||
|
disablePoke: bool
|
||||||
|
|
||||||
PortalResult*[T] = Result[T, string]
|
PortalResult*[T] = Result[T, string]
|
||||||
|
|
||||||
@ -470,7 +471,8 @@ proc new*(T: type PortalProtocol,
|
|||||||
bootstrapRecords: @bootstrapRecords,
|
bootstrapRecords: @bootstrapRecords,
|
||||||
stream: stream,
|
stream: stream,
|
||||||
radiusCache: RadiusCache.init(256),
|
radiusCache: RadiusCache.init(256),
|
||||||
offerQueue: newAsyncQueue[OfferRequest](concurrentOffers))
|
offerQueue: newAsyncQueue[OfferRequest](concurrentOffers),
|
||||||
|
disablePoke: config.disablePoke)
|
||||||
|
|
||||||
proto.baseProtocol.registerTalkProtocol(@(proto.protocolId), proto).expect(
|
proto.baseProtocol.registerTalkProtocol(@(proto.protocolId), proto).expect(
|
||||||
"Only one protocol should have this id")
|
"Only one protocol should have this id")
|
||||||
@ -936,6 +938,11 @@ proc triggerPoke*(
|
|||||||
nodes: seq[Node],
|
nodes: seq[Node],
|
||||||
contentKey: ByteList,
|
contentKey: ByteList,
|
||||||
content: seq[byte]) =
|
content: seq[byte]) =
|
||||||
|
## In order to properly test gossip mechanisms (e.g. in Portal Hive),
|
||||||
|
## we need the option to turn off the POKE functionality as it influences
|
||||||
|
## how data moves around the network.
|
||||||
|
if p.disablePoke:
|
||||||
|
return
|
||||||
## Triggers asynchronous offer-accept interaction to provided nodes.
|
## Triggers asynchronous offer-accept interaction to provided nodes.
|
||||||
## Provided content should be in range of provided nodes.
|
## Provided content should be in range of provided nodes.
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
|
@ -27,10 +27,12 @@ type
|
|||||||
tableIpLimits*: TableIpLimits
|
tableIpLimits*: TableIpLimits
|
||||||
bitsPerHop*: int
|
bitsPerHop*: int
|
||||||
radiusConfig*: RadiusConfig
|
radiusConfig*: RadiusConfig
|
||||||
|
disablePoke*: bool
|
||||||
|
|
||||||
const
|
const
|
||||||
defaultRadiusConfig* = RadiusConfig(kind: Dynamic)
|
defaultRadiusConfig* = RadiusConfig(kind: Dynamic)
|
||||||
defaultRadiusConfigDesc* = $defaultRadiusConfig.kind
|
defaultRadiusConfigDesc* = $defaultRadiusConfig.kind
|
||||||
|
defaultDisablePoke* = false
|
||||||
|
|
||||||
defaultPortalProtocolConfig* = PortalProtocolConfig(
|
defaultPortalProtocolConfig* = PortalProtocolConfig(
|
||||||
tableIpLimits: DefaultTableIpLimits,
|
tableIpLimits: DefaultTableIpLimits,
|
||||||
@ -43,14 +45,16 @@ proc init*(
|
|||||||
tableIpLimit: uint,
|
tableIpLimit: uint,
|
||||||
bucketIpLimit: uint,
|
bucketIpLimit: uint,
|
||||||
bitsPerHop: int,
|
bitsPerHop: int,
|
||||||
radiusConfig: RadiusConfig): T =
|
radiusConfig: RadiusConfig,
|
||||||
|
disablePoke: bool): T =
|
||||||
|
|
||||||
PortalProtocolConfig(
|
PortalProtocolConfig(
|
||||||
tableIpLimits: TableIpLimits(
|
tableIpLimits: TableIpLimits(
|
||||||
tableIpLimit: tableIpLimit,
|
tableIpLimit: tableIpLimit,
|
||||||
bucketIpLimit: bucketIpLimit),
|
bucketIpLimit: bucketIpLimit),
|
||||||
bitsPerHop: bitsPerHop,
|
bitsPerHop: bitsPerHop,
|
||||||
radiusConfig: radiusConfig
|
radiusConfig: radiusConfig,
|
||||||
|
disablePoke: disablePoke
|
||||||
)
|
)
|
||||||
|
|
||||||
proc parseCmdArg*(T: type RadiusConfig, p: string): T
|
proc parseCmdArg*(T: type RadiusConfig, p: string): T
|
||||||
|
Loading…
x
Reference in New Issue
Block a user