-
Notifications
You must be signed in to change notification settings - Fork 74
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
fix(errors): Restore support for SES 0.18.3 and prior #2093
fix(errors): Restore support for SES 0.18.3 and prior #2093
Conversation
a7b4e0d
to
74fb32e
Compare
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.
LGTM but I'll let Mark decide if this is the best fallback to take.
74fb32e
to
976286c
Compare
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.
If this were a long lived anomaly, I might desire a more accurate bare
emulation. By I don't buy the "in perpetuity". We cannot ever get stuck needing to support an infinite number of prior versions, because some of those will have fatal problems.
So this PR LGTM, thanks!
packages/errors/index.js
Outdated
// The Agoric chain's bootstrap vat runs with a version of SES that predates | ||
// the addition of the 'bare' method, so we must fall back to quote behavior | ||
// for that environment. (2024) |
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.
Is this 2024 a year reference?
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.
Yes, to indicate when we thought this because, as @erights points out, it cannot be permanent. But, as @michaelfig indicated, it’s true for the lifetime of Agoric’s current chain. My understanding is that we can only upgrade the chain bootstrap vat at genesis.
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.
To clarify, we are planning on replacing the environment in which core evals run, and retire the bootstrap vat, at which point old agoric chains will be able to evaluate core evals without the need for this backwards compatibility. Technically replacement is not an upgrade (something something ship of Theseus)
bareOrQuote as bare, | ||
makeError, | ||
note, | ||
quote, | ||
redacted, | ||
throwRedacted, |
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.
Alternative possibility:
bareOrQuote as bare, | |
makeError, | |
note, | |
quote, | |
redacted, | |
throwRedacted, | |
makeError, | |
note, | |
quote, | |
bare = quote, | |
redacted, | |
throwRedacted, |
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.
As noted with the failing test, our module transform does not support this pattern. Per the convergence of great minds, this was the shape of my first attempt!
c596adf
to
c86880f
Compare
For sure. Hopefully, the unstoppable force can move the immovable object. I suspect the only way out of this situation is for the chain bootstrap vat to eval a final contract that bequeaths its authority to a replacement chain bootstrap vat. We would presumably prevent any further core evals to execute in the original chain bootstrap vat via governance. |
Description
Agoric’s chain bootstrap vat runs with a version of SES that predates the
bare
function. Consequently, any library including@endo/errors
running in a contract bundle in that vat must be prepared to shim any features absent on the globalassert
.Security Considerations
I do not believe this comes with direct security implications, but the situation emphasizes the need for extra scrutiny for programs admitted thru governance to run in the Agoric bootstrap vat given that it runs on a fixed version of SES.
Scaling Considerations
None.
Documentation Considerations
None.
Testing Considerations
This includes a test that fails before the fix and passes after the fix. To review this PR, rebase incrementally and run tests before and after the fix.
Compatibility Considerations
The
bare
method falls through to the behavior ofquote
. This is consistent with the behavior of programs were written before the addition ofbare
, so I expect them to converge if that is indeed important.Upgrade Considerations
[ ] Includes*BREAKING*:
in the commit message with migration instructions for any breaking change.[ ] UpdatesNEWS.md
for user-facing changes.