From 82f2f63df4e910601e45404b8281945e341b8fc1 Mon Sep 17 00:00:00 2001 From: wanwiset25 Date: Fri, 28 Jun 2024 18:22:07 +0400 Subject: [PATCH] add explanation --- eth/protocol.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eth/protocol.go b/eth/protocol.go index 887cad520e61..b530f7237882 100644 --- a/eth/protocol.go +++ b/eth/protocol.go @@ -38,6 +38,10 @@ const ( xdpos22 = 101 //xdpos2.2 = eth65 ) +// XDC needs the below functions because direct number equality doesn't work (eg. version >= 63) +// we should try to match protocols 1 to 1 from now on, bump xdpos along with any new eth (eg. eth66 = xdpos23 only) +// try to follow the exact comparison from go-ethereum as much as possible (eg. version >= 63 <> isEth63OrHigher(version)) + func isEth63(version int) bool { switch { case version == 63: @@ -48,7 +52,6 @@ func isEth63(version int) bool { return false } } - func isEth64(version int) bool { switch { case version == 64: @@ -57,7 +60,6 @@ func isEth64(version int) bool { return false } } - func isEth65(version int) bool { switch { case version == 65: