Conversation
Adds main package and Makefile
| defer ethClient.Close() | ||
|
|
||
| // TODO(iquidus): dont leak api key in logs | ||
| logger.Info("Connected to Ethereum RPC", "url", secretConfig.EthRpcUrls[0]) |
There was a problem hiding this comment.
🤖 Security Issue: API keys and credentials in Ethereum RPC URLs are logged without sanitization
Severity: HIGH
Category: sensitive_data_exposure
Tool: ClaudeCode AI Security Analysis
Exploit Scenario: When using managed Ethereum node services like Infura, Alchemy, or QuickNode, the RPC URL contains API keys (e.g., 'https://mainnet.infura.io/v3/YOUR-PROJECT-ID'). These credentials are directly logged to application logs where they could be harvested by attackers with log access, leading to unauthorized blockchain access and potential financial losses from API usage
Recommendation: Use the existing SanitizeRpcUrl function from common/geth/rpc_utils.go before logging: logger.Info("Connected to Ethereum RPC", "url", geth.SanitizeRpcUrl(secretConfig.EthRpcUrls[0]))
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## indexer-api #2498 +/- ##
===============================================
- Coverage 39.60% 38.87% -0.74%
===============================================
Files 511 558 +47
Lines 45941 51881 +5940
===============================================
+ Hits 18196 20168 +1972
- Misses 25587 29169 +3582
- Partials 2158 2544 +386
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Is the indexer going to be a separate service? I thought it was going to live as part of the controller |
| return fmt.Errorf("no Ethereum RPC URLs configured") | ||
| } | ||
|
|
||
| ethClient, err := ethclient.Dial(secretConfig.EthRpcUrls[0]) |
There was a problem hiding this comment.
why are we using go-ethereum client and not our existing one with transient error handling mechanisms?
Adds main package and Makefile
Note: If wanting to build the indexer use this branch.
Build:
Run:
Example config (json file) - sepolia:
Note, the batch size and poll interval are based on a free alchemy account (maxing while not hitting limits). Adjust however you see fit for other (or paid) providers. E.g in production and larger batch size, e.g 1000 will likely make more sense.