forest
forest copied to clipboard
Implement GPBFT primitives that `certs` package uses and port `certs`
This issue entails rewriting certs package in Rust.
What needs to be done:
- Add Rust dependencies analogous to those in Go, e.g.
num-bigint, fvm_ipld_bitfield. - 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.
- Implement gpBFT types needed by the certs package, e.g.
PowerTable, ECChain, Verifierand their logic. - Implement the certs package using said dependencies, including gpBFT.
What certs package does, roughly:
- Defines
FinalityCertificate, which represents a single finalized GPBFT instance. - Allows for verification of
FinalityCertificate, thus making sure that finality can be confirmed. a. AppliesPowerTablediffs. b. VerifiesFinalityCertificatesignatures by means of using theVerifier, which is a trait define in GPBFT. A concrete Verifier must be implemented viablssigpackage, 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 asVerifieris a generic trait, so it can be mocked.