-
Notifications
You must be signed in to change notification settings - Fork 94
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
dev: simplify WithOtherFields<T>
usage
#1398
Comments
Hi @tcoratger, I would like to contribute to this issue, kindly assign me. |
Hey @Samrath49! |
@Samrath49 Assigned |
@Samrath49 any update on this? |
@tcoratger can you explain more about the issue with references to simplifying WithOtherFields usages? |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI want to work on this |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedAs a seasoned Rust developer, I have a proven track record of optimizing complex codebases for both performance and readability. My experience includes refactoring legacy code, implementing type aliases, and working with RPC systems. I'm confident in my ability to improve the clarity and maintainability of our WithOtherFields code while ensuring functionality remains intact. I'm a collaborative problem-solver who is committed to producing high-quality code. How I plan on tackling this issueThe summary you provided is clear and well-structured. Here are a few points to consider for improvement and clarity: Strengths To approach the problem, I would start with a thorough code review to identify all instances of WithOtherFields and assess their necessity. These usages would be categorized into three groups: essential cases required for functionality, redundant cases that can be safely removed, and ambiguous cases needing further team discussion. For the redundant cases, I would develop a plan to replace WithOtherFields with T, documenting the rationale for retaining it in essential cases. Additionally, I would introduce type aliases, such as ExtendedTransaction and ExtendedBlock, to standardize usage. Ensuring comprehensive testing is crucial; I would run existing tests and add new ones following the changes. I would also update relevant documentation to reflect these modifications and provide guidelines for future usage. Throughout the process, maintaining open communication with the team would be essential for gathering feedback and ensuring alignment. This structured approach aims to reduce complexity while preserving functionality and enhancing code readability. |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedHey there! I'm really excited about this task - it's right up my alley. I've been working with Rust and blockchain tech for a while now, and I love digging into codebases to make them cleaner and more efficient. How I plan on tackling this issueFor this problem, here's how I'd tackle it: |
Hey Thomas @tcoratger Can I take this one? ☝️ |
In our codebase, we use the
other
field of transactions to storeisRunOutOfResources
information. This leads to extensive usage ofWithOtherFields<T>
throughout the code after the merge of #1389, especially when handling conversions between RPC and primitive types, as seen in https://github.com/paradigmxyz/reth/blob/fba837468cac5143b415c9dd4fdc9218d71a926b/crates/primitives/src/alloy_compat.rs#L55-L212.However, this approach is complex and can be optimized for better readability and management.
Proposal
WithOtherFields<T>
, replacing them with justT
where the extra fields aren't needed.ExtendedTransaction = WithOtherFields<Transaction>
(and similar for blocks) to standardize its usage where necessary.The text was updated successfully, but these errors were encountered: