Skip to content

Commit

Permalink
refactor: moved comment for QueryBlockRange
Browse files Browse the repository at this point in the history
  • Loading branch information
taco-paco committed Apr 30, 2024
1 parent 7c211e1 commit 5ec99fd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions chainio/clients/avsregistry/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
stakeregistry "github.com/Layr-Labs/eigensdk-go/contracts/bindings/StakeRegistry"
)

// eth_getLogs is limited to a 10,000 range, so we need to iterate over the range
const QueryBlockRange = 10_000

type AvsRegistryReader interface {
Expand Down Expand Up @@ -383,8 +384,6 @@ func (r *AvsRegistryChainReader) QueryExistingRegisteredOperatorPubKeys(

operatorAddresses := make([]types.OperatorAddr, 0)
operatorPubkeys := make([]types.OperatorPubkeys, 0)

// eth_getLogs is limited to a 10,000 range, so we need to iterate over the range
for i := startBlock; i.Cmp(stopBlock) <= 0; i.Add(i, big.NewInt(QueryBlockRange)) {
// Subtract 1 since FilterQuery is inclusive
toBlock := big.NewInt(0).Add(i, big.NewInt(QueryBlockRange-1))
Expand Down Expand Up @@ -462,8 +461,6 @@ func (r *AvsRegistryChainReader) QueryExistingRegisteredOperatorSockets(
}

operatorIdToSocketMap := make(map[types.OperatorId]types.Socket)

// eth_getLogs is limited to a 10,000 range, so we need to iterate over the range
for i := startBlock; i.Cmp(stopBlock) <= 0; i.Add(i, big.NewInt(QueryBlockRange)) {
// Subtract 1 since FilterQuery is inclusive
toBlock := big.NewInt(0).Add(i, big.NewInt(QueryBlockRange-1))
Expand Down

0 comments on commit 5ec99fd

Please sign in to comment.