Skip to content

Support replacing Roots in CAR file as long as they fit within padding + existing header size #252

@masih

Description

@masih

go-car/v2 offers an API to replace root CIDs in the inner CARv1 as long as the replacement does not change the size of inner CARv1 header. This is to provide a cheap way to swap root CIDs without having to shift the inner CARv1 sections since they can be quite large.

CARv2 supports optional padding before the data payload. That function can accept replacement roots of different size as long as they fit within the Toal size of padding + current inner CARv1 header.

For example, if the replacements are smaller than existing it would expand the padding. Similarly, when the replacements are larger it would take off the padding needed to fit the new inner CARv1 header. It would then update the CARv2 header with a corrected data offset.

Relates to:

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low: Not priority right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions