freenet-core
freenet-core copied to clipboard
Contract versioning
The contract API will evolve over time, and we should support a contract versioning mechanism to allow these changes in a backward compatible way.
Here is a suggested approach for representing the versions.
enum ContractContainer {
Wasm(WasmAPIVersion),
// Non-Wasm contracts supported here
}
enum WasmAPIVersion {
V0_0_1 { wasm_code : Wasm, parameters : [u8] },
V0_0_2 { wasm_code : Wasm, parameters : [u8] },
}
For serializing these enums I suggest using a variable length integer library such as varuint, for maximum flexibility.