Check UnlinkPool event metadata#55
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 } | ||
| ] |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit 9c7a39b. Configure here.


Summary
UnlinkPool.spec.eventsmatches the source interface event metadataChecks
lake build Benchmark.Cases.UnlinkXyz.Pool.Compilegit diff --checkNote
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.leanthat validatesUnlinkPool.spec.eventscontains the expected event definitions (names, param types—including tuple/array shapes—andindexedvsunindexedkinds) for deposit/transfer/withdraw/relayer/router events.Introduces small helper definitions for common ABI
ParamTypes and equality predicates, and enforces the check viaexample : ... = true := by native_decide.Reviewed by Cursor Bugbot for commit 9c7a39b. Bugbot is set up for automated code reviews on this repo. Configure here.