builtin-actors icon indicating copy to clipboard operation
builtin-actors copied to clipboard

Unify invariants checking with version in go-state-types

Open ZenGround0 opened this issue 1 year ago • 2 comments

@rvagg identified a big issue here: https://github.com/filecoin-project/builtin-actors/pull/1540#discussion_r1618121222

We should have one version of state invariants in rust maintainted here. There are two steps to this work

  1. Go through go-state-types go invariants and make sure all invariants in go are reflected in rust code. I expect they have differed fairly significantly in the last two years.
  2. In a lotus-shed or other utility (maybe even a lotus developer cli command?) hook up the rust invariants on an ffi blockstore and run them.

Running go invariants and comparing with step 2 will probably be helpful for identifying diff in the invariants implemented in both.

ZenGround0 avatar Jun 04 '24 14:06 ZenGround0

From @Stebalien

  • No significant blockers, just some unhappiness causing work involving the ffi and learning the quirks of fvm blockstore registration
  • We should build filecoin-ffi with invariants in production. Making it optional will make running unnecessarily difficult.

ZenGround0 avatar Jun 04 '24 14:06 ZenGround0

An alternative is to FFI the other way around:

  1. Make a small rust crate that builds badger and exposes the relevant methods over FFI.
  2. Do this all in rust land. See https://github.com/oligamiq/ffi-rust-go/ as an example.

If we do it this way, we can bypass lotus entirely which may end up with a nicer result. On the other hand, it's probably more work.

Stebalien avatar Jun 04 '24 14:06 Stebalien