-
Notifications
You must be signed in to change notification settings - Fork 245
feat: expose execution client params to ev-node #2982
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: julien/da-strategy
Are you sure you want to change the base?
Conversation
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @julienrbrt's task in 2m 43s —— View job Code Review Complete ✅I've conducted a comprehensive review of this PR which exposes execution client parameters to ev-node. Overall, this is a well-structured refactoring that successfully addresses issue #2965 by introducing optional interfaces for execution layer parameters, particularly for gas management in force-included transactions. Summary of ChangesThis PR introduces three key architectural improvements to the execution interface:
Positive FindingsArchitecture & Design
Implementation Quality
Testing
Issues & Recommendations1. Missing Integration Points (Critical)The new interfaces are defined and implemented but not yet consumed by the block processing logic. I couldn't find usage of:
Expected locations (based on issue #2965):
Recommendation:
2. Gas Limit Edge Cases
if cumulativeGas+txGas > maxGas {Issues:
Recommendation: // Add at function start:
if maxGas == 0 {
return nil, nil, fmt.Errorf("maxGas must be greater than 0")
}
// In the loop, check for overflow:
if txGas > 0 && cumulativeGas > math.MaxUint64-txGas {
// Handle overflow - stop processing
return validTxs, remainingTxs, nil
}
if cumulativeGas+txGas > maxGas {
// ... existing code
}3. Context Cancellation Not Checked in Loops
Issue: If the context is cancelled mid-processing, the function continues until all transactions are processed, wasting resources. Recommendation: for i, tx := range txs {
// Check context cancellation every N iterations or on each iteration
select {
case <-ctx.Done():
return validTxs, remainingTxs, ctx.Err()
default:
}
// ... existing processing logic
}4. Error Handling - Silent Failures
eip, ok := t.inner.(coreexec.ExecutionInfoProvider)
if !ok {
return coreexec.ExecutionInfo{}, nil // Returns empty info + nil error
}Issue: Caller cannot distinguish between:
Recommendation: Document this behavior clearly OR return a sentinel error like var ErrNotImplemented = errors.New("interface not implemented by executor")
if !ok {
return coreexec.ExecutionInfo{}, ErrNotImplemented
}Similar issue exists for 5. Documentation Gaps
Recommendation: Enhance godoc comments with edge case behaviors. 6. Test Coverage ConcernsMissing test scenarios:
Recommendation: Add unit tests for these edge cases, especially in 7. Performance Consideration
var ethTx types.Transaction
if err := ethTx.UnmarshalBinary(tx); err != nil {
// ... logs and continues
}Issue: Every transaction is unmarshalled to validate it, even if it will be rejected for gas reasons later. For large batches, this could be expensive. Recommendation: Consider a two-pass approach:
Or, accept the current approach if simplicity is preferred (likely fine for most cases). 8. Logging Improvements
c.logger.Debug().
Int("valid_txs", len(validTxs)).
Int("remaining_txs", len(remainingTxs)).
Uint64("cumulative_gas", cumulativeGas).
Uint64("max_gas", maxGas).
Msg("DA transactions exceeded gas limit, splitting batch")Recommendation: Add this to the log:
Security Assessment✅ No major security concerns identified
Minor note: Ensure downstream consumers of Performance Assessment✅ Generally efficient implementation
Minor concern: Transaction unmarshaling in Concurrency & Thread Safety✅ Appears safe
Note: The telemetry wrapper's type assertions are safe (read-only interface checks). Code QualityStrengths:
Minor issues:
Checklist for MergeBefore merging, ensure:
Overall AssessmentVerdict: Strong implementation with good architectural design ⭐⭐⭐⭐ (4/5) This PR successfully modernizes the execution interface with optional capabilities, enabling gas-aware transaction filtering for force inclusion. The code quality is high, error handling is generally robust, and the design follows Go best practices. Primary concern: The new interfaces appear to be defined but not yet consumed by the block processing logic. This should be verified or documented as part of a multi-PR implementation plan. Recommendation:
Tasks
|
Summary of ChangesHello @julienrbrt, 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 significantly refactors the interaction between 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. 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
|
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 refactors the Executor interface by removing the maxBytes return value from InitChain and ExecuteTxs. It introduces new interfaces, ExecutionInfoProvider and DATransactionFilter, to expose execution client parameters like MaxGas more explicitly. The changes are applied consistently throughout the codebase, including implementations, mocks, and tests. This is a solid refactoring that improves the separation of concerns. I've found one issue in a test file where a check was removed, weakening the test's validation.
| if len(resp.Msg.Txs) != len(expectedTxs) { | ||
| t.Fatalf("expected %d txs, got %d", len(expectedTxs), len(resp.Msg.Txs)) | ||
| } |
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.
The check for the content of the returned transactions has been removed, which weakens the test. It now only verifies the number of transactions, not that they are the correct ones. It would be better to verify the content as well to ensure the server is returning the expected data.
if len(resp.Msg.Txs) != len(expectedTxs) {
t.Fatalf("expected %d txs, got %d", len(expectedTxs), len(resp.Msg.Txs))
}
for i, tx := range resp.Msg.Txs {
if string(tx) != string(expectedTxs[i]) {
t.Errorf("tx %d: expected %s, got %s", i, expectedTxs[i], tx)
}
}
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## julien/da-strategy #2982 +/- ##
======================================================
- Coverage 58.61% 58.45% -0.16%
======================================================
Files 100 100
Lines 9684 9717 +33
======================================================
+ Hits 5676 5680 +4
- Misses 3392 3421 +29
Partials 616 616
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:
|
Closes: #2965