Skip to content

Revamp Message Pool Nonce calculation #4899

@elmattic

Description

@elmattic

Summary

It appears that Forest diverges from Lotus in how the sequence number (Nonce) is calculated.

In Lotus, the MpoolPushMessage RPC method uses a message signer module to sign the message, retrieve the next nonce, and store a message UUID in the signer.
Our MpoolGetNonce RPC method implementation seems to deviate from Lotus as well.

This divergence could be a contributing factor to failure of the "send message" subcommand.

Completion Criteria

  • Investigate the differences and gather evidence that the bug is caused by incorrect Nonce handling (if possible).
  • Develop unit tests that cover all MpoolPushMessage and MpoolGetNonce implementations, identifying edge cases where our implementation falls short.
  • Refactor the Nonce calculation to align with Lotus message signer approach.
  • Integrate the relatively new sanityCheckOutgoingMessage logic, which we currently lack.

Additional Links & Resources

https://github.com/filecoin-project/lotus/blob/v1.30.0-rc2/chain/messagesigner/messagesigner.go
https://github.com/filecoin-project/lotus/blob/v1.30.0-rc2/node/impl/full/mpool.go#L307
#2726

Metadata

Metadata

Assignees

Labels

Type: TaskDiscrete task to implement

Type

No type

Projects

Status

In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions