forest icon indicating copy to clipboard operation
forest copied to clipboard

Implement GPBFT primitives that `certs` package uses and port `certs`

Open ruseinov opened this issue 1 year ago • 0 comments

This issue entails rewriting certs package in Rust.

What needs to be done:

  1. Add Rust dependencies analogous to those in Go, e.g. num-bigint, fvm_ipld_bitfield.
  2. Make sure that the package follows Rust standards and not simply replicated line by line from Go into Rust. That means that we might need to re-shuffle some constants, error-handling and type composition.
  3. Implement gpBFT types needed by the certs package, e.g.PowerTable, ECChain, Verifier and their logic.
  4. Implement the certs package using said dependencies, including gpBFT.

What certs package does, roughly:

  1. Defines FinalityCertificate, which represents a single finalized GPBFT instance.
  2. Allows for verification of FinalityCertificate, thus making sure that finality can be confirmed. a. Applies PowerTable diffs. b. Verifies FinalityCertificate signatures by means of using the Verifier, which is a trait define in GPBFT. A concrete Verifier must be implemented via blssig package, which can be done as a follow-up issue. We won't be able to test this on real certificates until this is done. Therefore this issue depends on https://github.com/ChainSafe/forest/issues/4705 to be completed, but does not require this package for the actual implementation as Verifier is a generic trait, so it can be mocked.

ruseinov avatar Aug 29 '24 12:08 ruseinov