Replace the Env Meta Interface Version with two new meta fields for the Protocol Version and the Pre-Release Version #1476
Replies: 3 comments 25 replies
-
I fully support the break up of that Alongside this update, I would be super happy to see the RPC method |
Beta Was this translation helpful? Give feedback.
-
@dmkozh mentioned today that some downstream consumers misunderstood what "protocol version" means in the interface version, so if we replace the fields with new ones, we should also rename protocol version to max supported protocol version. |
Beta Was this translation helpful? Give feedback.
-
I'd like to make an alternative proposal that I believe does not need a protocol change and will get 80% of the benefit, and is backwards compatible. We replace the uint64 interface version with a struct containing two uint32 fields. There will be no binary change, but applications that use the XDR structure as is (such as JSON-XDR format in developer tooling) will see the sub-fields isolated from one another rather than a large confusing number. case SC_ENV_META_KIND_INTERFACE_VERSION:
- uint64 interfaceVersion;
+ struct {
+ uint32 protocolVersion;
+ uint32 preReleaseVersion;
+ } interfaceVersion; This alternative suggestion doesn't have the advantage of saving 4 bytes in contracts, but we can still continue to debate that change separately. That seems like a small benefit when we can solve the primary problem with a backwards compatible change. |
Beta Was this translation helpful? Give feedback.
-
I'd like to propose that we deprecate and stop using the Env Meta Interface Version and replace it with two new Env Meta fields:
The interface version is currently a 64 bit integer containing the protocol version in the high 32 bits and the pre-release version in the low 32 bits.
The protocol version is the Stellar protocol version, such as
20
currently and21
upcoming.The pre-release version is currently zero (
0
) for any formal release that is destined for testnet/pubnet, and a non-zero incrementing value for any release to futurenet or any release that isn't destined for pubnet. It is typically a value like1
,2
,3
, etc, and then resets to 0 when the protocol release is made formally.The interface version as such takes two numbers that are easy to understand like
20
and0
, or20
and1
, and turns it into85899345920
or85899345921
respectively. This combined number is simple and easy to unwind, but also confusing and unintuitive because to the human eye it is opaque.This has been confusing for developers who have dug into what's stored in the files and those building developer tooling. Of course with a little explanation and documentation we are bringing people up to speed who need to know or who are curious, but given that the XDR format, and structures we are using would support this being self documented I think we can fix the way we're storing these values for future releases.
The Env Meta XDR that is embedded in contracts is defined to be human understandable and we're able to use the existing discriminant to add new fields with new data. Splitting up the existing interface version into the two separate fields achieves just that.
To illustrate what the change would involve, I've opened the following pull request demonstrating the change in XDR. The diff is also included below.
Ref: stellar/stellar-xdr#179
A similar proposal by @sisuresh was made here to remove the pre-release version: stellar/rs-soroban-env#1378
Beta Was this translation helpful? Give feedback.
All reactions