@@ -125,13 +125,8 @@ func (k Querier) Orders(c context.Context, req *types.QueryOrdersRequest) (*type
125125 return nil , status .Error (codes .Internal , err .Error ())
126126 }
127127
128- if len (pageRes .NextKey ) > 0 {
129- nextKey := make ([]byte , len (searchPrefix )+ len (pageRes .NextKey ))
130- copy (nextKey , searchPrefix )
131- copy (nextKey [len (searchPrefix ):], pageRes .NextKey )
132-
133- pageRes .NextKey = nextKey
134- }
128+ // Keep raw SDK NextKey to prevent corruption across page boundaries
129+ // Do not prepend searchPrefix as it corrupts the key for subsequent requests
135130
136131 req .Pagination .Limit -= count
137132 total += count
@@ -196,7 +191,7 @@ func (k Querier) Bids(c context.Context, req *types.QueryBidsRequest) (*types.Qu
196191 }
197192 req .Pagination .Key = key
198193
199- if unsolicited [1 ] == 1 {
194+ if unsolicited [0 ] == 1 {
200195 reverseSearch = true
201196 }
202197 } else if req .Filters .State != "" {
@@ -278,13 +273,8 @@ func (k Querier) Bids(c context.Context, req *types.QueryBidsRequest) (*types.Qu
278273 return nil , status .Error (codes .Internal , err .Error ())
279274 }
280275
281- if len (pageRes .NextKey ) > 0 {
282- nextKey := make ([]byte , len (searchPrefix )+ len (pageRes .NextKey ))
283- copy (nextKey , searchPrefix )
284- copy (nextKey [len (searchPrefix ):], pageRes .NextKey )
285-
286- pageRes .NextKey = nextKey
287- }
276+ // Keep raw SDK NextKey to prevent corruption across page boundaries
277+ // Do not prepend searchPrefix as it corrupts the key for subsequent requests
288278
289279 req .Pagination .Limit -= count
290280 total += count
0 commit comments