-
-
Notifications
You must be signed in to change notification settings - Fork 46
(currently ai slop) ✨ feat: add chainId override option to ForkOptions #1994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Allow developers to override the chain ID when forking to avoid
wallet confusion when the same chain ID is used for both fork
and original network.
**Changes:**
- Extended ForkOptions interface with optional chainId property
- Modified createTevmNode to prioritize fork chainId over auto-detection
- Added comprehensive test coverage across node, actions, memory-client, and state packages
- Updated documentation and examples
**Priority order:**
1. fork.chainId (highest priority - this PR)
2. common.id
3. auto-detected from RPC
4. default chain ID
**Usage:**
```typescript
const client = createMemoryClient({
fork: {
transport: http('https://mainnet.optimism.io'),
chainId: 1337 // Custom chain ID to avoid wallet conflicts
}
})
```
Fixes #1595
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Will Cory <[email protected]>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Claude finished @roninjin10's task —— View job PR Review: Add chainId Override Option to ForkOptionsReview Checklist
📝 Code Quality & Best Practices✅ Excellent Implementation
🔍 Code AnalysisForkOptions Interface (
createTevmNode Implementation (
🧪 Test Coverage✅ Comprehensive Testing
Test Quality Highlights:
🚀 Performance Considerations✅ Efficient Implementation
🔒 Security Analysis✅ Secure Implementation
🎯 RecommendationsMinor Suggestions:
Missing Changeset Notice:
🎉 Overall AssessmentGrade: A- This is an excellent implementation that:
The implementation is production-ready and adds valuable functionality for developers working with forked chains. The only minor issue is the missing changeset, which is a process requirement rather than a code quality concern. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ 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 |
Allow developers to override the chain ID when forking to avoid wallet confusion when the same chain ID is used for both fork and original network.
Changes:
Priority order:
Fixes #1595
Generated with Claude Code