Repository navigation
Description
This originally came up in the last few days before cutting R18 on #9570 (comment), where we needed to make changes to types stored in the bootstore and got extremely lucky that the changes we needed to make were all wire-compatible with the old types (specifically: changing Ipv4Addr-like types to IpAddr-like types, and changing required fields to Options). But this highlighted that we need a coherent story about how to make non-backwards-compatible changes. We discussed this during the update watercooler on Feb 3, and came up with this tentative plan:
- Pull the bootstore types out of
omicron-commonand into their own RFD 619-style crate. The exact organization here is TBD, because these types are pretty varied: some - likeRackNetworkConfig- are only used in the bootstore and the lockstep-as-of-ipv6 e2e integration #9570 bootstrap-agent-api, but contain types that are used in the sled-agent API or the Nexus external API or both. (This is why they've been inomicron-commonthis whole time.) - Change the deserialization of
EarlyNetworkConfigto be two-pass, where the first pass reads theschema_versionand the second pass reads the body as the appropriate version ofEarlyNetworkConfigBody(based onschema_version). - Add tests that ensure if a new version is made to the bootstore types crate, we update the parsing of
EarlyNetworkConfig. (We do something similar for the on-disk-serializedOmicronSledConfigs inside sled-agent-config-reconciler, although there we don't have theschema_versionenvelope and really should.) This relies on the existing dropshot / OpenAPI tooling keeping us honest w.r.t. only making changes to the bootstore types by adding new versions; this may require creating a "dummy" server API to cover any types that aren't covered by existing versioned APIs.
The urgency on this is pretty high; as noted above we got quite lucky that we didn't need to do this work for R18, and we really want to have all of this in place before we need to make any more changes to any of the types kept in the bootstore.
Activity
jgallagher commentedon Feb 23, 2026
Starting to look around to get the lay of the land of these types; just putting some notes here. The serialized blob kept in the bootstore contains the top-level container types
EarlyNetworkConfigandEarlyNetworkConfigBody. Both of these live in the sled-agent types crate and only used in one OpenAPI spec (sled-agent). Transitively, though, they contain most of the types that currently live undercommon::api::internal::shared::rack_init:BfdPeerConfigBgpConfigBgpPeerConfigLldpAdminStatusLldpPortConfigMaxPathConfigRackNetworkConfigPortConfigPortFecPortSpeedRouteConfigRouterLifetimeConfigSwitchLocationTxEqConfigUplinkAddressConfigand a couple types defined in
common::api::external:BfdModeImportExportPolicyThere are 23 types currently under
common::api::internal::shared::rack_init. Of the 15 listed above, here are the OpenAPI uses of them:Used by bootstrap lockstep, nexus lockstep, sled-agent:
PortConfig(there is also aPortConfigin thegatewayAPI, but it'sa different kind of port config)
RouterLifetimeConfigUsed by bootstrap lockstep, nexus lockstep, sled-agent, wicketd lockstep:
RackNetworkConfigUsed by bootstrap lockstep, nexus lockstep, bootstrap (not latest), sled-agent:
BfdPeerConfigUsed by bootstrap lockstep, nexus lockstep, wicketd lockstep, bootstrap (not latest), sled-agent:
LldpAdminStatusLldpPortConfigPortFecPortSpeedUplinkAddressConfigUsed by bootstrap lockstep, nexus lockstep, nexus external, bootstrap (not latest), sled-agent:
BgpPeerConfigSwitchLocationUsed by bootstrap lockstep, nexus lockstep, nexus external, wicketd lockstep, sled-agent:
MaxPathConfigUsed by bootstrap lockstep, nexus lockstep, nexus external, wicketd lockstep, bootstrap (not latest), sled-agent:
BgpConfigRouteConfigTxEqConfigThe remaining 8 types under
common::api::internal::shared::rack_initthat are not stored in the bootstore are:Used by only nexus lockstep:
ExternalPortDiscoveryUsed by only sled-agent:
HostPortConfigSwitchPortsNot used in any openapi specs (only
impls):MaxPathConfigErrorParseLldpAdminStatusErrorParseSwitchLocationErrorRouterLifetimeConfigErrorUplinkAddressConfigErrorThe two types stored in the bootstore but living in
common::api::externalare also used by multiple APIs:Used by bootstrap lockstep, nexus lockstep, nexus external, bootstrap (not latest), sled-agent:
BfdModeImportExportPolicyjgallagher commentedon Feb 23, 2026
Moving these out to their respective types crates might be some very low hanging fruit. Will look at this shortly.
jgallagher commentedon Feb 23, 2026
@sunshowers and I chatted about this at today's update watercooler. Tentative plan:
Fromconversions in both directions, but allows them to diverge over time if needed. @internet-diglett also suggested this while we were in the midst of landing ipv6 e2e integration #9570.)commonand intosled_agent_types::early_networking: this is consistent withEarlyNetworkingConfig, the top-level container for the bootstore, and the other OpenAPI servers that use all of these types either already depend onsled-agent-types(Nexus, bootstrap-agent) or it's fine to add it (wicketd).After that's done, we should be able to fix up the way we version, test, and deserialize
EarlyNetworkingConfigall within the sled-agent family of crates.bootstore type reorg PR 1/?: Move sled-agent-only types out of `commo…
Move `ExternalPortDiscovery` from `common` to `nexus-types` (#9905)
Move latest `BgpPeer` and `SwitchPortSettings` from `common` to `nexu…
Move more BGP types from `omicron-common` to `nexus-types` (#9921)
Move some BGP external API types from `omicron-common` to `nexus-type…
Remove sled-agent API to read the current bootstore contents (#9928)
Move `common::api::internal::rack_init::*` types to `sled_agent_types…
Break `EarlyNetworkConfig` up to support cleaner bootstore type chang…
`EarlyNetworkConfigBody`: make `rack_network_config` non-optional (#9948