Commit 270e63b
authored
fix(PocketIC): consensus registry version of instance resumed from existing state (#7502)
This PR fixes the consensus registry version of a PocketIC instance
resumed from an existing state: for canister http outcalls to work that
registry version must be equal to the latest registry version which was
not the case for a PocketIC instance resumed from an existing state (in
that case the consensus registry version was equal to the registry
version at which the corresponding subnet was created which is not
always equal to the latest registry version if there are multiple
subnets).
More details:
- the function `check_share_against_context`
[requires](https://github.com/dfinity/ic/blob/7a8c16764cdcfb901759ff62e64ac983633fcc17/rs/https_outcalls/consensus/src/payload_builder/utils.rs#L85)
the registry version of the canister http outcall share (set to the
[latest registry
version](https://github.com/dfinity/ic/blob/7a8c16764cdcfb901759ff62e64ac983633fcc17/rs/state_machine_tests/src/lib.rs#L2347)
by PocketIC) to match the [consensus registry
version](https://github.com/dfinity/ic/blob/7a8c16764cdcfb901759ff62e64ac983633fcc17/rs/https_outcalls/consensus/src/payload_builder.rs#L181-L194)
retrieved from the consensus pool cache set by PocketIC
[here](https://github.com/dfinity/ic/blob/7a8c16764cdcfb901759ff62e64ac983633fcc17/rs/state_machine_tests/src/lib.rs#L1773)
when loading an existing subnet and
[here](https://github.com/dfinity/ic/blob/7a8c16764cdcfb901759ff62e64ac983633fcc17/rs/state_machine_tests/src/lib.rs#L1644)
when creating a new subnet;
- the function `make_registry_cup` used so far creates a CUP with the
[registry
version](https://github.com/dfinity/ic/blob/7a8c16764cdcfb901759ff62e64ac983633fcc17/rs/consensus/cup_utils/src/lib.rs#L187)
at which the corresponding registry key
`catch_up_package_contents_{subnet_id}` was
[inserted](https://github.com/dfinity/ic/blob/7a8c16764cdcfb901759ff62e64ac983633fcc17/rs/state_machine_tests/src/lib.rs#L497-L503)
into the registry (the registry version at which the corresponding
subnet was created by PocketIC);
- the function `make_registry_cup_from_cup_contents` used in this PR
creates a CUP with a [registry
version](https://github.com/dfinity/ic/blob/7a8c16764cdcfb901759ff62e64ac983633fcc17/rs/consensus/cup_utils/src/lib.rs#L33)
specified in the function's input parameters which allows PocketIC to
use the latest registry version in the CUP.1 parent 54879a4 commit 270e63b
2 files changed
+71
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1314 | 1314 | | |
1315 | 1315 | | |
1316 | 1316 | | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
1320 | | - | |
1321 | | - | |
1322 | | - | |
1323 | | - | |
1324 | | - | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
1328 | | - | |
| 1317 | + | |
1329 | 1318 | | |
1330 | 1319 | | |
1331 | 1320 | | |
| |||
1370 | 1359 | | |
1371 | 1360 | | |
1372 | 1361 | | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
1373 | 1404 | | |
1374 | 1405 | | |
1375 | 1406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | 149 | | |
151 | 150 | | |
152 | 151 | | |
| |||
516 | 515 | | |
517 | 516 | | |
518 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
519 | 540 | | |
520 | 541 | | |
521 | 542 | | |
| |||
1625 | 1646 | | |
1626 | 1647 | | |
1627 | 1648 | | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
| 1649 | + | |
| 1650 | + | |
1637 | 1651 | | |
1638 | | - | |
1639 | | - | |
1640 | 1652 | | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
| 1653 | + | |
1644 | 1654 | | |
1645 | 1655 | | |
1646 | 1656 | | |
| |||
1758 | 1768 | | |
1759 | 1769 | | |
1760 | 1770 | | |
1761 | | - | |
1762 | | - | |
1763 | | - | |
1764 | | - | |
1765 | | - | |
1766 | | - | |
1767 | 1771 | | |
1768 | 1772 | | |
1769 | 1773 | | |
1770 | 1774 | | |
1771 | 1775 | | |
1772 | 1776 | | |
| 1777 | + | |
| 1778 | + | |
1773 | 1779 | | |
1774 | 1780 | | |
1775 | 1781 | | |
| |||
0 commit comments