You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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,
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:
Description
Originally referenced in #1896
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: