Skip to content

Commit

Permalink
disable POKE for fluffy tests by default (#1640)
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameisdaniil committed Aug 24, 2023
1 parent 820525d commit 1a28678
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ all_fluffy_portal_spec_tests: | build deps

all_fluffy_tests: | build deps
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim c -r $(NIM_PARAMS) -d:chronicles_log_level=ERROR -d:nimbus_db_backend=sqlite -d:mergeBlockNumber:38130 -o:build/$@ "fluffy/tests/$@.nim"
$(ENV_SCRIPT) nim c -r $(NIM_PARAMS) -d:chronicles_log_level=ERROR -d:nimbus_db_backend=sqlite -d:mergeBlockNumber:38130 -d:disablePoke=true -o:build/$@ "fluffy/tests/$@.nim"

# builds and runs the fluffy test suite
fluffy-test: | all_fluffy_portal_spec_tests all_fluffy_tests
Expand Down
8 changes: 8 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,12 @@ 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.
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

0 comments on commit 1a28678

Please sign in to comment.