Allow solvers to set custom gas fees in their solution#4299
Conversation
Adds optional `maxFeePerGas` and `maxPriorityFeePerGas` fields to the Solution DTO. When provided, these override the driver's default gas price estimation during settlement submission. Both fields must be set together or both absent. When a replacement transaction is pending, the solver's values are raised to at least the replacement minimum (node requirement). Otherwise the solver's values are used as-is, allowing both higher and lower fees than the driver default. Closes #4297
|
Reminder: Please consider backward compatibility when modifying the API specification.
Caused by: |
Verifies that a solution with custom maxFeePerGas and maxPriorityFeePerGas settles successfully end-to-end.
There was a problem hiding this comment.
Code Review
This pull request introduces the ability for solvers to provide optional gas fee overrides (max_fee_per_gas and max_priority_fee_per_gas) for settlement transactions. These overrides are integrated into the Solution domain model, DTOs, and the settlement submission logic in Mempools, where they are used to replace driver-side estimations while still respecting replacement transaction bidding requirements. The changes include updates to the OpenAPI specification, internal solver DTOs, and comprehensive test coverage for the new functionality. No critical issues were found in the implementation.
| /// Verify that a solution with custom gas fee overrides settles successfully. | ||
| #[tokio::test] | ||
| #[ignore] | ||
| async fn settle_with_gas_fee_override() { |
There was a problem hiding this comment.
Would it be difficult to assert the overrides were actually used?
There was a problem hiding this comment.
Added the tx assertions.
Summary
Adds optional
maxFeePerGasandmaxPriorityFeePerGasfields to the solver Solution response. When provided, these override the driver's default gas price estimation during settlement submission.Behavior
Changes
max_fee_per_gasandmax_priority_fee_per_gastoSolutionGasFeeOverridetype, carry throughSolution→Settlementfinal_gas_pricebefore submissionHow to test
New e2e test
Related issues
Fixes #4297