Local Anvil registry omits TimeCurveBuyRouter after verify script — indexer drops BuyViaKumbaya #84
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#84
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?
Summary
scripts/start-local-anvil-stack.shwritescontracts/deployments/local-anvil-registry.jsonwith TimeCurve, RabbitTreasury, LeprechaunNFT, FeeRouter, PodiumPool, and ReferralRegistry, but not TimeCurveBuyRouter.The indexer loads
ADDRESS_REGISTRY_PATHat startup and only ingestsBuyViaKumbayawhen TimeCurveBuyRouter is present in that registry (issue #67). After runningscripts/verify-timecurve-buy-router-anvil.shwithYIELDOMEGA_DEPLOY_KUMBAYA=1, the router is deployed and wired onchain, but the registry file is unchanged, so the indexer never learns the router address andBuyViaKumbayaevents are dropped.Workaround used in QA: manually add
TimeCurveBuyRoutertolocal-anvil-registry.jsonand restart the indexer.This is the same “derived config not updated after a second deploy step” family as the
VITE_KUMBAYA_*env mirror gap noted around issue #83 (closed).Acceptance criteria
Registry parity after buy-router deploy: When a developer runs the default local stack and then deploys the Kumbaya / buy-router fixtures (e.g.
YIELDOMEGA_DEPLOY_KUMBAYA=1 bash scripts/verify-timecurve-buy-router-anvil.sh),contracts/deployments/local-anvil-registry.jsonMUST containcontracts.TimeCurveBuyRouterwith the same address ascast call <TimeCurve> "timeCurveBuyRouter()(address)", without manual JSON edits.Indexer visibility: With the indexer started via
start-local-anvil-stack.sh(or equivalentADDRESS_REGISTRY_PATHpointing at that file), after the verify script completes, restarting the indexer OR documenting a single command that refreshes the registry before indexer start MUST result inBuyViaKumbayabeing decoded and correlated per issue #67 (no silent drop solely because the key was missing from the registry).Documented QA path:
docs/integrations/kumbaya.md,docs/testing/invariants-and-business-logic.md(issue #78 section), and/orskills/verify-yo-timecurve-buy-router-anvil/SKILL.mdMUST state the one-line flow so future QA does not rediscover the gap (minimal doc delta; align with whichever script owns the registry write).No regression for stacks without the router: If
timeCurveBuyRouter()is still zero, the registry MUST either omitTimeCurveBuyRouteror document that the indexer correctly ignores an empty/zero entry (match existingADDRESS_REGISTRYsemantics inindexer/src/config.rs).Recommended fix
Preferred (small, explicit): Extend
scripts/verify-timecurve-buy-router-anvil.shso that whenever it learns a non-zeroTimeCurveBuyRouter(from chain or immediately afterDeployKumbayaAnvilFixtures), it mergesTimeCurveBuyRouterintocontracts/deployments/local-anvil-registry.jsonviajq(preserve existing keys anddeployBlock). Print one line confirming the merge path. QA then re-runs the indexer (or restarts stack) once; no hand-editing.Alternative / additive: Optionally gate
start-local-anvil-stack.shbehind an env such asYIELDOMEGA_DEPLOY_KUMBAYA=1to runDeployKumbayaAnvilFixturesand includeTimeCurveBuyRouterin the initial registry write—heavier default; only do if product wants “router always on” local stacks.Optional: Append
VITE_KUMBAYA_TIMECURVE_BUY_ROUTERtofrontend/.env.localwhen the router is non-zero, mirroringscripts/e2e-anvil.sh/anvil_deploy_dev.shbehavior (invariants — issue #78); only if we want full env parity in one shot.Files likely to change
scripts/verify-timecurve-buy-router-anvil.shjq-mergeTimeCurveBuyRouterintocontracts/deployments/local-anvil-registry.jsonwhen the file exists (default local QA path).scripts/start-local-anvil-stack.shdocs/integrations/kumbaya.mddocs/testing/invariants-and-business-logic.mdBuyViaKumbaya.skills/verify-yo-timecurve-buy-router-anvil/SKILL.mdTimeCurveBuyRouter; restart indexer if needed.References
ADDRESS_REGISTRY,TimeCurveBuyRouter— issue #67DeployKumbayaAnvilFixtures—start-local-anvil-stack.shheader comments and guardrails skill item 21assigned to @PlasticDigits
mentioned in issue #75
mentioned in commit
ac3d5964d8Implemented on
main(ac3d596)Summary:
scripts/verify-timecurve-buy-router-anvil.shnow jq-mergescontracts.TimeCurveBuyRouterintocontracts/deployments/local-anvil-registry.jsonwhen the router is non-zero (after onchain read orDeployKumbayaAnvilFixtures). When the broadcast log is available, it also merges the full KumbayaVITE_*block intofrontend/.env.local(same shape ase2e-anvil.sh); otherwise it sets/updatesVITE_KUMBAYA_TIMECURVE_BUY_ROUTERonly if.env.localexists.Optional stack parity:
YIELDOMEGA_DEPLOY_KUMBAYA=1 bash scripts/start-local-anvil-stack.shrunsDeployKumbayaAnvilFixturesafter DeployDev, writesTimeCurveBuyRouterinto the initial registry JSON, merges KumbayaVITE_*intofrontend/.env.local, then starts the indexer (soADDRESS_REGISTRY_PATHalready includes the router).Helpers:
scripts/lib/kumbaya_local_anvil_env.shDocs / cross-links:
docs/integrations/kumbaya.md,docs/testing/invariants-and-business-logic.md(#78 table),skills/verify-yo-timecurve-buy-router-anvil/SKILL.md,skills/README.md,.cursor/skills/yieldomega-guardrails/SKILL.md(item 21).cc @brouie — please verify when convenient.
Verification checklist
SKIP_ANVIL_RICH_STATE=1recommended for live sale), runYIELDOMEGA_DEPLOY_KUMBAYA=1 bash scripts/verify-timecurve-buy-router-anvil.sh. Confirmjq -r '.contracts.TimeCurveBuyRouter' contracts/deployments/local-anvil-registry.jsonequalscast call <TimeCurve-proxy> "timeCurveBuyRouter()(address)".YIELDOMEGA_DEPLOY_KUMBAYA=1stack order) soADDRESS_REGISTRY_PATHreload includesTimeCurveBuyRouter; confirmBuyViaKumbayarows are no longer dropped solely due to a missing registry key ([ issue #67 ]).frontend/.env.localexists, confirmVITE_KUMBAYA_TIMECURVE_BUY_ROUTERmatches onchain; after a deploy-log path, confirm WETH/USDM/router/quoter lines match the fixture deploy.YIELDOMEGA_DEPLOY_KUMBAYA=1 bash scripts/start-local-anvil-stack.sh— confirm registry +.env.localinclude router + KumbayaVITE_*before indexer startup.TimeCurveBuyRouterremains absent from JSON (or empty); indexer must not require a zero address (indexer/src/config.rsindex_addresses).Issue left open for your sign-off.
Verified end-to-end on
ac3d596— both verify-script path and stack opt-in path work, no manual JSON / env edits needed anywhere.Path A — verify script merge (checklist items 1, 2, 3)
Setup: fresh
SKIP_ANVIL_RICH_STATE=1stack with NO Kumbaya. Confirmed pre-condition gap: registry omittedTimeCurveBuyRouter,frontend/.env.localhad zeroKUMBAYA_*vars.Then ran
YIELDOMEGA_DEPLOY_KUMBAYA=1 bash scripts/verify-timecurve-buy-router-anvil.sh. Script printed two explicit GitLab #84 confirmation lines:Merged contracts.TimeCurveBuyRouter=0x998abeb3E57409262aE5b751f60747921B33613E into /srv/qa/repos/yieldomega/contracts/deployments/local-anvil-registry.json (GitLab #84). Restart the indexer to ingest BuyViaKumbaya.Merged Kumbaya VITE_* (incl. VITE_KUMBAYA_TIMECURVE_BUY_ROUTER) into /srv/qa/repos/yieldomega/frontend/.env.local (GitLab #84).Plus
[PASS] test_Forked_issue78_TimeCurveBuyRouter_checklist()— fork test green.Post-merge state:
TimeCurveBuyRouter: 0x998abeb3E57409262aE5b751f60747921B33613Einserted, all prior keys preserved (TimeCurve, RabbitTreasury, LeprechaunNFT, FeeRouter, PodiumPool, ReferralRegistry),deployBlock: 1preserved — proper jq merge, not a rewrite..env.local: full Kumbaya block (WETH, USDM, SWAP_ROUTER, QUOTER, TIMECURVE_BUY_ROUTER) appended idempotently, prior content preserved.cast call <TimeCurve> "timeCurveBuyRouter()(address)"matches registry value exactly.Restarted indexer + reset DB state, then live ETH single-tx buyViaKumbaya via Simple page. Indexer captured the BuyViaKumbaya event with no manual patch:
idx_timecurve_buy_router_kumbaya:
Path B — stack opt-in (checklist item 4)
Reset baseline: registry stripped of
TimeCurveBuyRouter,.env.localKumbaya lines removed, DB truncated.Ran
YIELDOMEGA_DEPLOY_KUMBAYA=1 SKIP_ANVIL_RICH_STATE=1 QA_USE_FIXED_INDEXER_PORT=1 bash scripts/start-local-anvil-stack.sh. Stack log shows the new step inline:=== DeployKumbayaAnvilFixtures (YIELDOMEGA_DEPLOY_KUMBAYA=1 — GitLab #84) ===, then proceeds to write registry + .env.local + start indexer in that order.Post-bringup state (BEFORE any QA action, BEFORE any restart):
TimeCurveBuyRouter: 0x998abeb3E57409262aE5b751f60747921B33613Ealready present.env.local: all 5 Kumbaya VITE_* already presentcast call <TimeCurve> "timeCurveBuyRouter()(address)"matches registry valueLive ETH single-tx buyViaKumbaya via Simple page (~2.9 CHARM at slider). Tx 0x8b6d3af74469c007e7c6df349f5d5f7acb5ac53b9b5787cd585cf42c5cfabf0e succeeded clean, +120s timer extension, indexer mirror:
idx_timecurve_buy_router_kumbaya:
No manual registry edit, no indexer restart — registry was loaded with the router from the very first boot.
Forge fork test
test_Forked_issue78_TimeCurveBuyRouter_checklist()PASS on both paths.One small UX observation
Hit the #82-flavor
friendlyRevertFromUnknownonce during early Path A repro at slider value of ~1.002 CHARM right at the lower band edge — bounds drifted in 1 block between submit-time re-quote and inclusion. Bumping the slider to ~1.0 CHARM (same nominal value, different chain block) succeeded, and a later 2.9 CHARM succeeded clean. Not a #84 issue — same #82 edge-case behavior, friendly revert message displayed correctly. Just flagging that band-edge slider values can occasionally need a retry.Closing #84.
cc @PlasticDigits
mentioned in issue #38
mentioned in issue #82
mentioned in issue #88
mentioned in issue #100
mentioned in issue #104
mentioned in issue #154
marked this issue as related to #154
mentioned in issue #162
mentioned in issue #270