Skip to content

feat: add proveAndFinalizeWithdrawalTransaction for L3 immediate TEE finality#328

Open
robriks wants to merge 4 commits into
privacyfrom
feat/immediate-tee-finality
Open

feat: add proveAndFinalizeWithdrawalTransaction for L3 immediate TEE finality#328
robriks wants to merge 4 commits into
privacyfrom
feat/immediate-tee-finality

Conversation

@robriks
Copy link
Copy Markdown

@robriks robriks commented Jun 4, 2026

This PR demonstrates the minimalist approach for solidity-layer support of the privacy appchain as an L3 settling to the Base L2. The changes are as simple as possible, adjusting only the parameters necessary for the Base stack to be used for an L3 settling to L2, rather than L2 (Base) settling to L1 (Ethereum).

Summary

  • Adds proveAndFinalizeWithdrawalTransaction to OptimismPortal2, enabling atomic prove-and-finalize in a single transaction for L3 chains with TEE-backed immediate finality (where PROOF_MATURITY_DELAY_SECONDS == 0)
  • Extracts shared withdrawal proof verification logic into _verifyWithdrawalProof internal helper, used by both proveWithdrawalTransaction and the new combined function
  • Makes SLOW_FINALIZATION_DELAY and FAST_FINALIZATION_DELAY immutable constructor parameters in AggregateVerifier (via FinalizationDelays struct) to support L3 configurations with zero-delay finalization
  • Adds canProveAndFinalize view function for off-chain tooling to check preconditions
  • Adds deploy-config/local-tee.json for local TEE-enabled devnet deployments

Testing

  • New tests for proveAndFinalizeWithdrawalTransaction happy path and all revert conditions
  • Existing proveWithdrawalTransaction and finalizeWithdrawalTransaction tests pass (refactor is behavior-preserving)
  • AggregateVerifier tests updated for immutable finalization delays
  • Deploy script and config tests updated

@robriks robriks self-assigned this Jun 4, 2026
…fier changes

Co-authored-by: Cursor <cursoragent@cursor.com>
@robriks robriks requested review from dguenther, hughy and wbj-cb June 5, 2026 19:04
}
if (_input.disputeGameFinalityDelaySeconds == 0) {
console.log("WARNING: disputeGameFinalityDelaySeconds is 0 - immediate finality mode enabled");
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe some sort of configuration guard would be useful to make sure deployers either set all the 'immediate finality mode' flags or none of them?


// This function bypasses the proof maturity delay check enforced by checkWithdrawal.
// It is only safe to use on chains configured for immediate TEE-backed finality.
if (PROOF_MATURITY_DELAY_SECONDS != 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does this need to check anchorStateRegistry.disputeGameFinalityDelaySeconds() != 0? Not sure if that's relevant here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants