Skip to content

whisperv6: shhClient.Post returns an error on success #16756

Closed
@thanasik

Description

@thanasik

It seems that this commit changed the Post function to return a hash instead of an error, but not in the shhclient library, and so the shhclient sends messages correctly (other peers receive them), but shhclient.Post still returns an error.

System information

Geth version: 1.8.8
OS & Version: Ubuntu 16.04

Expected behaviour

I expected the whisper message to be sent without error.

Actual behaviour

The whisper message is sent, and received by the peer waiting on the target topic, but still returns an error object saying cannot unmarshal string into Go value of type bool.

My thought is that during this commit when the return type was changed from an error to a hash because it wasn't updated for the whisper/shhclient package, the type returns an error.

I tested the above scenario using Geth 1.8.2 (the last release before v6 was integrated into Geth), and messages are still able to be created using v5 messages instead of v6.

It seems that the underlying whisperv6's shh_post function still uses the &ignored bool as the return type, and because of that it is trying to marshal a hash type into the bool. The fix seems to be to update the underlying CallContext function here to return a hash and not an ignored bool, and to update the shhclient Post` method to return a hash instead of an error as well.

I believe this is a breaking change for clients that rely on the Post() method returning no error on success... could we get someone looking at this ASAP?

Steps to reproduce the behaviour

Create a whisperv6.NewMessage and attempt to send it using the whisper/shhclient.Post(myV6message) function.

Backtrace

cannot unmarshal string into Go value of type bool

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions