cowprotocol / services

Off-chain services for CoW Protocol
https://cow.fi/
Other
174 stars 68 forks source link

chore: Bump staging auction_id to avoid clashing of auction ids in different environments #2848

Open sunce86 opened 2 months ago

sunce86 commented 2 months ago

Background

Staging is frontrunning the production environment by ~270 days. Meaning, when auction with ID = X appears on staging, after 270 days production will also create an auction with ID = X. This is problematic for components that process both staging and production data that appears onchain (for example OnSettlementEventUpdater checks for settlements that are sent to the same settlement contract from staging and production).

This is completely unnecessary complication that leads to bugs / complicated code without any need.

Suggestion is to bump staging auction id by some big number so that production will "never" catch it. Since auction_id is saved to db as i64, suggestion is to bump current staging auction id by i64::MAX / 2.

This can be safely done in a few steps:

  1. Merge code: "if auction_id < i64::MAX/2 then auction_id = i64::MAX/2"
  2. Once executed on all staging environments merge PR that will remove this code
  3. Make sure no weekly release is made in between (we want this code executed on staging only).

Acceptance criteria

Once finished, staging auction_ids are bumped.

github-actions[bot] commented 1 day ago

This issue has been marked as stale because it has been inactive a while. Please update this issue or it will be automatically closed.