Skip to content

Move fee policy configuration from CLI args to config file#4158

Merged
jmg-duarte merged 9 commits intomainfrom
jmgd/config-fee-policies
Feb 19, 2026
Merged

Move fee policy configuration from CLI args to config file#4158
jmg-duarte merged 9 commits intomainfrom
jmgd/config-fee-policies

Conversation

@jmg-duarte
Copy link
Copy Markdown
Contributor

@jmg-duarte jmg-duarte commented Feb 13, 2026

Description

Extract FeeFactor from shared::arguments into its own shared::fee_factor module, adding Serialize/Deserialize support

Requires https://github.com/cowprotocol/infrastructure/pull/4620 to be merged before

Changes

  • Move FeePoliciesConfig, FeePolicy, FeePolicyKind, FeePolicyOrderClass, and UpcomingFeePolicies from autopilot CLI arguments to autopilot::config::fee_policy as serde-based config structs
  • Read fee_policies_config from the TOML config file (flattened into Configuration) instead of CLI flags
  • Update all e2e tests to construct fee policy config via Configuration structs and pass them through the config file

How to test

E2E + staging

@jmg-duarte jmg-duarte force-pushed the jmgd/config-fee-policies branch from a79ed14 to 8a4f648 Compare February 16, 2026 10:22
Base automatically changed from jmgd/config-drivers to main February 17, 2026 10:30
@jmg-duarte jmg-duarte marked this pull request as ready for review February 17, 2026 14:44
@jmg-duarte jmg-duarte requested a review from a team as a code owner February 17, 2026 14:44
@jmg-duarte jmg-duarte force-pushed the jmgd/config-fee-policies branch from 8cd5de1 to a826966 Compare February 17, 2026 14:46
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors fee policy configuration from CLI arguments to a TOML configuration file. The changes are applied across the codebase, including updates to E2E tests. One review comment has been kept regarding a potential logic change in a test, as it does not contradict any established rules.

Comment thread crates/e2e/tests/e2e/limit_orders.rs Outdated
Comment thread crates/e2e/tests/e2e/limit_orders.rs Outdated
Comment thread crates/e2e/src/setup/services.rs Outdated
Copy link
Copy Markdown
Contributor

@fafk fafk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left some nits.

Comment thread crates/e2e/tests/e2e/submission.rs Outdated
Comment thread crates/autopilot/src/config/mod.rs Outdated
Comment on lines +17 to +19
/// Describes how the protocol fees should be calculated.
#[serde(flatten)]
pub fee_policies_config: FeePoliciesConfig,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it make sense to not flatten the config here? Config files were related things get grouped together are easier to navigate, no?

In order to avoid weird naming originating from this one could consider naming this field fee_policies and the FeePoliciesConfig::fee_policies could be renamed to initial_policies (as opposed to upcoming_policies.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unflattened and variables renamed, let me know what you think

Comment thread crates/e2e/src/setup/services.rs Outdated
@jmg-duarte jmg-duarte added this pull request to the merge queue Feb 19, 2026
Merged via the queue into main with commit e6eedb7 Feb 19, 2026
20 checks passed
@jmg-duarte jmg-duarte deleted the jmgd/config-fee-policies branch February 19, 2026 17:07
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 19, 2026
@jmg-duarte jmg-duarte added the track:config-migration Issues/PRs relating to the autopilot and orderbook migration label Feb 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

track:config-migration Issues/PRs relating to the autopilot and orderbook migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants