-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref-fvm version philosophy #358
Comments
There are roughly two approaches here:
I am more agreeable to (2), and it's going to take quite a bit of effort to convince me that (1) is the better approach. |
@Stebalien Please add your input here, and let's aim to close this issue with a final decision. |
First, because I'm pedantic and want us to be on the same page: Multiple FVMs:
Single FVM:
So really, the question is development. If we have multiple versions:
But I think I have a reasonably balanced solution:
This has some advantages:
Effectively this means: FVM v1.0 will support NV16. |
Now that we're embarked on M2 development, I'd like to revisit this discussion and come to a consensus. I'd like to hear from client implementors about the "sliding versions" approach, as they are the main stakeholder that will need to reason about ref-fvm versions. Tagging: @filecoin-project/lotus-maintainers @filecoin-project/forest @filecoin-project/venus
|
@Stebalien Separately from the above, I wanted to talk specifically about version number usage. The model you propose implies staying on v1 forever, but I'm pretty sure we'll introduce breaking changes in M2 and beyond. So staying on v1 would be incorrect. There are three approaches possible IMO:
|
I am not a client implementer so my suggestions should carry relatively little weight. I think that Raul's original suggestion of single FVM import with support for multiple versions has the best potential to not be a pain. Manage the versioning of behaviour internally in the code for FVM, and maintain as much historical support as reasonable through methods within the code, rather than external to the code in repository branching and versioning. I wouldn't weigh bundle size very highly yet, but maybe a stripped-down build could drop historical support in the future. I would not couple the versions of FVM to network upgrades very tightly.
|
I really think it depends on the release, but I expect that M2 will have some significant changes (especially around how accounts are handled). I expect that most network upgrades won't involve versioning the FVM itself as backwards compatibility will become more and more important as we get user-defined actors. In terms of abstracting over multiple versions, I was assuming we'd do this at the FFI layer, but we can always add a new "abstraction" crate that can pull in older versions of the FVM. That should be significantly cleaner than a bunch of ifdefs. |
@anorth Now that we have a better line of sight into the kinds and magnitudes of code changes that will go into M2, as well as future features, I'm withdrawing my skepticism around versioning ref-fvm and having multiple version imports to support various NVs. It will lead to cleaner code, and "flip the page" mental model as we ship new ref-fvm releases supporting new NVs. I fear that the build up from supporting every network version in the past will rapidly muddy the codebase. There are three kinds of changes that can go in network upgrades. We're OK with the first, kinda OK with the second one, and definitely not good with the third:
@Stebalien and I caught up today and we're aligned on this approach.
|
question what will happen in the following situation:
|
For M2, yes. But not necessarily every network version. We're going to have a lot of network versions that don't require large changes to the FVM. Really, I expect most upgrades to require much smaller changes like adding syscalls.
It really depends on the change. IMO, we'd want to add some version guards on the FIP-1001 feature. I think our primary concern is accidentally introducing consensus-breaking changes as we refactor large portions of the FVM. If the code is already there (even if it's behind an if statement), there's a lot less to be concerned about. If the change is really invasive, we might just have to either revert. |
the decision of what new things get finalized should probably happen around |
Agree, but the point I'm trying to drive home is that regardless of the scope/impact of the change, the mental model is: "this new version doesn't need to preserve backwards compatibility." |
So only cherry pick the needed PR when it’s ship time? If that’s the case sgtm! |
This discussion resulted in a successful outcome above. Closing. |
@lemmih from the forest team has raised that: currently fvm publish different versions of "Such a scheme is problematic because version 2 of the fvm crate cannot be extended with breaking changes. Its dependencies will become dated and security patches will not be back-ported. As such, version 2 will for all practical purposes, be unmaintained. From Forest's perspective, this is a complete show-stopper for us." Steb pointed out that currently, such described patches are being released with minor version. Other than thats bad semantic versioning, but more importantly it means minor versions may introducing breaking changes that will break down streaming users. If such behaviour is expected, there should be a huge warning to user in README. But in general, thats not a good eng, practise. Both David and Steb suggested, we should consider to respect the semantic versioning rule more, and introducing new create name for each version of fvm. i.e: |
From the filecoin-ffi side I have some concerns around scope expansion of the filecoin-ffi project with this fvm release strategy. For fil-crypto team, we are using filecoin-ffi to export Go bindings for our API crate, filecoin-proofs-api. The filecoin-proofs-api rust crate handles which APIs are available for which network versions (groth16, halo2, testudo, vector commits, etc). For FVM in filecoin-ffi, it is also exporting a Golang interface, but in addition to that it is including a translation layer to handle differences between the different fvm crates (fvm2, fvm3). I would suggest moving the translation layer into it’s own wrapper/API rust crate to make sure the various FVM crates play nice with each other and dependencies are resolved at that layer. This would make the filecoin-ffi build much simpler, and also help out the Rust based Filecoin clients which do not use filecoin-ffi but may need to build with multiple FVM versions and would otherwise have to deal with resolving those dependency conflicts in their own projects. |
What about supporting all previous network versions in one fvm release and handling the logic internally in the crate? That way you would be able to use whatever network version you desire for your project but still always have the latest code. We had the same discussion around a year ago but I cannot recall where, maybe on slack... |
I'm strongly in favor of making the |
It's not about accidentally breaking things, its about the complexity of supporting multiple versions. We've shipped the existing versions of the FVM knowing that we'll need to change things in the future. Future FVM versions will:
Making these changes depend on a network version internally would be difficult, to put it mildly. We're not making minor tweaks and adjustments, we're making very large changes to how everything works under the covers. Ideally, we'd have a shim inside the FVM itself to mux between different FVM versions. |
Also note: once we have multiple FVM crates, this should become much easier. We can then make backwards incompatible changes to prior FVM crates such that the APIs use common shared types. That will let us write a simple abstraction to multiplex between multiple VM versions. |
I think it's a philosophical discussion. In general, blockchains by nature want to be backwards compatible as the history, to some degree, is always important in the present. I have noticed that Filecoin works differently here. But traditionally, you want to maintain that extra logic to ensure future compatibility with previous protocol versions. Outsourcing that logic into stand-alone crates basically results in letting this part of the protocol die as nobody wants to maintain marginally used crates. You could now argue the same is true for having everything in one crate, however, that's the better design decision architecture and maintenance wise (in my opinion). |
@q9f I understand the point you're raising, but ref-fvm nor this versioning policy limits or conditions historical support in any manner, as far as I can tell. Clients are free to retain support for historical network versions in their codebases, and that support would just use the corresponding ref-fvm major version. |
Definitely agree that the ref-fvm selector should live in a separate repo or ref-fvm (I prefer the latter), so that Forest can reuse it. |
Starting a discussion for the ref-fvm version philosophy.
Things to consider:
The text was updated successfully, but these errors were encountered: