ChainSafe / forest

🌲 Rust Filecoin Node Implementation
https://forest.chainsafe.io
Apache License 2.0
632 stars 153 forks source link

We don't follow the JSON-RPC spec when closing a channel #4453

Open aatifsyed opened 3 months ago

aatifsyed commented 3 months ago

https://github.com/ChainSafe/forest/blob/42964f8d7bf60f270a15fddd5b69925688066c05/src/rpc/channel.rs#L318

The response should contain the id of the request, but ours in unconditionally null

aatifsyed commented 3 months ago

cc @elmattic

elmattic commented 3 months ago

We definitely have an issue when sending the closing response (after getting the channel cancel payload from the client).

Lotus closing message: {"jsonrpc":"2.0","method":"xrpc.ch.close","params":[<channel_id>]}

Forest closing message: {"jsonrpc":"2.0","result":{"jsonrpc":"2.0","method":"xrpc.ch.close","params":[<channel_id>]},"id":null}

I don't think it really matters to set ID to something in this context.

ansermino commented 1 month ago

The library currently used does not support channels. We are currently hacking around this, but need to find an alternative to address this.