Skip to content

Commit

Permalink
Fix #1692 (#1762)
Browse files Browse the repository at this point in the history
* Fix #1692

* PR link
  • Loading branch information
tomaka authored Apr 15, 2024
1 parent 4718de9 commit d8fa238
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions light-base/src/json_rpc_service/background.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ enum MultiStageRequestTy {
StateGetKeysPaged {
prefix: Vec<u8>,
count: u32,
start_key: Vec<u8>,
start_key: Option<Vec<u8>>,
},
StateQueryStorageAt {
keys: Vec<methods::HexString>,
Expand All @@ -362,7 +362,7 @@ enum StorageRequestInProgress {
block_hash: [u8; 32],
prefix: Vec<u8>,
count: u32,
start_key: Vec<u8>,
start_key: Option<Vec<u8>>,
in_progress_results: Vec<Vec<u8>>,
},
StateQueryStorageAt {
Expand Down Expand Up @@ -1323,7 +1323,7 @@ pub(super) async fn run<TPlat: PlatformRef>(
MultiStageRequestTy::StateGetKeysPaged {
prefix: prefix.map_or(Vec::new(), |p| p.0),
count,
start_key: start_key.map_or(Vec::new(), |p| p.0),
start_key: start_key.map(|p| p.0),
},
));
}
Expand Down Expand Up @@ -2787,7 +2787,7 @@ pub(super) async fn run<TPlat: PlatformRef>(
let results_to_client = cache_entry
.iter()
.cloned()
.filter(|k| *k >= *start_key) // TODO: not sure if start should be in the set or not?
.filter(|k| start_key.as_ref().map_or(true, |s| *k > *s))
.map(methods::HexString)
.take(usize::try_from(*count).unwrap_or(usize::MAX))
.collect::<Vec<_>>();
Expand Down Expand Up @@ -3593,7 +3593,7 @@ pub(super) async fn run<TPlat: PlatformRef>(
let results_to_client = final_results
.iter()
.cloned()
.filter(|k| *k >= start_key) // TODO: not sure if start should be in the set or not?
.filter(|k| start_key.as_ref().map_or(true, |s| *k > *s))
.map(methods::HexString)
.take(usize::try_from(count).unwrap_or(usize::MAX))
.collect::<Vec<_>>();
Expand Down
1 change: 1 addition & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Fixed

- Fix `QueueFullError` being thrown even when the number of requests is way below the value passed to `jsonRpcMaxPendingRequests`. ([#1747](https://github.com/smol-dot/smoldot/pull/1747))
- The `state_getKeysPaged` JSON-RPC function no longer includes in its results the key that passed as the `startKey` parameter. ([#1762](https://github.com/smol-dot/smoldot/pull/1762))

## 2.0.23 - 2024-03-20

Expand Down

0 comments on commit d8fa238

Please sign in to comment.