-
Notifications
You must be signed in to change notification settings - Fork 799
feat: full spec version implementation #1384
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of rewording suggestions, otherwise lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, these codes that are valid for Starknet.js v7.1.0, will be no more valid:
const myProvider = new RpcProvider({ nodeUrl: "https://free-rpc.nethermind.io/sepolia-juno/v0_7", specVersion: "0.7" });
console.log( "rpc =", await myProvider.getSpecVersion()
What's the motivation of this breaking change? Has someone requested it?
Isn't a patch number increase allowed only for non-breaking changes?
If the patch number become discriminant, is Starknet.js v7 compatible with rpc 0.7.0 & 0.7.1? with 0.8.0 & 0.8.1?
Or only with 0.7.1 & 0.8.1? Will other patch versions be rejected when aRpcProvider
will be instantiated?
We asked to Lava network to discriminate major.minor nodes versions. What will happen with this PR?
As described isVersion has been refactored to work with a wildcard, so during dev expectation is:
Yes, SW to detect patch Spec incompatibility. As spec versioning is described as major.major.major whitch means all subversions are breaking, some more, some less. So the only logical solution is to have full version dininition in the code.
Yes, but for starknetjs we are in pre-release and haven't done v7 main release yet for exactly that reason. Once we do, we can't introduce any more breaking changes before v8. For spec, it is as described above, but it is expected even do I would argue spec should only have major and minor.
There are only warnings for patch mismatches and errors on major mismatches. |
Co-authored-by: Petar Penović <[email protected]>
🎉 This PR is included in version 7.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Motivation and Resolution
Expand subversion specification validation on provider instantiation with create().
SupportedRpcVersion
is now the full spec version 0.8.1[provider, channel].readSpecVersion()
read recorded spec version from channel[provider, channel].getSpecVersion()
fetch from API full spec version[provider, channel].setupSpecVersion()
has functionality of oldgetSpecVersion(), return spec version if recorded else fetch, test for supported versions and store if fine, else throw errorRpcChannel.channelSpecVersion
constant specifying for which specversion the channel is designedUsage related changes
Moved version and resolution util methods from
utils/provider
toutils/resolve
Development related changes
Spec version is now in full form major.minor.patch (actual starknet spec is major.major.major)
Checklist: