Skip to content

test(contracts): add state oracle v2 stateful invariants - #46

Open
fredo wants to merge 1 commit into
frederik/eng-4229-fixcontracts-scope-executor-event-guard-by-keyfrom
frederik/eng-4252-testcontracts-add-v2-stateful-invariants
Open

test(contracts): add state oracle v2 stateful invariants#46
fredo wants to merge 1 commit into
frederik/eng-4229-fixcontracts-scope-executor-event-guard-by-keyfrom
frederik/eng-4252-testcontracts-add-v2-stateful-invariants

Conversation

@fredo

@fredo fredo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Addresses ENG-4252.

Adds stateful invariant handlers for exclusive assignment, assertion-count and trigger-unit conservation, recoverability, terminal retirement, and owner/default-admin coupling.

@linear-code

linear-code Bot commented Jul 31, 2026

Copy link
Copy Markdown

ENG-4252

@fredo

fredo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Known inherited CI blocker: the shared workflow builds StateOracleV2 with the default unoptimized profile and fails EIP-170 size enforcement. The dedicated optimized V2 profile passes; CI/profile integration is tracked in ENG-4250. No fix is included here so the reviewed implementation remains unchanged.

}

function invariant_ownerAndDefaultAdminRemainCoupled() public view {
assertEq(oracle.owner(), ORACLE_ADMIN);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This remains true because the handler never changes ownership. The selector set has no transferOwnership or acceptOwnership action, and the ghost model has no owner state. ENG 4252 calls for this coupling across modeled transitions, so this invariant cannot catch a split during ownership handoff. Can we add the two step ownership path to the handler and check the modeled owner against the default admin role?

@fredo
fredo force-pushed the frederik/eng-4252-testcontracts-add-v2-stateful-invariants branch from d03568f to 36fa7e3 Compare August 12, 2026 11:05
@fredo
fredo marked this pull request as ready for review August 12, 2026 11:15
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