Skip to content

Commit

Permalink
fix: CCIP-2594 remove pageIndex HardLimit for query on CCIPConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
defistar committed Aug 16, 2024
1 parent 58da22a commit 94d02d3
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions internal/reader/home_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ import (

const (
defaultConfigPageSize = uint64(100)
// pageIndexHardLimit is the maximum number of pages that the poller will fetch
// this is set as 1 so that we can get 100 chainConfigs with in 1 rpc call
// this can be increased once total chains reach 100 or more.
pageIndexHardLimit = 1
)

//go:generate mockery --name HomeChain --output ./mocks/ --case underscore
Expand Down Expand Up @@ -133,7 +129,7 @@ func (r *homeChainPoller) fetchAndSetConfigs(ctx context.Context) error {
var allChainConfigInfos []ChainConfigInfo
pageIndex := uint64(0)

for pageIndex < pageIndexHardLimit {
for {
var chainConfigInfos []ChainConfigInfo
err := r.homeChainReader.GetLatestValue(
ctx,
Expand All @@ -159,10 +155,6 @@ func (r *homeChainPoller) fetchAndSetConfigs(ctx context.Context) error {
pageIndex++
}

if pageIndex >= pageIndexHardLimit {
r.lggr.Warnw("pageIndex hard limit reached or exceeded", "limit", pageIndexHardLimit)
}

r.setState(convertOnChainConfigToHomeChainConfig(r.lggr, allChainConfigInfos))

if len(allChainConfigInfos) == 0 {
Expand Down

0 comments on commit 94d02d3

Please sign in to comment.