Skip to content

fix(clob): invalidate version and V2 fee caches#19

Open
birchrust wants to merge 1 commit intoPolymarket:mainfrom
birchrust:fix-caches
Open

fix(clob): invalidate version and V2 fee caches#19
birchrust wants to merge 1 commit intoPolymarket:mainfrom
birchrust:fix-caches

Conversation

@birchrust
Copy link
Copy Markdown

@birchrust birchrust commented Apr 27, 2026

Fixes invalidate_internal_caches() so it also clears V2 fee metadata, token-to-condition mapping, and cached protocol version.

This prevents order creation from reusing stale V2 fee parameters or an outdated CLOB version after explicit cache invalidation.


Note

Medium Risk
Medium risk because it changes cache invalidation semantics for fee/version resolution, which can alter when extra HTTP calls occur and what fee parameters are used for order sizing.

Overview
Ensures Client::invalidate_internal_caches() fully resets all CLOB market configuration state by additionally clearing V2 fee metadata (fee_infos), token→condition mappings, and the cached /version result (reset to 0).

Adds a regression test asserting that after invalidation the client re-fetches version and re-primes market info via /markets-by-token + /clob-markets, preventing reuse of stale V2 fee parameters.

Reviewed by Cursor Bugbot for commit c620131. Bugbot is set up for automated code reviews on this repo. Configure here.

@birchrust birchrust changed the title clob: invalidate version and V2 fee caches fix(clob): invalidate version and V2 fee caches Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant