Skip to content

chore: unbonding w e2e#471

Open
samricotta wants to merge 8 commits intofeature/monitor-activation-unbondingfrom
sam/activation-unbonding-minimal
Open

chore: unbonding w e2e#471
samricotta wants to merge 8 commits intofeature/monitor-activation-unbondingfrom
sam/activation-unbonding-minimal

Conversation

@samricotta
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings October 7, 2025 09:32
@samricotta samricotta changed the base branch from main to feature/monitor-activation-unbonding October 7, 2025 09:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements an activation and unbonding timing monitor system (unbonding w e2e) for the vigilante service. The monitor tracks BTC delegations through their lifecycle, measuring activation delays and detecting timeouts.

Key changes include:

  • Addition of activation/unbonding monitoring functionality with timing metrics
  • Integration of the monitor into the main vigilante service
  • Comprehensive test coverage including e2e tests

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
monitor/monitor.go Integrates activation unbonding monitor into main monitor service
monitor/activation_unbonding_monitor.go Core monitoring logic for tracking delegation timing
monitor/expected_btcstaking_client.go Client adapter for Babylon blockchain interactions
monitor/mock_btcstaking_client.go Mock implementations for testing
monitor/activation_unbonding_monitor_test.go Unit tests for monitor functionality
monitor/activation_unbonding_monitor_metrics_test.go Tests for metrics collection
metrics/activation_unbonding.go Prometheus metrics definitions
config/monitor.go Configuration options for timing thresholds
cmd/vigilante/cmd/monitor.go CLI integration for the monitor
e2etest/activation_unbonding_e2e_test.go End-to-end tests for monitor behavior
e2etest/test_manager.go Test infrastructure improvements with deterministic randomization
e2etest/test_manager_btcstaking.go Updated to use deterministic random source
e2etest/slasher_e2e_test.go Fixed goroutine management and random source
e2etest/monitor_e2e_test.go Updated monitor instantiation
go.mod Dependency management updates
btcstaking-tracker/stakingeventwatcher/stakingeventwatcher_test.go Fixed typo in method name
btcstaking-tracker/stakingeventwatcher/mock_babylon_client.go Fixed typo in method name
Makefile Added mock generation for new interfaces

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@Lazar955 Lazar955 left a comment

Choose a reason for hiding this comment

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

looks good, just address the slasher e2e change


h := fnv.New64a()
h.Write([]byte(t.Name()))
seed := int64(h.Sum64())
Copy link
Member

Choose a reason for hiding this comment

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

why not just used timestamp for source of randomness?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

smart one! i changed

err := bsTracker.Bootstrap(0)
require.NoError(t, err)
}()
err = bsTracker.Bootstrap(0)
Copy link
Member

Choose a reason for hiding this comment

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

why is this no longer in go routine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goroutine doesnt wait, so if Start was called after (which it should be), it would race with Bootstrap. Also require in a goroutine only kills that goroutine, not the test(from what i understand).

Made it sync so Bootstrap finishes before Start runs

Copy link
Member

Choose a reason for hiding this comment

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

yeah I think in that test we don;t want it to wait

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok then ive removed the error then completely since it will fail regardless as we have require.Eventually

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.

3 participants