diff --git a/cmd/eth1indexer/main.go b/cmd/eth1indexer/main.go index a9ba7c0c61..5d2a50b13d 100644 --- a/cmd/eth1indexer/main.go +++ b/cmd/eth1indexer/main.go @@ -379,7 +379,7 @@ func main() { } if *enableEnsUpdater { - err := bt.ImportEnsUpdates(client.GetNativeClient()) + err := bt.ImportEnsUpdates(client.GetNativeClient(), 1000) if err != nil { utils.LogError(err, "error importing ens updates", 0, nil) continue diff --git a/cmd/misc/main.go b/cmd/misc/main.go index c20601067d..e163f50940 100644 --- a/cmd/misc/main.go +++ b/cmd/misc/main.go @@ -1117,7 +1117,7 @@ func indexOldEth1Blocks(startBlock uint64, endBlock uint64, batchSize uint64, co } if importENSChanges { - if err := bt.ImportEnsUpdates(client.GetNativeClient()); err != nil { + if err := bt.ImportEnsUpdates(client.GetNativeClient(), math.MaxInt64); err != nil { utils.LogError(err, "error importing ens from events", 0) return } diff --git a/db/ens.go b/db/ens.go index 371cebd280..5c5044e892 100644 --- a/db/ens.go +++ b/db/ens.go @@ -322,7 +322,7 @@ type EnsCheckedDictionary struct { name map[string]bool } -func (bigtable *Bigtable) ImportEnsUpdates(client *ethclient.Client) error { +func (bigtable *Bigtable) ImportEnsUpdates(client *ethclient.Client, readBatchSize int64) error { key := fmt.Sprintf("%s:ENS:V", bigtable.chainId) ctx, done := context.WithTimeout(context.Background(), time.Second*30) @@ -335,7 +335,7 @@ func (bigtable *Bigtable) ImportEnsUpdates(client *ethclient.Client) error { row_ := row[DEFAULT_FAMILY][0] keys = append(keys, row_.Row) return true - }, gcp_bigtable.LimitRows(1000)) // limit to max 1000 entries to avoid blocking the import of new blocks + }, gcp_bigtable.LimitRows(readBatchSize)) // limit to max 1000 entries to avoid blocking the import of new blocks if err != nil { return err }