Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Nov 18, 2024
1 parent a5f248d commit 71f9c5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions arbnode/blockmetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var DefaultBlockMetadataFetcherConfig = BlockMetadataFetcherConfig{
}

func BlockMetadataFetcherConfigAddOptions(prefix string, f *pflag.FlagSet) {
f.Bool(prefix+".enable", DefaultBlockMetadataFetcherConfig.Enable, "enable syncing blockMetadata using a bulk blockMetadata api")
f.Bool(prefix+".enable", DefaultBlockMetadataFetcherConfig.Enable, "enable syncing blockMetadata using a bulk blockMetadata api. If the source doesn't have the missing blockMetadata, we keep retyring in every sync-interval (default=5mins) duration")
rpcclient.RPCClientAddOptions(prefix+".source", f, &DefaultBlockMetadataFetcherConfig.Source)
f.Duration(prefix+".sync-interval", DefaultBlockMetadataFetcherConfig.SyncInterval, "interval at which blockMetadata are synced regularly")
f.Uint64(prefix+".api-blocks-limit", DefaultBlockMetadataFetcherConfig.APIBlocksLimit, "maximum number of blocks allowed to be queried for blockMetadata per arb_getRawBlockMetadata query.\n"+
Expand Down Expand Up @@ -73,7 +73,7 @@ func (b *BlockMetadataFetcher) fetch(ctx context.Context, fromBlock, toBlock uin

func (b *BlockMetadataFetcher) persistBlockMetadata(query []uint64, result []gethexec.NumberAndBlockMetadata) error {
batch := b.db.NewBatch()
queryMap := util.ArrayToMap(query)
queryMap := util.ArrayToSet(query)
for _, elem := range result {
pos, err := b.exec.BlockNumberToMessageIndex(elem.BlockNumber)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion util/common.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package util

func ArrayToMap[T comparable](arr []T) map[T]struct{} {
func ArrayToSet[T comparable](arr []T) map[T]struct{} {
ret := make(map[T]struct{})
for _, elem := range arr {
ret[elem] = struct{}{}
Expand Down

0 comments on commit 71f9c5a

Please sign in to comment.