@@ -151,7 +151,7 @@ the network.
151
151
152
152
### GetAccountRange (0x00)
153
153
154
- ` [reqID: P, rootHash: B_32, startingHash: B_32, responseBytes: P] `
154
+ ` [reqID: P, rootHash: B_32, startingHash: B_32, limitHash: B_32, responseBytes: P] `
155
155
156
156
Requests an unknown number of accounts from a given account trie, starting at the
157
157
specified account hash and capped by the maximum allowed response size in bytes. The
@@ -161,6 +161,7 @@ remote node and reconstruct a state subtrie locally.
161
161
- ` reqID ` : Request ID to match up responses with
162
162
- ` rootHash ` : Root hash of the account trie to serve
163
163
- ` startingHash ` : Account hash of the first to retrieve
164
+ - ` limitHash ` : Account hash after which to stop serving data
164
165
- ` responseBytes ` : Soft limit at which to stop returning data
165
166
166
167
Notes:
@@ -170,8 +171,8 @@ Notes:
170
171
an empty reply. It is the responsibility of the caller to query an state not older than
171
172
128 blocks.
172
173
- The responding node is allowed to return ** less** data than requested (own QoS limits),
173
- but the node ** must** return at least one account, unless no account exists in the
174
- requested range.
174
+ but the node ** must** return at least one account. If no accounts exist between ` startingHash ` and ` limitHash ` , then
175
+ the first (if any) account ** after ** ` limitHash ` must be provided.
175
176
- The responding node ** must** Merkle prove the starting hash (even if it does not exist)
176
177
and the last returned account (if any exists after the starting hash).
177
178
@@ -188,7 +189,7 @@ Rationale:
188
189
Caveats:
189
190
190
191
- When requesting accounts from a starting hash, malicious nodes may skip ahead and return
191
- a gaped reply. Such a reply would cause sync to finish early with a lot of missing data.
192
+ a gapped reply. Such a reply would cause sync to finish early with a lot of missing data.
192
193
Proof of non-existence for the starting hash prevents this attack, completely covering
193
194
the range from start to end.
194
195
- No special signaling is needed if there are no more accounts after the last returned
@@ -219,7 +220,7 @@ Notes:
219
220
220
221
### GetStorageRanges (0x02)
221
222
222
- ` [reqID: P, rootHash: B_32, accountHashes: [B_32], startingHash: B, responseBytes: P] `
223
+ ` [reqID: P, rootHash: B_32, accountHashes: [B_32], startingHash: B, limitHash: B, responseBytes: P] `
223
224
224
225
Requests the storage slots of multiple accounts' storage tries. Since certain contracts
225
226
have huge state, the method can also request storage slots from a single account, starting
@@ -231,6 +232,7 @@ locally.
231
232
- ` rootHash ` : Root hash of the account trie to serve
232
233
- ` accountHashes ` : Account hashes of the storage tries to serve
233
234
- ` startingHash ` : Storage slot hash of the first to retrieve
235
+ - ` limitHash ` : Storage slot hash after which to stop serving
234
236
- ` responseBytes ` : Soft limit at which to stop returning data
235
237
236
238
Notes:
0 commit comments