Skip to content

PRT machine-yield check - #282

Merged
guidanoli merged 2 commits into
mainfrom
feature/prt-machine-yield-check
Aug 28, 2026
Merged

PRT machine-yield check#282
guidanoli merged 2 commits into
mainfrom
feature/prt-machine-yield-check

Conversation

@guidanoli

Copy link
Copy Markdown
Collaborator

This PR 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, the production source contracts leverage the MachineValidityProof struct and LibMachineValidityProof library from the upstream rollups-contracts dependency, and unit tests leverage the upstream LibEmulator test 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.Y and htif.tohost Merkle proofs alongside the (already-stored) tx buffer proof, and providing such proofs to the stageTournamentResult function call.

@guidanoli guidanoli added this to the 3.0.0 milestone Aug 24, 2026
@guidanoli guidanoli self-assigned this Aug 24, 2026
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
guidanoli marked this pull request as ready for review August 28, 2026 17:55

@GCdePaula GCdePaula left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-project-automation github-project-automation Bot moved this from Todo to Waiting Merge in Rollups SDK Aug 28, 2026
@guidanoli
guidanoli merged commit bed4f17 into main Aug 28, 2026
9 checks passed
@guidanoli
guidanoli deleted the feature/prt-machine-yield-check branch August 28, 2026 19:29
@github-project-automation github-project-automation Bot moved this from Waiting Merge to Done in Rollups SDK Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants