StackDependenciesZIP64

ZIP64

Last updated: Nov 19, 2026


Rationale

ZIP64 is the 64-bit extension of the ZIP archive format. Fluid Attacks keeps each in-scope client repository as one ZIP64 object in Amazon S3. The object holds the history of the repository (.git) and its checkout. clones writes the object, and each consumer reads it through one library in fluidattacks-core.

These are the primary reasons why Fluid Attacks selected ZIP64 and not a tar archive or one object for each file:

  • The central directory at the end of the archive is an index of all the entries. A reader gets the index with one or two byte-range requests. Then, it gets each file with one more byte-range request at the offset of that file. Thus, a consumer that needs one file does not download the repository.
  • Each entry has its own compression. Thus, a reader decompresses only the entries that it reads.
  • The archive is written from start to end, with no seek back. Thus, clones sends the archive directly to a multipart upload, and no archive file is on the disk.
  • 64-bit sizes and entry counts remove the limits of classic ZIP: 4 GiB for each archive and 65,535 entries. Some client repositories are larger than 9 GiB, and one has 161,792 entries.
  • The packing is deterministic. Entries are in the byte order of their names, and all entries have the same timestamp. Thus, the same tree always gives the same bytes.
  • .git goes first and is not compressed. Thus, a consumer that needs only the history reads one contiguous range.
  • Many tools can read the format: the zip crate in Rust, the zipfile module in Python, and unzip. Thus, an engineer can examine an archive without special tools.
  • One object replaces the earlier pair of a .tar.gz archive and one object for each file of the checkout. The ZIP64 object is 0.35 of the size of what it replaces. The bucket went from 13.8 million objects to approximately 48,000.

Alternatives

These are the other formats that Fluid Attacks examined to keep a whole repository as one object. The list starts with the format that is most interesting for the requirements of Fluid Attacks.

tar with Zstandard

A tar archive compressed with Zstandard (.tar.zst).

  • It compresses better and faster than DEFLATE, and it decompresses very fast.
  • The seekable format of Zstandard splits the stream into frames that a reader can get one at a time.
  • But tar has no index of its entries. To find one file, a reader must read all the headers before it, or Fluid Attacks must keep its own index of the tar entries.
  • The seekable format is in the contrib directory of Zstandard. Few libraries and tools support it.

tar with gzip

A tar archive compressed with gzip (.tar.gz). Fluid Attacks used this format for in-scope repositories until 2026-11. Out-of-scope repositories still use it.

  • All systems can read it.
  • But gzip is one stream, and tar has no index. To read one file, a reader must download and decompress all the bytes before that file.
  • Because of this, Fluid Attacks also kept each file of the checkout as an object of its own. The two copies were written at different times. Thus, they could show different commits.

tar with xz

A tar archive compressed with xz (.tar.xz).

  • It gives the best compression ratio of the tar options.
  • Its block format lets a reader start at a block boundary.
  • But tar still has no index of its entries.
  • Compression is slow, and it uses much memory. Each sync of a large repository would take more time and a larger instance.

tar with bzip2

A tar archive compressed with bzip2 (.tar.bz2).

  • Its blocks are independent. Thus, tools such as lbzip2 decompress them in parallel.
  • But tar has no index of its entries.
  • It is slower than gzip and Zstandard, and its ratio is lower than that of xz.

7z

The 7-Zip archive format.

  • With solid compression, it gives a very good ratio.
  • But a solid block compresses many files together. To read one file, a reader must decompress its block from the start.
  • The writer must seek back to write the header. Thus, it cannot write directly to a multipart upload.
  • Rust and Python have less library support for it than for ZIP.

Classic ZIP

The ZIP format without the ZIP64 extension.

  • It has the same index and per-entry compression as ZIP64.
  • But it is limited to 4 GiB for each archive and 65,535 entries. Some client repositories are larger than these limits.

Git bundle

A git bundle: one file with a packfile and the references of the repository.

  • It holds the full history, and git can clone from it.
  • But it holds no checkout. A consumer must download the full bundle and run git to get one file.

One object for each file

Each file of the checkout as an S3 object of its own. Fluid Attacks used this approach together with .tar.gz until 2026-11.

  • A reader can get one file with one request.
  • But each sync must reconcile millions of objects, and the PUT and LIST requests were more than half of the cost of the bucket.
  • The history must be kept in a second object. Thus, the two copies can show different commits.

Disadvantages

Fluid Attacks accepts these disadvantages of ZIP64:

  • DEFLATE compresses each file alone. Thus, the ratio is lower than that of xz or Zstandard on a whole tar stream.
  • To open an archive, a reader gets all of the central directory. The time to open increases with the number of entries. An archive with 161,792 entries opens in approximately 4 seconds from outside AWS. After that, each file read takes approximately 0.3 seconds.
  • The ZIP format lets an archive declare unsafe paths, links, and entry sizes. Thus, the library in fluidattacks-core checks each entry name and kind, never follows a link, and stops a read that requests the cached bytes too many times.

Usage

Fluid Attacks uses ZIP64 for these tasks:

  • clones packs each in-scope repository after a sync and sends it directly to its object in Amazon S3. When the stored archive is already at the commit of the branch, clones keeps it and does not clone the repository again.
  • The RepositoryArchive class of fluidattacks-core opens an archive, reads one file at a time by byte ranges, and extracts only the paths that a consumer needs.
  • integrates gives a signed URL of the archive of a root to the consumers that have no credentials of their own.

On this page