Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit 9eb4eeb

Browse files
author
aljo242
committed
Merge branch 'release/v1.x.x' into chore/backport-772
2 parents 418deb9 + f73a9b0 commit 9eb4eeb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+675
-215
lines changed

abci/strategies/aggregator/mocks/mock_price_applier.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

abci/strategies/aggregator/mocks/mock_vote_aggregator.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

abci/strategies/codec/mocks/extended_commit_codec.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

abci/strategies/codec/mocks/vote_extension_codec.go

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

abci/strategies/currencypair/mocks/mock_currency_pair_strategy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

abci/strategies/currencypair/mocks/mock_oracle_keeper.go

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

abci/types/mocks/mock_oracle_keeper.go

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ require (
3838
github.com/spf13/cobra v1.8.1
3939
github.com/spf13/viper v1.19.0
4040
github.com/stretchr/testify v1.10.0
41-
github.com/vektra/mockery/v2 v2.46.0
41+
github.com/vektra/mockery/v2 v2.50.0
4242
go.uber.org/zap v1.27.0
4343
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
4444
golang.org/x/net v0.32.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,8 +1428,8 @@ github.com/uudashr/iface v1.2.1 h1:vHHyzAUmWZ64Olq6NZT3vg/z1Ws56kyPdBOd5kTXDF8=
14281428
github.com/uudashr/iface v1.2.1/go.mod h1:4QvspiRd3JLPAEXBQ9AiZpLbJlrWWgRChOKDJEuQTdg=
14291429
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
14301430
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
1431-
github.com/vektra/mockery/v2 v2.46.0 h1:DKIFj6hAPGwmOYiWfWzdsQtBgU8ozPXo3Bwbmf+Ku80=
1432-
github.com/vektra/mockery/v2 v2.46.0/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8=
1431+
github.com/vektra/mockery/v2 v2.50.0 h1:0GYRH38nKiRghwUq+0aJXG1sT3yyTYj/J1xQRM8kGzQ=
1432+
github.com/vektra/mockery/v2 v2.50.0/go.mod h1:xO2DeYemEPC2tCzIZ+a1tifZ/7Laf/Chxg3vlc+oDsI=
14331433
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
14341434
github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
14351435
github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=

oracle/config/api.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ type APIConfig struct {
4040

4141
// Name is the name of the provider that corresponds to this config.
4242
Name string `json:"name"`
43+
44+
// MaxBlockHeightAge is the oldest an update from an on-chain data source can be without having its
45+
// block height incremented. In the case where a data source has exceeded this limit and the block
46+
// height is not increasing, price reporting will be skipped until the block height increases.
47+
MaxBlockHeightAge time.Duration `json:"maxBlockHeightAge"`
4348
}
4449

4550
// Endpoint holds all data necessary for an API provider to connect to a given endpoint
@@ -123,5 +128,9 @@ func (c *APIConfig) ValidateBasic() error {
123128
}
124129
}
125130

131+
if c.MaxBlockHeightAge < 0 {
132+
return fmt.Errorf("max_block_height_age cannot be negative")
133+
}
134+
126135
return nil
127136
}

oracle/config/api_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,36 @@ func TestAPIConfig(t *testing.T) {
135135
},
136136
expectedErr: false,
137137
},
138+
{
139+
name: "good config with max_block_height_age",
140+
config: config.APIConfig{
141+
Enabled: true,
142+
Timeout: time.Second,
143+
Interval: time.Second,
144+
ReconnectTimeout: time.Second,
145+
MaxQueries: 1,
146+
Name: "test",
147+
Endpoints: []config.Endpoint{{URL: "http://test.com"}},
148+
BatchSize: 1,
149+
MaxBlockHeightAge: 10 * time.Second,
150+
},
151+
expectedErr: false,
152+
},
153+
{
154+
name: "bad config with negative max_block_height_age",
155+
config: config.APIConfig{
156+
Enabled: true,
157+
Timeout: time.Second,
158+
Interval: time.Second,
159+
ReconnectTimeout: time.Second,
160+
MaxQueries: 1,
161+
Name: "test",
162+
Endpoints: []config.Endpoint{{URL: "http://test.com"}},
163+
BatchSize: 1,
164+
MaxBlockHeightAge: -10 * time.Second,
165+
},
166+
expectedErr: true,
167+
},
138168
{
139169
name: "bad config with invalid endpoint (no url)",
140170
config: config.APIConfig{

oracle/metrics/mocks/mock_metrics.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

oracle/mocks/PriceAggregator.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

oracle/mocks/mock_oracle.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/math/voteweighted/mocks/mock_cc_validator_store.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)