I accidentally found the cause while trying to fix the test cases (rlpx_test.go:TestProtocolHandshake).
It was due to misuse of interface and slice of interfaces when calling SendDEVp2p and SendEthSubproto.
The Send function is removed to avoid confusion. All codes, including tests, should use either SendDEVp2p or SendEthSubProto.
Any part of p2p package that previously used Send now use SendDEVp2p
Any part of eth package that previously used Send now use SendEthSubproto
Any part of all other packages that previously used Send now use SendDEVp2p (as logging is the only difference between the two).
SendItems should call SendDEVp2p. It is used by only p2p. Anywhere that previously used SendItems should continue to use it, not the other functions.
I accidentally found the cause while trying to fix the test cases (
rlpx_test.go:TestProtocolHandshake
). It was due to misuse of interface and slice of interfaces when callingSendDEVp2p
andSendEthSubproto
.Send
function is removed to avoid confusion. All codes, including tests, should use eitherSendDEVp2p
orSendEthSubProto
.p2p
package that previously usedSend
now useSendDEVp2p
eth
package that previously usedSend
now useSendEthSubproto
Send
now useSendDEVp2p
(as logging is the only difference between the two).SendItems
should callSendDEVp2p
. It is used by onlyp2p
. Anywhere that previously usedSendItems
should continue to use it, not the other functions.