Skip to content

Add permissionless stale execution cleanup mechanism#6

Open
e3o8o wants to merge 1 commit into
eez-association:mainfrom
e3o8o:feat/stale-execution-cleanup
Open

Add permissionless stale execution cleanup mechanism#6
e3o8o wants to merge 1 commit into
eez-association:mainfrom
e3o8o:feat/stale-execution-cleanup

Conversation

@e3o8o
Copy link
Copy Markdown

@e3o8o e3o8o commented Feb 27, 2026

Pre-loaded executions whose state no longer matches persist in storage indefinitely. This adds a cleanup mechanism to Rollups.sol.

The _executionBlockLoaded mapping tracks when each execution was stored (separate from Execution struct to avoid breaking ZK proof inputs). There is a MAX_EXECUTION_AGE = 256 blocks (~51min at 12s/slot) and cleanupStaleExecutions(actionHash, maxAge) is permissionless.

Note that Cleanup requires BOTH: expired age AND state mismatch.

12 tests covering stale removal, preservation of valid entries, custom maxAge, selective removal, permissionless access, and edge cases.

Pre-loaded executions whose state no longer matches persist in storage
indefinitely. This adds a cleanup mechanism to Rollups.sol:

- _executionBlockLoaded mapping tracks when each execution was stored
  (separate from Execution struct to avoid breaking ZK proof inputs)
- MAX_EXECUTION_AGE = 256 blocks (~51min at 12s/slot)
- cleanupStaleExecutions(actionHash, maxAge) is permissionless
- Cleanup requires BOTH: expired age AND state mismatch
- getExecutionCount() and getExecutionBlockLoaded() view helpers

12 tests covering stale removal, preservation of valid entries,
custom maxAge, selective removal, permissionless access, and edge cases.
@e3o8o e3o8o force-pushed the feat/stale-execution-cleanup branch from faa3040 to d75df34 Compare February 27, 2026 19:50
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.

1 participant