Frontend: wallet blockies must be identical for the same address on every surface #226
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#226
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
The same wallet address can render with different blockie colors depending on which part of the app shows it. Blockies must be pixel-identical for a given address everywhere — only size/scaling may differ, not hue or pattern.
Canonical rendering today goes through
WalletBlockie(frontend/src/components/WalletBlockie.tsx) viaAddressInline(frontend/src/components/AddressInline.tsx), usingethereum-blockies@0.1.1. Despite a single component, surfaces still diverge visually.Expected behavior
For any valid non-zero
0x…address:sizeprops (16–40px today); canvas may scale, but the underlying bitmap must be the same for the same seed.Observed behavior
A wallet seen in one surface (e.g. TimeCurve live buys, podium rows, Arena WarBow, referrals leaderboard) can show a different-colored blockie for the same address in another surface.
Likely causes (investigate in this order)
1. Surface-specific CSS tinting
.live-buy-row .address-inline__blockieapplies a radial-gradient background, circular crop, glow border, and inset shadow behind the canvas (frontend/src/index.css~5465–5488). Other surfaces use the default square.address-inline__blockiechrome only. That alone can make the same canvas read as a different color.Audit all selectors touching
.address-inline__blockie,.address-inline__blockie canvas, or parent filters.2.
ethereum-blockiesglobal PRNG / color generationThe library uses module-level mutable state (
randseed). InbuildOpts, default colors are produced viacreateColor()and the PRNG is re-seeded with the address — butcreate()callsbuildOptstwice per render. Verify determinism under React Strict Mode, list re-mounts, and concurrentuseLayoutEffectpasses. If non-deterministic, fix by:createColor()calls, or@ethereum/blockies/@metamask/blockiespatterns), or3. Seed normalization drift
WalletBlockie.normalizedSeed()lowercases and ensures0xprefix. Confirm every blockie path uses it (no duplicate identicon logic). Grep:Surfaces to regression-test
sizeLiveBuyRow.tsxTimeCurveLiveBuysActivitySection.tsx,TimeCurveSimplePodiumSection.tsxWarbowHeroActions.tsx,TimeCurveArenaWalletMono.tsx,useTimeCurveArenaModel.tsxReferralLeaderboardSection.tsxTimeCurveSections.tsx,TimeCurveSimplePage.tsxPick one known address that appears in at least two of these surfaces and compare side-by-side (screenshot diff or canvas
toDataURL()equality in a unit test).Acceptance criteria
AddressInlinesurfaces (document the test address + screenshots in the MR).WalletBlockietwice (or at two sizes) for a fixed address and asserts identicalcanvas.toDataURL()or identical color samples at fixed pixels — unless product explicitly allows scale-only differences.docs/testing/invariants-and-business-logic.mdwithINV-FRONTEND-*-BLOCKIE-DETERMINISM(assign next ID) and a short manual QA step indocs/testing/manual-qa-checklists.md.Related
AddressInline(blockie + label + explorer link)docs/testing/manual-qa-checklists.md— address display QAmarked as related to #98
Fix pushed — please verify
@nullvector_ux — could you confirm blockie colors/patterns match for the same wallet across surfaces?
Branch:
fix/blockie-determinism-226(2830cce)What changed
walletBlockieCanvas.ts— deterministic palette via an isolated PRNG (noethereum-blockiesmodule-global pollution); memoized 64×64 source canvas per normalized address; display size only scales the shared bitmap.WalletBlockie.tsx— uses the cached source canvas clone; removed per-size regeneration.image-rendering: pixelatedon.address-inline__blockie canvas.Suggested QA
Pick one address visible in ≥2 places (e.g. live buy row + podium + referrals leaderboard) and confirm the blockie is visually identical (colors + pattern), not just similar.
mentioned in commit
2830cce8be@PlasticDigits
I checked the wallet shortcut/blockie display across multiple routes. On
http://localhost:5173/timecurveandhttp://localhost:5173/timecurve/arena,(9c1199)
the wallet shortcut appears to use the same blockie pattern. This may be expected only if both entries represent the same wallet/address, but it needs confirmation because blockies are supposed to help visually distinguish different wallet addresses.
I also checked
http://localhost:5173/timecurve/protocolandhttp://localhost:5173/referrals(0x87bdce72…c78b5e)
These two routes show the same wallet shortcut pattern and the same shortened code/address display. If these are pointing to the same wallet/referral address, this is expected behavior. If they represent different wallets or different data sources, then this may be a visual identity issue because different entries should not appear identical.
mentioned in issue #230