wemixarchive / go-wemix

Go implementation of the Wemix project.
https://www.wemix.com/
GNU Lesser General Public License v3.0
28 stars 25 forks source link

feat: add eth 68 protocol #117

Closed egonspace closed 1 month ago

egonspace commented 3 months ago

This PR adds "eth68" protocol to go-wemix as it makes new go-wemix based on go-ethereum 1.13 possible to synchronize with legacy WEMIX network.

go-ethereum v1.13 has no eth-65(renamed to mir-65), eth-66(mir-66) protocol which is used by go-wemix legacy, so we need to add eth-66(mir-66) protocol to new go-wemix based on go-ethereum 1.13 or to add eth-68 protocol to legacy wemix nodes.

But it's not good solution to add eth-66(mir-66) protocol to new go-wemix because porting legacy code to new product makes us hard to merge new go-ethereum updates. So I added eth-68 protocol to go-wemix.

If we develop new go-wemix, several public EN nodes should be upgraded with a version having this eth-68 protocol so that new go-wemix can synchronize WEMIX legacy chain.

I refer this PR(https://github.com/ethereum/go-ethereum/pull/25980) from go-ethereum repository.

And following WEMIX extended protocol of mir-65, mir-66 is not ported because these protocol is not used or required only to BP nodes.

GetPendingTxsMsg  = 0x11
GetStatusExMsg    = 0x12
StatusExMsg       = 0x13
EtcdAddMemberMsg  = 0x14
EtcdClusterMsg    = 0x15
TransactionsExMsg = 0x16

As a result, the protocols supported by each node are as follows.

And I tested on devnet chain. 1) upgrade an EN node with this PR. (it enables eth-68 protocol on the EN) 2) on local PC, I boot up an EN which has only eth-68 protocol (disabled mir-65, mir-66) 3) this local node can synchronize blocks from genesis: success 4) this local node can import new created block after finishing sync: success