Skip to content

Commit

Permalink
Enable optional chunked RLPx messages (#1010)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
mjfh committed Mar 29, 2022
1 parent a64da32 commit 4696a53
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
9 changes: 7 additions & 2 deletions Makefile
Expand Up @@ -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 && \
Expand Down
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -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<br>
Disable legacy chunked RLPx messages which are enabled by default for
synchronising against `Nethermind` nodes

* ENABLE_EVMC=1<br>
Enable mostly EVMC compliant wrapper around the native Nim VM

Expand Down
7 changes: 6 additions & 1 deletion nimbus/vm_compile_info.nim
Expand Up @@ -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.}

Expand Down
2 changes: 1 addition & 1 deletion vendor/nim-eth

0 comments on commit 4696a53

Please sign in to comment.