Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#150
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@PlasticDigits — caught while bringing up the local stack for the #144 live wallet walk. fresh indexer DB cannot bootstrap on
mainat HEAD16deec2.Symptom
scripts/start-local-anvil-stack.shreaches the indexer step, then dies:/tmp/yieldomega_indexer_stack.log:Root cause
indexer/migrations/has two files claiming version timestamp20260504200000:content distinct — first creates
idx_doub_vesting_rescue_erc20(#137), second createsidx_timecurve_warbow_revenge_window(#135). but sqlx primary-keys_sqlx_migrationsonversion. first applies fine, second collides on PK.fix/gitlab-135-warbow-multi-revenge(mergedd21855b) and thefix/gitlab-137-presale-rescuebranch both picked the same migration timestamp when each was authored independently. when both merged to main neither rebased migration filenames.Repro
clean DB with all earlier migrations already applied:
verified: _sqlx_migrations table after the script's reset shows 20 migrations applied successfully through
20260504200000 doub vesting rescue erc20and the second20260504200000(warbow_revenge_window_gl135) cannot be inserted.Impact
16deec2Recommended fix
bump one of the two migrations to a later distinct timestamp. either:
20260504200000_warbow_revenge_window_gl135.{up,down}.sql→20260504201000_warbow_revenge_window_gl135.{up,down}.sql20260504200000_doub_vesting_rescue_erc20.{up,down}.sql→20260504201000_doub_vesting_rescue_erc20.{up,down}.sqlcontent of either migration doesn't need to change. the rename alone resolves the PK collision and lets sqlx apply both ordered.
also worth a CI check:
ls indexer/migrations/ | awk -F_ '{print $1}' | sort | uniq -dshould fail the build if any two migrations share a version timestamp.blocking #144 live walk on my side until this is patched. happy to walk through any test verification once the fix lands.
mentioned in merge request !374
@PlasticDigits — MR up: !374 https://gitlab.com/PlasticDigits/yieldomega/-/merge_requests/4
pure rename — bumps
20260504200000_warbow_revenge_window_gl135.{up,down}.sql→20260504201000_warbow_revenge_window_gl135.{up,down}.sqlso it applies after the doub vesting one. content untouched.verified
grep -rn '20260504200000_warbow\|warbow_revenge_window_gl135'across .sh/.toml/.yml/.md/.rs returns zero — no path-bound references anywhere. sqlx reads migrations dir by glob at runtime so the rename is fully safe.once merged, will pull on QA server, bring up stack from clean DB, walk #144 live.
mentioned in issue #129
mentioned in issue #113
mentioned in issue #151
mentioned in commit
3d20ecf7f0Fixed on
mainin3d20ecf.20260504200000_warbow_revenge_window_gl135.{up,down}.sql→20260504201000_warbow_revenge_window_gl135.{up,down}.sqlso20260504200000is onlydoub_vesting_rescue_erc20(no PK collision / deterministic checksum for that version)..github/workflows/unit-tests.yml): fail the job if any migration timestamp has more than two*.sqlfiles (catches duplicate-version races).Render / existing DBs seeing "was previously applied but has been modified": After deploy,
20260504200000on disk matches the doub migration only; if_sqlx_migrationsstill disagrees, repair that row withsqlx migrate repair(sameDATABASE_URL) or align the checksum after confirming the applied migration body matchesdoub_vesting_rescue_erc20.up.sql. Any DB that never ran the warbow migration will pick up20260504201000on next indexer start.Verification (fix works)
Tests run locally after the fix on
main(3d20ecf):indexer/migrations/*.sql, take the leading timestamp from each filename, count occurrences — no version has more than two files (no duplicate timestamps).cargo clippy --all-targets -- -D warnings— clean.cargo test— 31 tests passed (29 unit + 2 Postgres integration tests inintegration_stage2.rs), including full sqlx migration embedding and DB-backed persist tests.So sqlx can embed migrations deterministically, fresh DBs get a unique version per pair, and the suite green-lights the change.
What changed (summary)
20260504200000(doub_vesting_rescue_erc20andwarbow_revenge_window_gl135), which breaks clean installs (duplicate primary key on_sqlx_migrations) and can surface as checksum / “modified migration” errors in deployed environments.20260504201000_warbow_revenge_window_gl135.{up,down}.sqlso20260504200000is only the doub–vesting rescue migration; order stays before existing20260504211000GL139 migrations..github/workflows/unit-tests.yml(indexer job) that fails the workflow if any migration timestamp appears on more than two.sqlfiles, preventing this class of collision from merging again.Closing this issue as resolved.
mentioned in issue #152
mentioned in commit
f2aab5371d