fix(ses): normalize bestEffortsStringify property order#1678
Conversation
699e759 to
84f2ac7
Compare
|
As noted, this is a breaking change. In agoric-sdk, we document those using conventional commits; that is: either change the commit message headline to What's the convention in endo? Documenting it in CONTRIBUTING.md would be handy. |
|
Have we carefully considered the costs and benefits of a breaking change in the marshal and patterns packages? The packages aren't at 1.x yet, but since they're deployed on chain, let's suppose that they were. This breaking change would bump the version to 2.x. What is the support policy for 1.x clients? |
|
cc @mhofman regarding breaking change. What kind of breaking change? I suspect that any breaking change at this layer gets integrated in the kernel and would break a full replay of the chain. I imagine there are exceptions. For example, if this change demonstrably does not cause a divergence in the material of observed messages in the entire history of the chain. I’m pretty sure the time for breaking changes at this layer has come to an end and that all such changes going forward need to be framed as differently-named opt-in alternatives. |
|
cc @warner for upgrade and breaking changes. |
|
I’ve reviewed the change and like the outcome. Withholding my stamp until we hear back from @mhofman and @warner whether this needs to be an opt-in behavior change to preserve continuity of Agoric chains. If this would break continuity of Agoric chains, we would need to discuss ways we can make progress in |
|
I'll defer to @warner for the authoritative answer, but my understanding is that the version of SES and endo loaded in vats, both by the supervisor & lockdown bundles, and by the vat bundle, are fixed at vat creation / upgrade time, and that changing any bundle requires a vat upgrade. As such, only changes that have an incompatibility with the usage of the API are breaking, and will require some kind of versioning support (which Swingset currently lacks). While a change in the property order of serialization is observable, I do not consider that part of the API, and as such is a "minor" semver change. Therefore, it is ok to include this change in agoric-sdk. The only effect is that vat started (and maybe upgraded?) after this change is deployed will use this new order. Other vats, including replaying ones, will continue to use the previous implementation. |
02fdacf to
799de2e
Compare
|
@warner @kriskowal @gibson042 @mhofman @dckc , at the upcoming kernel meeting, I would like to use this PR as a test case to understand what should count as a breaking change, and what coordination we need for a PR like this to proceed. |
|
Summary of the kernel meeting discussion:
|
caef296 to
016e799
Compare
dckc
left a comment
There was a problem hiding this comment.
@kriskowal says:
I’ve reviewed the change and like the outcome.
and discussion with @warner addressed my upgrade concerns.
|
On 2nd thought, I defer to @kriskowal , because I don't clearly understand endo's breaking change policy / norms. Is this a breaking change? If so, should its git commit message conform to conventional commits syntax for such? |
@kriskowal , what say you? Should I change the commit message to |
|
My intuition is that, apart from the chain, most consumers will not rely on
consistent property order and this should not require dependees to make
changes to compensate for the upgrade. So, this does not require any
breaking change ceremony.
…On Sat, Jul 29, 2023 at 11:55 AM Mark S. Miller ***@***.***> wrote:
On 2nd thought, I defer to @kriskowal <https://github.com/kriskowal> ,
because I don't clearly understand endo's breaking change policy / norms.
Is this a breaking change? If so, should its git commit message conform to
conventional commits syntax for such?
@kriskowal <https://github.com/kriskowal> , what say you? Should I change
the commit message to fix(ses)!: ?
—
Reply to this email directly, view it on GitHub
<#1678 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAOXBXHPBZVBAK2GQ5ZRCLXSVMBDANCNFSM6AAAAAA2MSID4I>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
I defer to @kriskowal to approve still. Perhaps I'll get comfortable witht that way of looking at breaking in due course, but I'm not there yet. I recall once when we changed a type in some JSDoc or .d.ts, we considered it not a breaking change because it had no runtime impact, but one of our customers pointed out that it broke their build, so inasmuch as it required maintenance work by them, it was a breaking change from their perspective. Likewise, this change caused tests to fail in agoric-sdk, which is tangible evidence that while consumers perhaps should not rely on consistent property order, at least one of them does. |
|
@kriskowal , how to proceed? |
|
In case it helps decide whether we add a |
016e799 to
d937985
Compare
kriskowal
left a comment
There was a problem hiding this comment.
My thinking is that semantic versioning is currently irrelevant for Agoric SDK since our process for upgrades is to sync all packages regardless of version numbers. So, until or unless we move toward a model where Agoric SDK dependencies are versioned piecemeal, contracts have independent lockfiles, and the platform moves independently from contracts, Agoric SDK will really be stuck in the realm where the platform itself must never admit a breaking change. In this world, breaking CI is not equivalent to breaking production and the cost of upgrading golden masters must be bourn regardless.
For every other use of @endo/* and ses, I expect they’re already on the semantic version train and use a separate lockfile for every application. In this world, the spectrum of norms varies from Hyrum’s Law (and its corollary that all changes are breaking changes) all the way out to the other law (If a dependency in npm changes and nobody depends on it, it’s not a breaking change). Here in the practical middle, Apart from Agoric SDK,ses is the only package anyone relies on in production. For these users, the moral calculus hinges on what happens if someone runs yarn upgrade ses.
- The risk of marking this as a minor/patch/non-breaking change is that a user (like Agoric SDK) depends on some behavior of
sesthat causes a CI failure. I tend to agree with @dckc that anything that causes someone else’s CI to fail afteryarn upgradeis a breaking change. - The risk of marking this as a breaking-change is that the same user will run
yarn upgradeand not receive a security fix that is available only if you expressly upgrade to@latestand sort out the breaking changes.
My feeling is that Agoric SDK’s golden master tests are too tightly constrained and that other users are unlikely (thought not impossible) to break in this way. I would like to err on the side of accidentally creating work for these people after a yarn upgrade rather than wait for them to adopt a major version to get a fix.
However, if we do elect to treat this as a breaking change, we will need to back-port security fixes to all prior major version trains.
So, I release @erights to land this change either way. I can bear the shared responsibility either way.
However, if we do mark this as a breaking change, please recall that the full incantation is:
!must be in the subject likefix(ses)!: normalize etcAND*BREAKING CHANGE*:with an explanation must appear in the body of the commit message
Our tooling does not work unless you provide both indications! The later section will appear in the changelog entry that Lerna generates.
d937985 to
137daff
Compare
I elect not to add the |
Currently
bestEffortsStringifyuses the default property enumeration order, which is insertion order. As a result, semantically neutral changes that happen to change property insertion order accidentally cause error messages to change, breaking golden tests of error messages.See example breakage at https://github.com/Agoric/agoric-sdk/actions/runs/5572658660/jobs/10178998419?pr=5422#step:5:212
With expository whitespace:
vs
Amusingly, at least in this case, the golden is in property-name sorted order, so this change will not break that one golden. However, this PR may very well break other golden error tests; but only those that were inherently fragile anyway.