ChainSafe / ChainSafe/forest

Handle properly BLS signatures cache

Open
#2,929 0 comments 0 reactions 0 assignees View on GitHub
MessagePool Priority: 4 - Low Type: Bug
Dominant language
Rust
Stars
697
Forks
200
Avg merge
1d 5h
Merged PRs (30d)
65

Description

**Issue summary**

The recent reviving of `mpool pending`/`stat` subcommands (#2740) exhibits some issues regarding our handling of the BLS signature cache in Forest message pool.

Each time we are pushing a new signed message to the pool, we're also adding its signature to the BLS cache so we are able to recover a signed message from an unsigned one.
However in some circumstances (mainly when the node is just running for a few minutes) the cache doesn't hold the signatures and the mpool subcommands could fail with:

`Error: {"code":0,"message":"Could not recover sig"}`

Conceptually if we use a cache, we should either handle signature reconstruction when missing, or make sure the cache stays in sync.
Ideally we should also add to Prometheus the cache hit rate metrics so we can make sure the cache is sized appropriately.

**Other information and links**

https://github.com/ChainSafe/forest/blob/main/blockchain/message_pool/src/msgpool/msg_pool.rs#L149

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.