-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix False Positive Alerts in Incorrect Bond Balance Monitor #7
base: main
Are you sure you want to change the base?
Conversation
✅ Heimdall Review Status
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Left a couple nits, overall the logic looks good
- Looks like the current tests still work, but parsing the past and current withdrawals separately and adding them together is new logic that should have its own test
- I checked the other two gate files that make use of
HistoricalEvents
and their invocations of it shouldn't encounter this issue
Review Error for awilliams1-cb @ 2025-01-31 19:39:16 UTC |
Co-authored-by: Alexis Williams <148368153+awilliams1-cb@users.noreply.github.com>
Co-authored-by: Alexis Williams <148368153+awilliams1-cb@users.noreply.github.com>
Co-authored-by: Alexis Williams <148368153+awilliams1-cb@users.noreply.github.com>
Review Error for awilliams1-cb @ 2025-02-01 19:16:15 UTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Context & Root Cause
The existing Gatelang monitor for Dispute Game Incorrect Bond Balance was producing false positive alerts due to a race condition between the real-time
Events
data source andHistoricalEvents
. This issue occurs when:Recommended Fix by Hexagate
Hexagate suggested excluding the current block's withdrawals from HistoricalEvents and tracking real-time withdrawals separately using the
Events
source. This prevents race conditions and ensures accurate ETH balance monitoring.Implemented Fix
modified the monitor script with the following changes:
1. Separate Tracking for Current and Historical Withdrawals
currentWithdrawal
source usingEvents
to track real-time ETH withdrawals from the Dispute Game contract.pastWithdrawalEvents
to exclude current block withdrawals by filtering based onBlockNumber {}
.currentWithdrawals
to extract amounts fromcurrentWithdrawal
events and sum them correctly.2. Ensured Correct Balance Calculation
Testing & Validation
Next Steps