-
Notifications
You must be signed in to change notification settings - Fork 8
test: add e2e tests for the client for new tx type. #118
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
Summary of ChangesHello @randygrok, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new custom transaction type, Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Claude finished @randygrok's task —— View job Code ReviewSummaryThis PR introduces a comprehensive e2e testing infrastructure for the new EvNode transaction type (0x76), replacing manual test scripts with proper automated tests. The implementation is well-structured and represents a significant improvement in test automation. Todo List
✅ StrengthsExcellent Test Architecture
Comprehensive Test Coverage
Robust Infrastructure
🔍 Areas for Improvement1. Error Handling Enhancement
} catch (e) {
if (process.env.DEBUG) {
console.log(`[waitForRpc] retrying after error: ${e.message}`);
}
// not ready yet
}2. Security Considerations
3. Performance Optimizations
4. Test Reliability
🚀 Code QualityTypeScript Best Practices
Testing Patterns
Architecture
🔒 Security AssessmentTest Isolation
No Security Vulnerabilities
📊 Performance ImpactResource Usage
Test Execution Time
🎯 Recommendations
🏆 Overall AssessmentThis is a high-quality implementation that significantly improves the project's testing capabilities. The code follows best practices, handles edge cases well, and provides a solid foundation for e2e testing of the custom EvNode transaction type. The only minor issue is the empty catch block, which has already been identified by another reviewer. Rating: ✅ Approved with minor enhancement suggestion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a comprehensive end-to-end testing suite for the client, which is a significant improvement over the previous test scripts. The new tests use a dedicated test runner (node:test), programmatically set up and tear down an ev-reth node, and include a coordinator to simulate a consensus client for block production. The test cases cover various scenarios including unsponsored and sponsored transactions, both single and batch calls, with clear assertions to validate the behavior. The code is well-structured and robust. I have one minor suggestion to improve error handling in the test setup code for better debuggability.
| } catch { | ||
| // not ready yet | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swallowing errors with an empty catch block can hide underlying issues and make debugging harder. While the intention is to ignore connection errors during polling, it would be more robust to log the error if a debug flag is enabled. This can help diagnose problems if the RPC server fails to start for reasons other than just taking a while to be ready.
} catch (e) {
if (process.env.DEBUG) {
console.log(`[waitForRpc] retrying after error: ${e.message}`);
}
// not ready yet
}
chatton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thank you 🚀
Problem
The viem client (clients/) only had unit tests and manual scripts (basic.test.ts, flows.test.ts, sponsored.test.ts) that required a running ev-reth node externally. These scripts used console.log for verification instead of proper assertions and were not part of CI.
Solution
Add an automated e2e test infrastructure that:
Launches ev-reth as a subprocess with an in-memory datadir and the test genesis
Runs a mini-coordinator (TypeScript) that replicates ev-node’s happy path: polls txpoolExt_getTxs and drives the Engine API 4-step block production cycle (forkchoiceUpdated → getPayload → newPayload → forkchoiceUpdated)
Executes proper node:test tests with assertions against the live node
Cleans up automatically (stops coordinator, kills ev-reth, removes temp files)