ChainSafe / ChainSafe/forest

Fix message deserialisation in `jsonrpsee`

Open
#4,004 2 comments 0 reactions 0 assignees View on GitHub
Status: Needs Triage
Dominant language
Rust
Stars
697
Forks
200
Avg merge
1d 5h
Merged PRs (30d)
65

Description

**Issue summary**

This is a follow-up of https://github.com/ChainSafe/forest/pull/3978.

For testing our `Filecoin.ChainNotify` code, we relied on some .js scripts (see link below) to open channels and cancel them.
However, this script had to be modified when sending the cancel message payload by adding the `id` field to the JSON payload:

```
this.sendWs({
jsonrpc: '2.0',
method: 'xrpc.cancel',
params: [json.id],
// This was added as a workaround
id: null,
})
```

The modification is because `jsonrpsee` can't deserial the message if the `id` field is missing. This hinders the correct cancelation of a channel in Forest.
The `id` field is optional according to the spec. So, this is likely a bug in this crate.

**Task summary**

- [ ] Fork the `jsonrpsee` crate
- [ ] Make the fix and test it
- [ ] Merge the PR into the upstream branch

**Acceptance Criteria**

- [ ] Canceling a channel works, even if `id` field is missing

**Other information and links**

https://github.com/filecoin-shipyard/js-lotus-client-provider-browser/blob/master/index.js#L163-L166

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.