-
Notifications
You must be signed in to change notification settings - Fork 83
chore: refactor validator service in relay package for clarity and optimization #3891
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
Merged
konstantinabl
merged 16 commits into
main
from
3592-refactor-validator-service-in-relay-package-for-clarity-and-optimization---p3
Jul 9, 2025
Merged
chore: refactor validator service in relay package for clarity and optimization #3891
konstantinabl
merged 16 commits into
main
from
3592-refactor-validator-service-in-relay-package-for-clarity-and-optimization---p3
Jul 9, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Luis Mastrangelo <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
e267230
to
381f8f2
Compare
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
simzzz
reviewed
Jul 4, 2025
simzzz
reviewed
Jul 4, 2025
simzzz
reviewed
Jul 4, 2025
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
acuarica
reviewed
Jul 7, 2025
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.
looking good.
Signed-off-by: Konstantina Blazhukova <[email protected]>
Co-authored-by: Luis Mastrangelo <[email protected]> Signed-off-by: konstantinabl <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
natanasow
reviewed
Jul 8, 2025
simzzz
previously approved these changes
Jul 8, 2025
Signed-off-by: Konstantina Blazhukova <[email protected]>
natanasow
approved these changes
Jul 8, 2025
acuarica
approved these changes
Jul 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
internal
For changes that affect the project's internal workings but not its outward-facing functionality.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR rewrites the validation code in packages/relay/src/lib/validators by removing many custom “object-wrapper” classes and lots of repetitive boilerplate, and replacing them with two simple, reusable functions driven by shared schemas. It makes the code easier to read, cuts out duplicate logic, and lets you add new validation rules with minimal effort.
Key Changes
Delete all *Object classes (TransactionObject, EthSubscribeLogsParamsObject, TracerConfigWrapper, etc.) and their factories.
Collapse ∼300 lines of class-based code into two reusable functions.
Use shared OBJECTS_VALIDATIONS and TYPES maps for every primitive and object type.
Update IParamValidation and related types so that type is a literal union instead of string.
Related issue(s):
Fixes #3592
Notes for reviewer:
Checklist