feat: sPOL contract metrics#57
Merged
Merged
Conversation
|
Resolved conflicts in: - observer/topics/observabletopic_string.go (regenerated) - provider/rpc.go (combined sPOLController and stakingEvents features) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Phase 1 - SPOLController global metrics: - spol_exchange_rate: POL per 1 sPOL (convertSPOLtoPOL) - spol_paused: contract paused state - spol_global_withdraw_nonce: withdrawal counter Phase 2 - Per-validator metrics via ValidatorShare contract: - spol_validator_real_dpol_balance: actual dPOL position (balanceOf) - spol_validator_delegation_locked: delegation state - spol_validator_liquid_rewards: pending rewards - spol_validator_share_exchange_rate: share exchange rate Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Fix ShareExchangeRate overflow by using big.Float instead of Uint64() - Rename spol_validator_count to spol_total_validators - Rename spol_active_validator_count to spol_active_validators - Improve share exchange rate help text clarity Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This PR adds comprehensive sPOL liquid staking monitoring for both L1 (Ethereum) and L2 (Polygon PoS).
Phase 1: SPOLController Global Metrics (L1)
spol_exchange_ratespol_pausedspol_global_withdraw_noncespol_dpol_balancespol_spol_balancespol_total_validatorsspol_active_validatorsPhase 2: Per-Validator Metrics (L1)
spol_validator_statusspol_validator_deposit_sharespol_validator_total_stakedspol_validator_real_dpol_balancespol_validator_delegation_lockedspol_validator_liquid_rewardsspol_validator_share_exchange_rateLabels:
network,provider,validator_id,validator_addressL2 Monitoring (Polygon PoS)
Account balance monitoring via existing
account_balancemetric:spol-child(0xd1CD49A08AeF3Af93457aEc17C786C2b7F48eCd7) - sPOLChild contractpol-bridger(0x71663898Df7470e3b64d52663Ff975895E9b06E8) - POL bridger accountDataDog Alerting (Computed from above metrics)
The following alerts can be configured in DataDog without code changes:
abs(sum(spol_validator_real_dpol_balance) - spol_dpol_balance) > 0abs(delta(spol_dpol_balance) - delta(spol_spol_balance)) > thresholdsum(spol_validator_deposit_share) != 100delta(spol_dpol_balance) < -10000max(spol_validator_total_staked) / spol_dpol_balance > 0.5delta(spol_global_withdraw_nonce) > NFiles Added/Modified
contracts/ValidatorShare.abi.json- New ABI for ValidatorShare contractcontracts/ValidatorShare.go- Generated Go bindingsobserver/rpc.go- Extended SPOLValidator and SPOLController structs, added new metricsprovider/rpc.go- Added contract calls for Phase 1 & Phase 2 metricsconfig.yml- Documentedspol_controller_addressconfig optionmetrics.md- Documented all new metricsConfiguration
Jira / Linear Tickets
Testing
go run cmd/main.gocurl localhost:9090/metrics | grep spol_