Commit d1a81e6
authored
refactor(flexible-outcalls): remove obsolete subnet_size param from context's generate_from_args (#9037)
Removes the obsolete `subnet_size` param from
`CanisterHttpRequestContext::generate_from_args` and use
`node_ids.len()` instead, while rejecting empty node_ids with
`NoNodesAvailableForDelegation`, so as to make the API less confusing.
This is done because in production, `subnet_size` and `node_ids.len()`
are the same, except for the special (critical error) case when the
subnet record's `membership` is empty:
* `node_ids` is derived from the registry's subnet record's membership
[here](https://github.com/dfinity/ic/blob/4bb874fc5cc90e25ef1b003f932a48da40eb34a6/rs/messaging/src/message_routing.rs#L862-L869)
(de-duplicated via `BTreeSet`)
* `subnet_size` is also calculated from the registry's subnet record's
membership
[here](https://github.com/dfinity/ic/blob/master/rs/messaging/src/message_routing.rs#L905-L919)
(de-duplicated via `BTreeSet`), **BUT** there is a fallback when the
membership is empty, namely to `SMALL_APP_SUBNET_MAX_SIZE` (13) with a
warn! log (while the `node_ids` remain empty).
* Also in some tests, the two [can
diverge](https://github.com/dfinity/ic/blob/4bb874fc5cc90e25ef1b003f932a48da40eb34a6/rs/test_utilities/execution_environment/src/lib.rs#L206-L215),
which is irrelevant here.1 parent 2e61b35 commit d1a81e6
4 files changed
Lines changed: 33 additions & 14 deletions
File tree
- rs
- execution_environment/src
- test_utilities/execution_environment/src
- tests/networking
- types/types/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1104 | 1104 | | |
1105 | 1105 | | |
1106 | 1106 | | |
1107 | | - | |
1108 | 1107 | | |
1109 | 1108 | | |
1110 | 1109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
2642 | 2642 | | |
2643 | 2643 | | |
2644 | 2644 | | |
2645 | | - | |
2646 | | - | |
| 2645 | + | |
2647 | 2646 | | |
2648 | 2647 | | |
2649 | 2648 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
511 | 510 | | |
512 | 511 | | |
513 | 512 | | |
514 | 513 | | |
515 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
516 | 518 | | |
517 | 519 | | |
518 | 520 | | |
| |||
579 | 581 | | |
580 | 582 | | |
581 | 583 | | |
582 | | - | |
| 584 | + | |
583 | 585 | | |
584 | 586 | | |
585 | 587 | | |
| |||
1247 | 1249 | | |
1248 | 1250 | | |
1249 | 1251 | | |
1250 | | - | |
| 1252 | + | |
1251 | 1253 | | |
1252 | 1254 | | |
1253 | 1255 | | |
| |||
1257 | 1259 | | |
1258 | 1260 | | |
1259 | 1261 | | |
1260 | | - | |
| 1262 | + | |
1261 | 1263 | | |
1262 | 1264 | | |
1263 | 1265 | | |
| |||
1267 | 1269 | | |
1268 | 1270 | | |
1269 | 1271 | | |
1270 | | - | |
| 1272 | + | |
1271 | 1273 | | |
1272 | 1274 | | |
1273 | 1275 | | |
| |||
1287 | 1289 | | |
1288 | 1290 | | |
1289 | 1291 | | |
1290 | | - | |
| 1292 | + | |
1291 | 1293 | | |
1292 | 1294 | | |
1293 | 1295 | | |
| |||
1297 | 1299 | | |
1298 | 1300 | | |
1299 | 1301 | | |
1300 | | - | |
| 1302 | + | |
1301 | 1303 | | |
1302 | 1304 | | |
1303 | 1305 | | |
| |||
1307 | 1309 | | |
1308 | 1310 | | |
1309 | 1311 | | |
1310 | | - | |
| 1312 | + | |
1311 | 1313 | | |
1312 | 1314 | | |
1313 | 1315 | | |
| |||
1335 | 1337 | | |
1336 | 1338 | | |
1337 | 1339 | | |
1338 | | - | |
| 1340 | + | |
1339 | 1341 | | |
1340 | 1342 | | |
1341 | 1343 | | |
| |||
1344 | 1346 | | |
1345 | 1347 | | |
1346 | 1348 | | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
1347 | 1366 | | |
1348 | 1367 | | |
1349 | 1368 | | |
| |||
0 commit comments