Skip to content

Commit

Permalink
fix(tee_prover): add zstd compression (#3144)
Browse files Browse the repository at this point in the history
## What ❔

Add zstd compression for the HTTP connection between
`proof_data_handler` and `zksync_tee_prover`.

## Why ❔

This enables faster intercloud communication.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.

---------

Signed-off-by: Harald Hoyer <[email protected]>
  • Loading branch information
haraldh authored Oct 22, 2024
1 parent 7c28964 commit 7241ae1
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
37 changes: 37 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/bin/zksync_tee_prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish = false
anyhow.workspace = true
async-trait.workspace = true
envy.workspace = true
reqwest.workspace = true
reqwest = { workspace = true, features = ["zstd"] }
secp256k1 = { workspace = true, features = ["serde"] }
serde = { workspace = true, features = ["derive"] }
thiserror.workspace = true
Expand Down
1 change: 1 addition & 0 deletions core/node/proof_data_handler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ zksync_utils.workspace = true
anyhow.workspace = true
axum.workspace = true
tokio.workspace = true
tower-http = { workspace = true, features = ["compression-zstd", "decompression-zstd"] }
tracing.workspace = true

[dev-dependencies]
Expand Down
2 changes: 2 additions & 0 deletions core/node/proof_data_handler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,6 @@ fn create_proof_processing_router(
}

router
.layer(tower_http::compression::CompressionLayer::new())
.layer(tower_http::decompression::RequestDecompressionLayer::new().zstd(true))
}

0 comments on commit 7241ae1

Please sign in to comment.