Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devp2p: BSC support #1349

Closed
srgl opened this issue Jul 14, 2021 · 9 comments
Closed

Devp2p: BSC support #1349

srgl opened this issue Jul 14, 2021 · 9 comments

Comments

@srgl
Copy link

srgl commented Jul 14, 2021

Assuming that istanbul is the latest known fork on bsc chain with hash 0xfc3ca6b7, eth65 protocol version unable to get peers because it sends Buffer(0x00) as the ForkNext field in status message. When sending empty buffer as the ForkNext field I am getting peers. Also it works when I use additional random data filled hardfork in common config (ForkNext is random number).

@ryanio
Copy link
Contributor

ryanio commented Jul 14, 2021

Thanks for opening!

I remembered that @jochem-brouwer actually discovered this while testing our client with 1559 on Aleut and added this code here (on master):

const nextForkB = this._nextForkBlock.eqn(0)
        ? Buffer.from('', 'hex')
        : this._nextForkBlock.toArrayLike(Buffer)

Are you running an example or some code that isn't routing through there?

@srgl
Copy link
Author

srgl commented Jul 14, 2021

@ryanio I am running slightly modified peer-communication.ts example.
The thing is this commit afd00a8
should fix the issue, but I don't see this code in devp2p npm package v4.0.0
Seems like https://www.npmjs.com/package/@ethereumjs/devp2p is outdated.

@ryanio
Copy link
Contributor

ryanio commented Jul 14, 2021

@srgl ah so sorry about that, it has been some time since we did a devp2p release. I recently added les 3/4 and eth 66 support so I'll start a PR for the release and will be sure that fix is included on the changelog.

@srgl
Copy link
Author

srgl commented Jul 14, 2021

@ryanio It would be just amazing to see the fix and eth66 support soon, thanks!

@ryanio
Copy link
Contributor

ryanio commented Jul 16, 2021

@srgl devp2p v4.1.0 is now released on npm 👍 thanks for your patience

@myuniswap2000
Copy link

myuniswap2000 commented Aug 11, 2021

Hello, two big brothers. May I ask you a question please?

  1. On the BSC network, I can successfully use eth66 to communicate with peer and obtain TX

  2. However, I can't communicate with peer (only eth65 is supported) using eth65.

  3. Debug MSG is:
    'Add peer: 3.236.210.90:30311 Geth/v1.1.0-7dd68d07-20210803/linux-amd64/go1.16.3 (eth65) (total: 1)'
    DISCONNECT reason: USELESS_PEER 3.236.210.90:30311
    'Remove peer: 3.236.210.90:30311 - peer disconnect, reason: USELESS_PEER (3) (total: 0)'
    [ ---After the two sides shook hands, the other peer disconnected me ]

  4. My connection configuration common should be correct. Can successfully communicate with eth66 (BSC).
    My common configuration is:
    ---------config of @srgl
    My rlpx configuration is:
    const rlpx = new devp2p.RLPx(PRIVATE_KEY, {
    dpt,
    maxPeers: 100,
    capabilities: [devp2p.ETH.eth66,devp2p.ETH.eth65,devp2p.ETH.eth64,devp2p.ETH.eth63],
    common,
    remoteClientIdFilter: REMOTE_CLIENTID_FILTER,
    listenPort: 30311,
    clientId: Buffer.from("Geth/v1.1.0-beta/linux-amd64/go1.16.5")
    })

5, thank you very much! please help me. thank you .

@myuniswap2000
Copy link

I use the latest version

@myuniswap2000
Copy link

Disconnection occurs at:
rlpx: peer_sendAuth() -> peer_handleAck() -> peer_sendHello() -> peer_sendPing() -> Disconnection![_handleDisconnect()]

@acolytec3
Copy link
Contributor

@myuniswap2000 I'm locking this conversation as you've already asked this question on another issue. Please follow up there.

@ethereumjs ethereumjs locked as off-topic and limited conversation to collaborators Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants