Skip to content

feat(chainstate): main#2498

Open
iquidus wants to merge 1 commit intoindexer-apifrom
indexer-main
Open

feat(chainstate): main#2498
iquidus wants to merge 1 commit intoindexer-apifrom
indexer-main

Conversation

@iquidus
Copy link
Contributor

@iquidus iquidus commented Feb 6, 2026

Adds main package and Makefile

Note: If wanting to build the indexer use this branch.

Build:

cd chainstate
make build

Run:

./bin/chainstate-indexer --config ~/Desktop/config.json

Example config (json file) - sepolia:

{
	"Config": {
		"EigenDADirectory": "0x9620dC4B3564198554e4D2b06dEFB7A369D90257",
		"PersistencePath": "<PATH FOR JSON FILE>",
		"HTTPPort": 8080,
		"StartBlockNumber": 8195500,
		"BlockBatchSize": 10,
		"PollInterval": "1s"
	},
	"Secret": {
		"EthRpcUrls": [
			"<SEPOLIA RPC>"
		]
	}
}

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.

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])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.87%. Comparing base (0704122) to head (a604261).

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     
Flag Coverage Δ
litt-tests 32.99% <ø> (?)
unit-tests 39.63% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ian-shim
Copy link
Contributor

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])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we using go-ethereum client and not our existing one with transient error handling mechanisms?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants