fix(indexer): drop redundant lower() on already-lowercase address columns (GitLab #165) #375
No reviewers
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!375
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/gitlab-165-referral-lower-predicates"
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?
closes #165 — audit L-02 follow-up.
change
drop the
lower()wrappers on 6 referral / kumbaya address predicates inindexer/src/api.rs. all addresses on both sides of the equation are stored / bound lowercase, so the wrap was wasted CPU and disabled the existingidx_timecurve_referral_applied_referrerbtree.affected
indexer/src/api.rs:422— JOIN predicate in/v1/timecurve/buysLATERAL (kk.buyerandb.buyerboth viaaddr_hex)indexer/src/api.rs:1814—/v1/referrals/applied(paramaddr_lisaddr.to_lowercase()at line 1807)indexer/src/api.rs:1971,1974,1977,1980— 4 subqueries in/v1/referrals/wallet-charm-summary(paramwisq.wallet.to_lowercase()at line 1965)why this is safe
semantic-equivalent. both sides of every changed predicate are guaranteed lowercase by:
addr_hex(*addr)=format!("{:#x}", a)(alloy lowercase hex)addr.to_lowercase()orbind_addr_lower()grep -n 'lower(.*) = lower(' indexer/src/api.rs→ 0 hits after this MR.tests
no test diffs (predicate-equivalent change).
not in scope (flagged for triage in #165)
optional follow-up:
CREATE INDEX idx_timecurve_referral_applied_buyer ON idx_timecurve_referral_applied (buyer)to mirror the existing referrer index — thereferee_charm_wadandreferee_buy_countsubqueries scan without an index. left out of this MR to keep scope tight; happy to ship as a separate migration if you want it.mentioned in issue #165
@PlasticDigits — heads up, this MR is now stale. you shipped the fix on
fix/glab-165-referral-index-predicates(commita4ce4a7, merged via18a771b) which lands the same SQL change plus the new buyer btree migration. my version here is effectively superseded.no action needed from me — happy to close from my side if you want, otherwise feel free to close whenever you get a chance.
Pull request closed