celestia-node icon indicating copy to clipboard operation
celestia-node copied to clipboard

bug: "Error: node: failed to start: wrong network in core.ip endpoint, expected mocha-4, got celestia" is incorrect

Open jcstein opened this issue 1 year ago • 1 comments

Incorrect Network Mismatch Error Message

Current Behavior

When starting a light node without specifying --p2p.network mocha, but using a mocha RPC endpoint (--core.ip rpc-mocha.pops.one), the error message shows:

Error: node: failed to start: wrong network in core.ip endpoint, expected mocha-4, got celestia

Expected Behavior

The error message should be reversed to correctly reflect the expected vs actual network:

Error: node: failed to start: wrong network in core.ip endpoint, expected celestia, got mocha-4

Why This Needs Fixing

The current error message is confusing because:

  1. When --p2p.network is not provided, the node defaults to expecting the "celestia" network
  2. The RPC endpoint (rpc-mocha.pops.one) is actually on the mocha-4 network
  3. Therefore, the error should indicate that we expected "celestia" (the default) but got "mocha-4" (from the endpoint)

Steps to Reproduce

  1. Start a light node with:
celestia light start --core.ip rpc-mocha.pops.one
  1. Observe incorrect error message

Additional Context

This appears to be a simple string swap in the error message construction, where the expected and actual network values are reversed.

jcstein avatar Oct 24 '24 19:10 jcstein

on version

Semantic version: 0.18.2-mocha
Commit: 4309c8349857638b033a2a278da0f8ab182fdb26
Build Date: 2024-10-07T08:21:56Z
System version: arm64/darwin
Golang version: go1.23.2

jcstein avatar Oct 24 '24 19:10 jcstein