Skip to content

Check UnlinkPool event metadata#55

Merged
Th0rgal merged 1 commit into
mainfrom
codex/unlink-event-metadata-check
May 14, 2026
Merged

Check UnlinkPool event metadata#55
Th0rgal merged 1 commit into
mainfrom
codex/unlink-event-metadata-check

Conversation

@Th0rgal
Copy link
Copy Markdown
Member

@Th0rgal Th0rgal commented May 14, 2026

Summary

  • add a native-decide check that UnlinkPool.spec.events matches the source interface event metadata
  • cover dynamic array event params for notes, commitments, nullifiers, and ciphertexts
  • lock indexed address/root metadata for relayer, transfer, withdraw, and router events

Checks

  • lake build Benchmark.Cases.UnlinkXyz.Pool.Compile
  • git diff --check

Note

Low Risk
Low risk: adds a native_decide-based compile-time check over event ABI metadata without changing contract/spec behavior. The main risk is test brittleness if event signatures/param ordering changes upstream.

Overview
Adds a Lean-level metadata check in Benchmark/Cases/UnlinkXyz/Pool/Compile.lean that validates UnlinkPool.spec.events contains the expected event definitions (names, param types—including tuple/array shapes—and indexed vs unindexed kinds) for deposit/transfer/withdraw/relayer/router events.

Introduces small helper definitions for common ABI ParamTypes and equality predicates, and enforces the check via example : ... = true := by native_decide.

Reviewed by Cursor Bugbot for commit 9c7a39b. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9c7a39b. Configure here.

hasEvent "VerifierRouterUpdated" [
{ name := "previousRouter", ty := ParamType.address, kind := EventParamKind.indexed },
{ name := "newRouter", ty := ParamType.address, kind := EventParamKind.indexed }
]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing event count check allows undetected extra events

Medium Severity

unlinkPoolEventMetadataMatchesSource uses hasEvent (which calls .any) to verify each expected event exists in UnlinkPool.spec.events, but never checks that the total number of events in the spec equals 7. This makes it a subset check, not an equality check. If a spurious or duplicate event were added to the spec, this "lock" would still pass silently, contradicting the PR's stated goal of verifying that spec.events matches the source interface metadata.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9c7a39b. Configure here.

@Th0rgal Th0rgal merged commit 00b4fd7 into main May 14, 2026
3 checks passed
@Th0rgal Th0rgal deleted the codex/unlink-event-metadata-check branch May 14, 2026 14:38
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