-
Notifications
You must be signed in to change notification settings - Fork 229
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
Track changes to consensusMode in the kernel DB #4510
Comments
Let's see, the divergence is because userspace could use a getter or a If we elevate the consensus mode flag itself to be part of consensus, I think we need:
Storing it in We also need to remove whatever other controls exist over consensusMode so that it can only change as part of a consensus-driven transaction. I don't know how this should interact with the "download a vat transcript from the chain, replay it locally with more debugging turned on" plan. I guess transcript replay happens independently of any kernel or crankhash/activityhash, so when you're doing that replay, you can set |
Actually, it's the fault of the supervisor. It allocates differently (and sends back |
Hm. But you're right, metering differences in supervisor code execution will cause divergence in the vat's meter consumption, which will be reflected in state changes of the Meter object (for metered vats). And there's an edge case where a vat is very close to the hard-limit (the per-crank max computrons), and extra supervisor time might push it over the edge, killing the vat in the |
I saw a block that had |
That feels like it shouldn't happen. If that's the case, maybe we should have a separate issue for it? |
Thinking about this more, I've gotten myself re-confused. If we say that But Does it make any sense to every call If not, then it doesn't make sense to have a And then, getting back to the original request, maybe what we actually need is for the initial contents of the kernel DB to get hashed into an initial value for It kind of points to:
The consensus-mode switch is clearly the responsibility of the host application: swingset should just use whatever its If the host application (cosmic-swingset) offers the operator control of that switch (environment variable, whatever), then all validators must use the same setting. In fact, they must all use the So why would cosmic-swingset ever offer a way to set it to I think the only case is when you're running a degenerate (single-node) chain, or if you're running a test and you're willing to allow userspace to cause divergence in exchange for getting better vat log messages without doing a zillion replays. Neither sound like the main use case, so I think it's ok if it's not easy to set So I think we only need to store |
We only have two main cosmic-swingset use cases: sim-chain (for debugging), where consensusMode should be hardwired false, and chain-main (for production), where consensusMode should be hardwired true. It's fine if the swingset config chooses between those at initialisation time. |
What is the Problem Being Solved?
Refs: #4506
When verbose debugging is enabled, the validator will diverge from the non-debugging chain at some point. It would be better if that divergence happened quickly and obviously.
Description of the Design
Record consensus mode (a boolean) somewhere in the kernel DB so that its initial value and changes to it appear in the activityhash.
Security Considerations
Test Plan
The text was updated successfully, but these errors were encountered: