From 4696a533027a0eedf89482c591e928f301d8e03f Mon Sep 17 00:00:00 2001 From: Jordan Hrycaj Date: Tue, 29 Mar 2022 10:19:32 +0100 Subject: [PATCH] Enable optional chunked RLPx messages (#1010) * Enable optional chunked RLPx messages why: Legacy feature used by Nethermind details: Disable with make flag: ENABLE_CHUNKED_RLPX=0 * Rebase & bump nim-eth * Fix default behaviour why: Got lost somehow. Comments do not match GNU make code directives. --- Makefile | 9 +++++++-- README.md | 4 ++++ nimbus/vm_compile_info.nim | 7 ++++++- vendor/nim-eth | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 88a4b2058..a0fc399fa 100644 --- a/Makefile +++ b/Makefile @@ -92,15 +92,20 @@ ifneq ($(ENABLE_EVMC), 0) endif # disabled by default, enable with ENABLE_VM2LOWMEM=1 -ifneq ($(ENABLE_VM2LOWMEM), 0) +ifneq ($(if $(ENABLE_VM2LOWMEM),$(ENABLE_VM2LOWMEM),0),0) NIM_PARAMS += -d:vm2_enabled -d:lowmem:1 else # disabled by default, enable with ENABLE_VM2=1 - ifneq ($(ENABLE_VM2), 0) + ifneq ($(if $(ENABLE_VM2),$(ENABLE_VM2),0),0) NIM_PARAMS += -d:vm2_enabled endif endif +# chunked messages enabled by default, use ENABLE_CHUNKED_RLPX=0 to disable +ifneq ($(if $(ENABLE_CHUNKED_RLPX),$(ENABLE_CHUNKED_RLPX),1),0) +NIM_PARAMS := $(NIM_PARAMS) -d:chunked_rlpx_enabled +endif + #- deletes and recreates "nimbus.nims" which on Windows is a copy instead of a proper symlink update: | update-common rm -rf nimbus.nims && \ diff --git a/README.md b/README.md index 6474756ee..fe8895072 100644 --- a/README.md +++ b/README.md @@ -217,6 +217,10 @@ engine is compiled. The variables are listed with decreasing priority (in case of doubt, the lower prioritised variable is ignored when the higher on is available.) + * ENABLE_CHUNKED_RLPX=0
+ Disable legacy chunked RLPx messages which are enabled by default for + synchronising against `Nethermind` nodes + * ENABLE_EVMC=1
Enable mostly EVMC compliant wrapper around the native Nim VM diff --git a/nimbus/vm_compile_info.nim b/nimbus/vm_compile_info.nim index f9bb0f73b..2b08f08fa 100644 --- a/nimbus/vm_compile_info.nim +++ b/nimbus/vm_compile_info.nim @@ -18,7 +18,12 @@ func vmName(): string = const VmName* = vmName() - warningMSg = "*** Compiling with " & VmName & " enabled" + warningMSg = block: + var rc = "*** Compiling with " & VmName + when defined(chunked_rlpx_enabled): + rc &= ", chunked-rlpx" + rc &= " enabled" + rc {.warning: warningMsg.} diff --git a/vendor/nim-eth b/vendor/nim-eth index e794c149f..4c7cdcaaf 160000 --- a/vendor/nim-eth +++ b/vendor/nim-eth @@ -1 +1 @@ -Subproject commit e794c149f5df4047a9067fe55c9479893512a4b1 +Subproject commit 4c7cdcaaf2147953624f20cd78b439151751c5a9