WEBVTT

00:00:00.500 --> 00:00:03.169
Business revision two is running on schema one.

00:00:04.069 --> 00:00:07.064
The test sets a flag in the root to make the first conversion

00:00:07.077 --> 00:00:09.121
trap after it has processed the children.

00:00:10.020 --> 00:00:13.080
Then it asks the canister to install code that needs schema

00:00:13.093 --> 00:00:13.496
two.

00:00:14.395 --> 00:00:18.249
This build carries the exact V1 contract as an accepted source.

00:00:19.147 --> 00:00:22.272
The saved Catalog matches that source, so the candidate can

00:00:22.285 --> 00:00:24.421
open the old root with its V1 type.

00:00:25.319 --> 00:00:28.509
The V2 card tells us what it will publish after restore.

00:00:30.633 --> 00:00:33.823
The root converter builds its V2 fields from V1.

00:00:34.723 --> 00:00:37.718
It adds a field set to nine hundred and moves the vector into

00:00:37.731 --> 00:00:38.564
the new cell.

00:00:39.463 --> 00:00:41.754
The backing buffer stays at the same address.

00:00:42.653 --> 00:00:46.077
For its first child, the root takes the attachment at key seven

00:00:46.090 --> 00:00:48.369
and passes the ticket to the leaf's converter.

00:00:49.267 --> 00:00:52.080
The leaf adds seven hundred in its own record and moves its

00:00:52.093 --> 00:00:54.098
owning reference to the same byte buffer.

00:00:54.997 --> 00:00:57.640
The root attaches the returned leaf at key seven.

00:00:58.538 --> 00:01:01.572
The branch converts its own fields and adds eight hundred.

00:01:02.471 --> 00:01:05.765
It delegates its leaf to the same leaf converter, then attaches

00:01:05.778 --> 00:01:06.507
that result.

00:01:07.405 --> 00:01:10.791
When the root attaches the branch again, every converted path

00:01:10.804 --> 00:01:12.223
leads back to the same actor.

00:01:14.333 --> 00:01:17.444
With the children attached, the root converter checks the flag

00:01:17.458 --> 00:01:19.319
it carried from V1 and traps.

00:01:20.220 --> 00:01:22.329
The IC rolls back the upgrade.

00:01:23.228 --> 00:01:26.991
Business revision two resumes on schema one, with the same payload

00:01:27.004 --> 00:01:28.827
and addresses as before the attempt.

00:01:29.725 --> 00:01:33.306
The test enters through the old code and appends nine more integers.

00:01:34.204 --> 00:01:36.965
The new values become part of the V1 state.

00:01:37.863 --> 00:01:41.678
The test clears the failure flag and tries the V2 upgrade again.

00:01:43.833 --> 00:01:45.681
The converters finish this time.

00:01:46.582 --> 00:01:49.928
Restore renews the leaf alias and saves a new App bound to the

00:01:49.941 --> 00:01:50.892
V2 tree.

00:01:51.790 --> 00:01:53.874
Then it writes the V2 fingerprint.

00:01:54.772 --> 00:01:58.639
When the upgrade succeeds, the IC makes the new code and state

00:01:58.652 --> 00:01:59.538
visible together.

00:02:00.436 --> 00:02:03.548
Both payload buffers kept their addresses through conversion.

00:02:04.447 --> 00:02:06.061
The runner reads schema two.

00:02:06.960 --> 00:02:10.085
Business reads one again because this build uses the original

00:02:10.098 --> 00:02:10.970
business code.

00:02:11.868 --> 00:02:14.967
The old payloads are intact, and the root and leaf have their

00:02:14.980 --> 00:02:15.944
new fields.

00:02:16.842 --> 00:02:19.876
Another append takes the root vector to four hundred and twelve

00:02:19.889 --> 00:02:20.514
items.

