Closed freak12techno closed 2 months ago
The update introduces functionalities to handle consumer commission data for validators. It adds new fetchers and generators, enhances configuration constants, and modifies Tendermint RPC interactions. Additionally, tests for both fetchers and generators ensure the new processes work correctly. A new JSON file sets a default commission rate. The update refines existing functionalities by removing unnecessary metrics and adjusts suitable test expectations accordingly.
File/Path | Summary |
---|---|
assets/consumer-commission.json | Introduces a key-value pair defining a commission rate of 0.1. |
pkg/app.go |
Adds fetchers and generators for handling consumer commission and validator commission rate, respectively. |
pkg/constants/constants.go |
Adds constant FetcherNameConsumerCommission . |
pkg/fetchers/consumer_commission.go |
Introduces ConsumerCommissionFetcher struct and related methods for fetching commission data. |
pkg/fetchers/consumer_commission_test.go |
Adds test functions for ConsumerCommissionFetcher . |
pkg/generators/single_validator_info.go |
Removes commissionGauge metric from SingleValidatorInfoGenerator . |
pkg/generators/single_validator_info_test.go |
Updates expected results length and indexing in tests. |
pkg/generators/validator_commission_rate.go |
Introduces ValidatorCommissionRateGenerator struct and related methods. |
pkg/generators/validator_commission_rate_test.go |
Adds test functions for ValidatorCommissionRateGenerator . |
pkg/tendermint/rpc.go |
Adds GetConsumerCommission method to RPC struct. |
pkg/types/tendermint.go |
Adds ConsumerCommissionResponse type. |
Below is the sequence diagram representing the interaction between fetching and generating consumer commission rates:
sequenceDiagram
participant App as App
participant Fetcher as ConsumerCommissionFetcher
participant Generator as ValidatorCommissionRateGenerator
participant RPC as Tendermint RPC
participant State as State
App->>Fetcher: NewConsumerCommissionFetcher(logger, appConfig.Chains, rpcs, tracer)
Fetcher->>RPC: fetchConsumerCommission(valcons, chainID)
RPC-->>Fetcher: ConsumerCommissionResponse
App->>Generator: NewValidatorCommissionRateGenerator(appConfig.Chains, logger)
Generator->>State: Generate(state)
State-->>Generator: Commission rates data
Generator-->>App: Prometheus metrics
In the digital meadow, data flows with grace,
Fetching commissions from each validator's place.
With new generators, metrics shine anew,
Reflecting rates in a dashboard view.
Through code we weave a structured scene,
Validators' work now clear and clean.
Hopping forward, we build and dream! 🌟🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 98.29060%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 91.01%. Comparing base (
95d607b
) to head (407edd0
).
Files | Patch % | Lines |
---|---|---|
pkg/app.go | 0.00% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
commissionGauge
metric from validator info generator.Tests
Chores