-
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
fix(SwingSet): remove consensusMode
flip-flop
#4768
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.
My understanding of this change is that the worker's view of consensusMode
is really a "disable console logging".
Since we seem to keep this parameter present, but always set it to false, would it make sense to rename it to something like _disableLogging
instead of _consensusMode
.
Also curious whether it's worth removing the check itself. And if we are removing the check, why can't we remove the parameter altogether?
I'm generally in favor of removing this But I hesitate because I don't know what other changes have landed to support this. The original concern was that we wanted the flexibility to change the behavior of logging (possibly between validators, and/or we didn't trust that the platform's What is the current state of I imagine this might be more possible now than it was back then, because:
@michaelfig is that last one accurate? I get lost in the layers of console-like things that |
Yes. The rendering is done in a vetted JS shim. I can vouch for the fact that it doesn't access any sources of nondeterminism.
It reports
It's much less complex than liveslots or SES. For all of these, we currently cannot upgrade them easily. Auditing them gives more confidence, but we probably need plans for what to do if we found an upgrade-necessary problem in any of them. |
Is now a good time to document clearly the path from a Maybe I'm thinking more about stack traces, which is somewhat separate. Meanwhile, our Hardened JS docs for contract writers say:
Is that still correct? |
I skimmed through #4364 (which introduced the vendored copy of Any form of I think the decision to lean in to this renderer (and make logging unconditional) is independent of our decision to use (and review) |
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.
With #4814 to track the review/rewrite, I'm ok with removing consensusMode
. Please make some tickets (if you haven't already) for building the alternate controls we talked about today ("start/stop sending console messages to the kernel process", and maybe "start/stop sending console messages to your own local stdout/stderr"). I think those are lower priority but let's not forget what our plan was.
refs: #1852
closes: #4510 closes: #4517
Description
A do-nothing
console.log
gets in the way of legitimate on-chain debugging (especially when the "chain" is just a local node). This PR implements consistent do-somethingconsole.log
, even when running in consensus.Security Considerations
The consensus guarantee is that the same code runs on all the chain followers, except for SwingSet host configuration, which is permitted to differ as long as it doesn't affect the behaviour committed in the IAVL tree or kernel DB. Running in
$DEBUG
or out of$DEBUG
mode as in this PR causes no observable consensus difference, but does affect what is displayed on the console.That change of display should not affect chain security. It was a fault of the earlier
consensusMode
rollout that caused a divergence of behaviour when running within or without consensus mode.Documentation Considerations
Testing Considerations
Should help Cosmos chain integration testing.
Being able to debug code running on chain is useful, especially since our sim-chain doesn't have many of the affordances a real Cosmos chain has. Without the debug output, we lacked insight into what would happen when actually running with Cosmos.