[codex] record wallet connection analytics - #1685
MuncleUscles wants to merge 2 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Summary
Adds analytics-only wallet connection recording for Studio, keyed by normalized wallet address instead of user accounts.
wallet_connection_analyticstable with first/last connection timestamps, connect count, server-observed IP, user agent, and origin metadata./api/analytics/wallet-connectionsas a focused FastAPI endpoint that derives IP from trusted proxy handling and does not trust client-supplied IP.Privacy / Product Notes
This is analytics-only. The stored wallet address and request metadata are not authentication or identity proof, and wallet addresses can be spoofed by client-side calls. Metadata is limited to IP, user agent, and Origin headers with bounded lengths; no request body beyond the wallet address is collected.
Validation
/Users/edgars/Dev/genlayer-studio/.venv/bin/python -m pytest tests/unit/test_wallet_connection_analytics_service.py tests/unit/test_wallet_analytics_router.py tests/unit/test_rate_limit_middleware.pynpm run test -- --run test/unit/hooks/useWalletSync.test.ts test/unit/services/walletAnalytics.test.ts/Users/edgars/Dev/genlayer-studio/.venv/bin/python -m black --check backend/protocol_rpc/client_ip.py backend/protocol_rpc/rate_limit_middleware.py backend/protocol_rpc/analytics_router.py backend/services/wallet_connection_analytics_service.py backend/database_handler/models.py tests/unit/test_wallet_connection_analytics_service.py tests/unit/test_wallet_analytics_router.py/Users/edgars/Dev/genlayer-studio/frontend/node_modules/.bin/prettier --check src/hooks/useWalletSync.ts src/services/walletAnalytics.ts test/unit/hooks/useWalletSync.test.ts test/unit/services/walletAnalytics.test.ts