Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use GET Request For Driver Quotes (#1835)
This PR changes the driver's `quote` endpoint to be an HTTP `GET` instead of `POST`. The rationale behind this change is that `GET` requests are more cache friendly, and we intend on caching `driver` quote requests in our infrastructure. That being said - I did notice that the `deadline` parameter is included in the query string and, therefore, might affect the cache. I am unsure if our caching configuration in the infrastructure allows "skipping" query parameters for determining cache hits. If not we can: - Move the `deadline` to be an HTTP header - Make `deadline` optional and have a default value in the `driver` - Other ideas I haven't thought of... Note that ### Test Plan Unit tests should continue to pass. You can also manually run the driver locally and tests a quote request: ``` % curl -s "http://localhost:11088/mybologna/quote?sellToken=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&buyToken=0xDEf1CA1fb7FBcDC777520aa7f396b4E015F497aB&amount=1000000000000000000&kind=sell&deadline=2024-03-25T00:00:00.000Z" | jq { "amount": "29273928646386956708", "interactions": [ { "target": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "value": "0", "callData": "0x095ea7b30000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d0000000000000000000000000000000000000000000000000000000000000000" }, { "target": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "value": "0", "callData": "0x095ea7b30000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" }, { "target": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d", "value": "0", "callData": "0x8803dbee0000000000000000000000000000000000000000000000019641e3010406b9a40000000000000000000000000000000000000000000000000e043da61725000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab41ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000def1ca1fb7fbcdc777520aa7f396b4e015f497ab" } ], "solver": "0x7e5f4552091a69125d5dfcb7b8c2659029395bdf" } ``` The OpenAPI spec gets verified in CI.
- Loading branch information