Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
metachris committed Jul 26, 2024
1 parent 22f68b6 commit 4392220
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions cmd/core/check-payload-value.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ var (

func init() {
checkPayloadValueCmd.Flags().Uint64Var(&slot, "slot", 0, "a specific slot")
checkPayloadValueCmd.Flags().Uint64Var(&slotMax, "slot-max", 0, "a specific max slot, only check slots before")
checkPayloadValueCmd.Flags().Uint64Var(&slotMin, "slot-min", 0, "only check slots after")
checkPayloadValueCmd.Flags().Uint64Var(&slotMax, "slot-max", 0, "a specific max slot, only check slots before (only works with --check-all)")
checkPayloadValueCmd.Flags().Uint64Var(&slotMin, "slot-min", 0, "only check slots after this one")
checkPayloadValueCmd.Flags().Uint64Var(&limit, "limit", 1000, "how many payloads")
checkPayloadValueCmd.Flags().Uint64Var(&numThreads, "threads", 10, "how many threads")
checkPayloadValueCmd.Flags().StringVar(&ethNodeURI, "eth-node", vars.DefaultEthNodeURI, "eth node URI (i.e. Infura)")
Expand Down Expand Up @@ -91,9 +91,6 @@ func checkPayloadValue(cmd *cobra.Command, args []string) {
if slotMax > 0 {
query += fmt.Sprintf(" WHERE slot<=%d", slotMax)
}
if slotMin > 0 {
query += fmt.Sprintf(" WHERE slot>=%d", slotMin)
}
query += ` ORDER BY slot DESC`
if limit > 0 {
query += fmt.Sprintf(" limit %d", limit)
Expand Down Expand Up @@ -129,6 +126,11 @@ func checkPayloadValue(cmd *cobra.Command, args []string) {
}

for _, entry := range entries {
// possibly skip
if slotMin != 0 && entry.Slot < slotMin {
continue
}

entryC <- entry
}
close(entryC)
Expand Down
2 changes: 1 addition & 1 deletion cmd/core/data-api-backfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
cliRelay string
minSlot int64
initCursor uint64
pageLimit = 200 // 200 is max on some relays
pageLimit = 100 // 100 is max on bloxroute
)

func init() {
Expand Down

0 comments on commit 4392220

Please sign in to comment.