diff --git a/prover/lib/compressor/Readme.md b/prover/lib/compressor/Readme.md index abbcc2c4..c0015f13 100644 --- a/prover/lib/compressor/Readme.md +++ b/prover/lib/compressor/Readme.md @@ -9,4 +9,6 @@ go build -ldflags "-s -w" -buildmode=c-shared -o libcompressor.so libcompressor. * The Java (Kotlin) part -See [jvm-libs/blob-compressor/src/main/kotlin/net/consensys/linea/nativecompressor/GoNativeBlobCompressor.kt](jvm-libs/blob-compressor/src/main/kotlin/net/consensys/linea/nativecompressor/GoNativeBlobCompressor.kt). \ No newline at end of file +See [jvm-libs/blob-compressor/src/main/kotlin/net/consensys/linea/nativecompressor/GoNativeBlobCompressor.kt](jvm-libs/blob-compressor/src/main/kotlin/net/consensys/linea/nativecompressor/GoNativeBlobCompressor.kt). + +* [How to update the dictionary](dictionary-update-guide.md) diff --git a/prover/lib/compressor/dict/25-01-15-INCOMPLETE.bin b/prover/lib/compressor/dict/25-01-15-INCOMPLETE.bin deleted file mode 100644 index 2422d663..00000000 Binary files a/prover/lib/compressor/dict/25-01-15-INCOMPLETE.bin and /dev/null differ diff --git a/prover/lib/compressor/dict/25-04-21.bin b/prover/lib/compressor/dict/25-04-21.bin new file mode 100644 index 00000000..9234a8cc Binary files /dev/null and b/prover/lib/compressor/dict/25-04-21.bin differ diff --git a/prover/lib/compressor/dictionary-update-guide.md b/prover/lib/compressor/dictionary-update-guide.md new file mode 100644 index 00000000..685c8816 --- /dev/null +++ b/prover/lib/compressor/dictionary-update-guide.md @@ -0,0 +1,22 @@ +# Blob Compression Dictionary Update Guide + +The process is simple. The only subtle point is that support for new dictionaries should be added downstream-first (i.e. first in the prover and the decompressor, and then in the blob compressor,) and that conversely retiring a dictionary should be done upstream-first (i.e. first in the blob compressor, and then in the prover, and never in a decompressor used for state reconstruction.) + +## Updating the Prover +Download the dictionary file on the machine running the prover. Add its path relative to the prover root, to the prover configuration `.toml` file, in the `dict_paths` property, under `blob_decompression`. Normally the dictionary would already be available in the Linea repository, its path looking like `"lib/compressor/dict/yy-mm-dd.bin"`. +The next time the prover is started, it will (also) load the new dictionary. Note that there is no need to recompile the decompression circuit. + +Example: +```toml +[blob_decompression] +dict_paths = [ + "/path/to/old/dictionary", + "/path/to/new/dictionary" +] +``` + +## Updating the Decompressor +The JNI library has a function `LoadDictionaries` available that can be used to add the new dictionary, similarly to the prover. There is not even a need to restart the process. + +## Updating the Blob Compressor +Unlike the prover and decompressor, the blob compressor cannot support multiple dictionaries. The `Init` function, takes as its second input the relative path of the dictionary file. The dictionary is loaded when the compressor is initialized, and it will be used for all subsequent compression operations. This initialization function can be called multiple times, and not only at the beginning of the process. But it will reset the compressor's cache, so any blocks written into an embryonic blob will be erased.