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

Using Prysm BN with the --bootstrap-node with and invalid signature leads to a wrong error message. #13988

Open
nalepae opened this issue May 12, 2024 · 0 comments
Assignees
Labels
Bug Something isn't working

Comments

@nalepae
Copy link
Contributor

nalepae commented May 12, 2024

Describe the bug

When running Prysm BN with this option:

--bootstrap-node=enr:-KG4QO33qhw7Erxpg_jJkUkowyDvJ4RtpsEnJuDub2DCkeoI1O5_FDd1cekoZemUn32A3ZmAyX-asvRky3w3GGJe3YQBhGV0aDKQaa4OmQYBcAD__________4JpZIJ2NIJpcITAqAEDiXNlY3AyNTZrMaED3Vk2vm3O1LtlY8VgKj7kUBkQwG81sfpoGQIF5SR4_8ODdGNwgiVYg3VkcIIlVw

we get the following error message:

ERROR p2p: Invalid address of enr:-KG4QO33qhw7Erxpg_jJkUkowyDvJ4RtpsEnJuDub2DCkeoI1O5_FDd1cekoZemUn32A3ZmAyX-asvRky3w3GGJe3YQBhGV0aDKQaa4OmQYBcAD__________4JpZIJ2NIJpcITAqAEDiXNlY3AyNTZrMaED3Vk2vm3O1LtlY8VgKj7kUBkQwG81sfpoGQIF5SR4_8ODdGNwgiVYg3VkcIIlVw provided error=failed to parse multiaddr "enr:-KG4QO33qhw7Erxpg_jJkUkowyDvJ4RtpsEnJuDub2DCkeoI1O5_FDd1cekoZemUn32A3ZmAyX-asvRky3w3GGJe3YQBhGV0aDKQaa4OmQYBcAD__________4JpZIJ2NIJpcITAqAEDiXNlY3AyNTZrMaED3Vk2vm3O1LtlY8VgKj7kUBkQwG81sfpoGQIF5SR4_8ODdGNwgiVYg3VkcIIlVw": must begin with /

The disturbing part is failed to parse multiaddr, since we did not provided a multi-address but an ENR.

When using the ENR dump tool from the devp2p tool, we see that corresponding signature is invalid.

./devp2p enrdump enr:-KG4QO33qhw7Erxpg_jJkUkowyDvJ4RtpsEnJuDub2DCkeoI1O5_FDd1cekoZemUn32A3ZmAyX-asvRky3w3GGJe3YQBhGV0aDKQaa4OmQYBcAD__________4JpZIJ2NIJpcITAqAEDiXNlY3AyNTZrMaED3Vk2vm3O1LtlY8VgKj7kUBkQwG81sfpoGQIF5SR4_8ODdGNwgiVYg3VkcIIlVw
INVALID: invalid signature on node record
Record has sequence number 1 and 6 key/value pairs.
  "eth2"      9069ae0e9906017000ffffffffffffffff
  "id"        "v4"
  "ip"        192.168.1.3
  "secp256k1" a103dd5936be6dced4bb6563c5602a3ee4501910c06f35b1fa68190205e52478ffc3
  "tcp"       9560
  "udp"       9559

So we would expected to get such an invalid signature error message instead of a failed to parse multiaddr error message.

The root cause of this bug is, in parseGenericAddrs, here we get an error, but this error is skipped and shadowed by this error.

A solution would be to first check if the given string has enode:// or enr: prefix. In this case try the enode.Parse method.
In the contrary, try the multiAddrFromStringmethod.

@nalepae nalepae added the Bug Something isn't working label May 12, 2024
@nalepae nalepae self-assigned this May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant