-
Notifications
You must be signed in to change notification settings - Fork 381
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
META - Backward Compatibility #1896
Comments
cc @ajnavarro |
Storage related backward-incompatibility problemsSerialization System ChangesOur backward compatibility is tied to the serialization format used to store data on disk. Any change to this format could introduce backward incompatibilities. Payload Size Changes in
|
Conclusion of the team discussion:
|
Yes, furthermore they need to be reimplemented by any and all alternative VM implementations. Native bindings are a necessary evil which make our lives simpler for writing static analysis tools, as we don't need to add shims or hardcode Gno's standard library functions, but they should still be kept to be as little as possible. |
One general comment, additionally; let's keep track of potential backward compatibility pitfalls, yes, but I'm looking more to have:
A collection like this can tell us where to look; proper tooling can help us point to real problems before they happen. Also related: #2550 |
We can use this as a starting point to track potential backward compatibility issues we need to be aware of, and devise solutions for each along the way.
1. Native function implementations.
Context
It's important to be aware that all native functions could have backward compatibility issues when we update their native implementation. This is not introduced by the new binding solution; instead, it makes the potential issue more apparent.
During contract execution, the functionValue.nativeBody,
gno/gnovm/pkg/gnolang/op_call.go
Line 63 in 831bb6f
which is a func(*Machine) returned from iterating through nativeFuncs in stdlibs/native.go, by finding matching package and names,
gno/gnovm/stdlibs/native.go
Line 26 in 831bb6f
returns a matching func(*Machine) when the VM executes the contract.
For example, in the standard contract stdlib/std/native.gno, PrevRealm() > getRealm(1), the nativeFuncs links Gno's getRealm(1)
gno/gnovm/stdlibs/std/native.gno
Line 57 in 831bb6f
with the native implementation of X_getRealm().
gno/gnovm/stdlibs/std/native.go
Line 70 in 831bb6f
gno/gnovm/stdlibs/native.go
Line 535 in 831bb6f
Backward compatibility issues:
updating the logic in stdlibs/std/native.go could cause existing contracts to fail to execute if contract developers assume the behaviors of PrevRealm have changed in a new release.
The text was updated successfully, but these errors were encountered: