Skip to content

Commit

Permalink
limit the pagination size for all API calls to 5000 -- 2781 (#2800)
Browse files Browse the repository at this point in the history
Co-authored-by: dayuanc <wentaicui@WENTAIs-MacBook-Pro.local>
Co-authored-by: CoderZhi <thecoderzhi@gmail.com>
Co-authored-by: Raullen Chai <raullenchai@gmail.com>
  • Loading branch information
4 people authored Oct 5, 2021
1 parent 88d273d commit 3933ae9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,9 @@ func (api *Server) GetLogs(
if paginationSize == 0 {
paginationSize = 1000
}
if paginationSize > 5000 {
paginationSize = 5000
}
logs, err = api.getLogsInRange(logfilter.NewLogFilter(in.GetFilter(), nil, nil), startBlock, endBlock, paginationSize)
default:
return nil, status.Error(codes.InvalidArgument, "invalid GetLogsRequest type")
Expand Down

0 comments on commit 3933ae9

Please sign in to comment.