Skip to content

Migrate banned users, order events cleanup, and S3 config to config file#4192

Merged
jmg-duarte merged 1 commit intomainfrom
jmgd/config/misc
Feb 23, 2026
Merged

Migrate banned users, order events cleanup, and S3 config to config file#4192
jmg-duarte merged 1 commit intomainfrom
jmgd/config/misc

Conversation

@jmg-duarte
Copy link
Copy Markdown
Contributor

Description

Move banned_users, order_events_cleanup_interval/threshold, and S3 upload settings from CLI arguments to the TOML config file.

Changes

  • Add config modules: banned_users, order_events_cleanup, s3
  • Remove infra::persistence::cli (S3 CLI args)
  • Delete corresponding CLI arguments and Display impl entries
  • Wire config values through run.rs

How to test

Staging

Move banned_users, order_events_cleanup_interval/threshold, and S3
upload settings from CLI arguments to the TOML config file, following
the same pattern as prior fee_policy and trusted_tokens migrations.

- Add config modules: banned_users, order_events_cleanup, s3
- Remove infra::persistence::cli (S3 CLI args)
- Delete corresponding CLI arguments and Display impl entries
- Wire config values through run.rs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jmg-duarte jmg-duarte requested a review from a team as a code owner February 22, 2026 11:20
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

The pull request successfully migrates banned users, order events cleanup, and S3 configuration from CLI arguments to a TOML configuration file. This improves maintainability and centralizes configuration. However, several new test cases contain a compilation error where a variable named toml shadows the toml crate, preventing calls to toml::from_str. These should be renamed to ensure the test suite remains functional.

Comment thread crates/autopilot/src/config/banned_users.rs
Comment thread crates/autopilot/src/config/banned_users.rs
Comment thread crates/autopilot/src/config/mod.rs
Comment thread crates/autopilot/src/config/order_events_cleanup.rs
Comment thread crates/autopilot/src/config/order_events_cleanup.rs
Comment thread crates/autopilot/src/config/s3.rs
Comment thread crates/autopilot/src/config/s3.rs
Comment on lines +7 to +9
fn default_max_cache_size() -> NonZeroUsize {
NonZeroUsize::new(10000).unwrap()
}
Copy link
Copy Markdown
Contributor

@MartinquaXD MartinquaXD Feb 23, 2026

Choose a reason for hiding this comment

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

I wonder if we should have a convention for the ordering of config code now that we have a clean slate here.
To me the order of importance would be:

  1. structs
  2. default values
  3. struct impls
  4. tests

Feel free to ignore as I don't feel strongly about this.

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.

In this case I didn't but should've: I usually write the defaults in consts (regular or fns) so I tend place them at the top

So the current migration has been working on defaults -> (struct X -> struct X impl)+ -> tests


/// Configuration for uploading auction instances to S3.
/// If absent, S3 uploads are disabled.
#[serde(default)]
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.

No default needed when the value is already optional.

Suggested change
#[serde(default)]

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.

I forgot this, Ill add this to the next PR to avoid more CI time 🙏 my apologies

@jmg-duarte jmg-duarte added this pull request to the merge queue Feb 23, 2026
Merged via the queue into main with commit 3ec82fc Feb 23, 2026
20 checks passed
@jmg-duarte jmg-duarte deleted the jmgd/config/misc branch February 23, 2026 12:25
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 23, 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