Skip to content

Commit

Permalink
disable POKE for fluffy test by default closes (#1640)
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameisdaniil committed Aug 24, 2023
1 parent 820525d commit 0a5c54b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions fluffy/network/wire/portal_protocol.nim
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ const
# incoming directions.
concurrentOffers = 50

const disablePoke {.booldefine.}: bool = false

type
ToContentIdHandler* =
proc(contentKey: ByteList): results.Opt[ContentId] {.raises: [], gcsafe.}
Expand Down Expand Up @@ -933,6 +935,13 @@ proc triggerPoke*(
nodes: seq[Node],
contentKey: ByteList,
content: seq[byte]) =
## See: https://github.com/status-im/nimbus-eth1/issues/1640
## In order to properly test gossip mechanisms (e.g. in Portal Hive),
## we need the option to turn off the POKE functionality as it influenceshow
## how data moves around the network.
echo ">>> disablePoke: ", disablePoke
if disablePoke:
return
## Triggers asynchronous offer-accept interaction to provided nodes.
## Provided content should be in range of provided nodes.
for node in nodes:
Expand Down
2 changes: 1 addition & 1 deletion nimbus.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ task fluffy_test, "Run fluffy tests":
# Seperate build for these tests as they are run with a low `mergeBlockNumber`
# to make the tests faster. Using the real mainnet merge block number is not
# realistic for these tests.
test "fluffy/tests", "all_fluffy_tests", "-d:chronicles_log_level=ERROR -d:nimbus_db_backend=sqlite -d:mergeBlockNumber:38130"
test "fluffy/tests", "all_fluffy_tests", "-d:chronicles_log_level=ERROR -d:nimbus_db_backend=sqlite -d:mergeBlockNumber:38130 -d:disablePoke=true"

task utp_test_app, "Build uTP test app":
buildBinary "utp_test_app", "fluffy/tools/utp_testing/", "-d:chronicles_log_level=TRACE -d:chronosStrictException"
Expand Down

0 comments on commit 0a5c54b

Please sign in to comment.