PRT machine-yield check - #282
Merged
Merged
Conversation
Base automatically changed from
feature/update-rollups-contracts-3.0.0-alpha.9
to
main
August 26, 2026 11:12
This commit alters the signature of IDaveConsensus.stageTournamentResult to receive a machine-validity proof (which encompasses not only the start of the tx buffer, where the outputs Merkle root is written, but also the iflags.Y and htif.tohost registers, which are necessary to check whether the machine is manually yielded with an rx accepted reason). If the tournament result is that of a machine that is not manually yielded or with the wrong reason, then DaveConsensus will not allow such a post-epoch machine state to be staged. This prevents ill-formed machine states from ever being finalized on-chain. In such cases, the guardian may foreclose the application, releasing user funds through the emergency withdrawal and deposit refunds mechanisms. Implementation-wise, this feature leverages the MachineValidityProof struct and LibMachineValidityProof library from the upstream rollups-contracts dependency. Diff is therefore minimized locally with great code reuse both on the source and test contracts. Unit tests leverage the LibEmulator test utility also from upstream rollups-contracts. This commit also adjusts documentation regarding the epoch lifecycle. This commit does not make the necessary adjustments on the Sling node. Among the foreseen changes are: storing iflags.Y and htif.tohost Merkle proofs alongside the (already-stored) tx buffer proof, and passing such proofs to the stageTournamentResult function call.
guidanoli
force-pushed
the
feature/prt-machine-yield-check
branch
from
August 26, 2026 11:14
2fff1fa to
53c4c42
Compare
guidanoli
marked this pull request as ready for review
August 28, 2026 17:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR alters the signature of
IDaveConsensus.stageTournamentResultto receive a machine-validity proof (which encompasses not only the start of the tx buffer, where the outputs Merkle root is written, but also theiflags.Yandhtif.tohostregisters, which are necessary to check whether the machine is manually yielded with an rx accepted reason). If the tournament result is that of a machine that is not manually yielded or with the wrong reason, thenDaveConsensuswill not allow such a post-epoch machine state to be staged. This prevents ill-formed machine states from ever being finalized on-chain. In such cases, the guardian may foreclose the application, releasing user funds through the emergency withdrawal and deposit refunds mechanisms.Implementation-wise, the production source contracts leverage the
MachineValidityProofstruct andLibMachineValidityProoflibrary from the upstreamrollups-contractsdependency, and unit tests leverage the upstreamLibEmulatortest utility.🚧 Why is this PR in draft? This PR does not yet contain the necessary adjustments on the Sling node. Among the foreseen changes are: storing
iflags.Yandhtif.tohostMerkle proofs alongside the (already-stored) tx buffer proof, and providing such proofs to thestageTournamentResultfunction call.