diff --git a/crates/solvers/config/example.legacy.toml b/crates/solvers/config/example.legacy.toml index b075b8c3c1..5a02a7a047 100644 --- a/crates/solvers/config/example.legacy.toml +++ b/crates/solvers/config/example.legacy.toml @@ -1,3 +1,4 @@ chain-id = "1" solver-name = "CoW Solver" endpoint = "https://solver.cow.fi" +gzip-requests = false diff --git a/crates/solvers/src/boundary/legacy.rs b/crates/solvers/src/boundary/legacy.rs index 972f36ddde..83a97b5e51 100644 --- a/crates/solvers/src/boundary/legacy.rs +++ b/crates/solvers/src/boundary/legacy.rs @@ -73,7 +73,7 @@ impl Legacy { chain_id: config.chain_id.value().as_u64(), base, client: reqwest::Client::new(), - gzip_requests: false, + gzip_requests: config.gzip_requests, solve_path, config: SolverConfig { // Note that we unconditionally set this to "true". This is diff --git a/crates/solvers/src/domain/solver/legacy.rs b/crates/solvers/src/domain/solver/legacy.rs index 8b32b575c3..1ae641ef1b 100644 --- a/crates/solvers/src/domain/solver/legacy.rs +++ b/crates/solvers/src/domain/solver/legacy.rs @@ -17,6 +17,7 @@ pub struct Config { pub solver_name: String, pub chain_id: eth::ChainId, pub endpoint: Url, + pub gzip_requests: bool, } pub struct Legacy(boundary::legacy::Legacy); diff --git a/crates/solvers/src/infra/config/legacy.rs b/crates/solvers/src/infra/config/legacy.rs index 350a0bd16a..611df54733 100644 --- a/crates/solvers/src/infra/config/legacy.rs +++ b/crates/solvers/src/infra/config/legacy.rs @@ -25,6 +25,10 @@ struct Config { /// The URL of the endpoint that responds to solve requests. endpoint: String, + + /// Enabled requests compression + #[serde(default)] + gzip_requests: bool, } /// Load the driver configuration from a TOML file. @@ -44,5 +48,6 @@ pub async fn load(path: &Path) -> legacy::Config { solver_name: config.solver_name, chain_id: config.chain_id, endpoint: Url::parse(&config.endpoint).unwrap(), + gzip_requests: config.gzip_requests, } } diff --git a/crates/solvers/src/tests/legacy/mod.rs b/crates/solvers/src/tests/legacy/mod.rs index e1c882bc67..ca61a23a18 100644 --- a/crates/solvers/src/tests/legacy/mod.rs +++ b/crates/solvers/src/tests/legacy/mod.rs @@ -12,6 +12,7 @@ pub fn config(solver_addr: &SocketAddr) -> tests::Config { solver-name = 'legacy_solver' endpoint = 'http://{solver_addr}/solve' chain-id = '1' +gzip-requests = false ", )) }