-
Notifications
You must be signed in to change notification settings - Fork 207
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
liveSlots
consensus mode and better verbosity switches
#4364
Conversation
liveSlots
consensus mode and better verbosity switches
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.
I looked at all the code and I don't see any problems, but I don't clearly understand the motivation and I'm not confident about the non-determinism guarantees, so I defer to @warner .
8e69eec
to
75e3982
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.
Ok, that looks good. I would have loved to see a unit test that shows the console being disabled when consensusMode
is true, but I certainly couldn't whip one up without a couple of hours, so I can't expect anyone else to.
r+
globalThis.print = portSendingPrinter; | ||
printAll(...args); | ||
} finally { | ||
globalThis.print = savePrinter; |
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.
ok, when printAll()
causes some random object's toString
to be invoked and that does more console.log-ing, this structure should unwind the reentrancy properly, nice
6be9b40
to
3411f24
Compare
3411f24
to
535b3de
Compare
# copied from upstream | ||
/packages/xsnap/lib/object-inspect.js |
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.
@michaelfig why is this copied from upstream instead of sourced from the object-inspect
dependency in package.json?
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.
I could have commented that better. It's not a verbatim copy, it's the object-inspect.js
with an unnecessary CommonJS require('./util.inspect')
removed since it doesn't work under XS.
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.
Cool. What's the reason to prevent prettying it? If it's to make it easier to update from upstream, WDYT of using patch
and to make it work under XS?
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.
Cool. What's the reason to prevent prettying it? If it's to make it easier to update from upstream, WDYT of using
patch
and to make it work under XS?
That's fine with me, if you're bored and want something to do. 😄 Tests cover it, so it's a safe thing to try.
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.
patch-package
can't be used, though, because people might get this code directly via NPM's @agoric/xsnap
.
I notice now, after the fact, that And I see logging tests in |
refs: #2519
Description
This properly routes liveSlots output to a disabled console if in consensus mode. Also, updates the use of
$DEBUG
to be more coherent and not as bizarre (where an empty$DEBUG
would log less than a missing$DEBUG
).Also improve a longstanding wart where XS console logging displayed
quote
's hodgepodge of JSON and deeper inspection, just by replacing the whole thing with an NPM package based on Node.js'sutil.inspect
rendering.At last, all of
agoric start
,agoric start -v
, andagoric start -vv
look right, in order of increasing verbosity. Notably, when running an actual chain, no vat-level errors are displayed.Security Considerations
Documentation Considerations
Testing Considerations