ChainSafe / forest

🌲 Rust Filecoin Node Implementation
https://forest.chainsafe.io
Apache License 2.0
639 stars 160 forks source link

F3 Rust implementation tracking issue #4552

Open ruseinov opened 4 months ago

ruseinov commented 4 months ago

Issue summary

This tracks our current progress on f3 integration.

Considerations for wrapping/re-write

Potential complications

Call Go code from Rust

Re-write

Roadmap

To minimize the timeline risk, we've decided to

go-f3 integration with sidecar/FFI approach: #4644

rust-f3 implementation work items

Fine-grained to-do for rust-f3

Implementation diagram, helpful to see what can be parallelized.

flowchart TD
 subgraph s1["signing"]
        n3["blssig"]
        n5["gnark"]
  end
 subgraph s2["cert exchange"]
        n6["server"]
        n7["client"]
        n8["store"]
  end
 subgraph s3["Internal tools"]
        n12["power store"]
        n13["caching"]
        n14["measurements"]
        n11["wal"]
  end
    A["GPBFT"] --> I["certs"] & s1 & s2 & n9["EC Backend Interface"] & n12 & n16["f3 node"] & n15["manifest"]
    n5 --> n3
    s1 --> I
    I --> s2 & n16
    n8 --> n6
    s3 --> n16
    n9 --> n16
    s2 --> n16
    n15 --> n16 & n12
    n17["merkle"] --> A

     A:::done
    classDef done fill:#008000

Other information and links

LesnyRumcajs commented 3 months ago

@hanabi1224 @ruseinov Could you please update the issue to reflect the current plan?

ansermino commented 3 months ago

@hanabi1224 Thanks a bunch for updating this! Please can you breakout the go-f3 and the rust-f3 into their own issues/epics 🙏

Am I correct in understanding that integrating the sidecar is blocked until we get more info from the go-f3 team?

ruseinov commented 3 months ago

@hanabi1224 Thanks a bunch for updating this! Please can you breakout the go-f3 and the rust-f3 into their own issues/epics 🙏

Am I correct in understanding that integrating the sidecar is blocked until we get more info from the go-f3 team?

We have some new info in that regard. It seems like there's not going to be much action in terms of participation, because that depends on mining capabilities. Those in our case depend on Curio. So we're starting with following (getting all the certs and verifying them). What this means for Forest is:

  1. Fast finality
  2. F3 snapshot data, which basically is the whole cert sequence, which according to Kuba are lightweight.

It turns out that in order to follow we don't actually need much, just the cert exchange, which is pretty self-contained. So we'll be focusing on that and the sidecar in parallel. To be continued.

hanabi1224 commented 3 months ago

@hanabi1224 Thanks a bunch for updating this! Please can you breakout the go-f3 and the rust-f3 into their own issues/epics 🙏

Am I correct in understanding that integrating the sidecar is blocked until we get more info from the go-f3 team?

@ansermino Done. #4644

As @ruseinov mentioned, we're now clear about what are missing in the current go-f3 sidecar and I will look into closing the gap in a quick and dirty way to get a working sidecar demo

ansermino commented 3 weeks ago

@ruseinov What is the current state of this? Doesn't seem like anything has notably progressed in the last month+?

ruseinov commented 3 weeks ago

We've merged the second part of certs implementation a couple of weeks ago. The crypto package issue has been revisited to include fresh changes in go-f3, which have been introduced recently and involve a custom GNARK backend. I've been recently busy with other pressing tasks, but getting back to this exactly today to flesh out cert-exchange into more smaller issues and tackle those. By the looks of it we'll need to tackle certstore interface and MemoryDB implementation first to unblock certexchange implementation.

There's also a question of go-f3 being unstable, so I'm foreseeing some changes/bug-fixes in go-f3 in the near future which we will have to reflect in our codebase as well.