Skip to content

Conversation

@Nana-EC
Copy link
Contributor

@Nana-EC Nana-EC commented Jan 27, 2023

Description:
Cherry pick of #849 to main for consistency

MM seems to send a null data param in the transaction object. We should not be validating in that case.

  • Expand trace logs to eth.estimateGas() to highlight param
  • Add nullable concept to validation object params and set data in transaction object to nullable
  • Expand predefined.INVALID_PARAMETER logs to make failures easier to troubleshoot
  • Updated and expanded tests to confirm isValidAndNonNullableParam logic
  • Updated RPC tests impacted by addition of value to the log

Signed-off-by: georgi-l95 [email protected]

Signed-off-by: Nana Essilfie-Conduah [email protected]
Signed-off-by: georgi-l95 [email protected]
Co-authored-by: georgi-l95 [email protected]

Related issue(s):

Addresses #836

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@Nana-EC Nana-EC self-assigned this Jan 27, 2023
@Nana-EC Nana-EC added bug Something isn't working P1 dev tools Features enabling dev tool integration labels Jan 27, 2023
@Nana-EC Nana-EC added this to the 0.17.0 milestone Jan 27, 2023
@codecov-commenter
Copy link

Codecov Report

Base: 73.76% // Head: 73.79% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (d424974) compared to base (51682d2).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #852      +/-   ##
==========================================
+ Coverage   73.76%   73.79%   +0.02%     
==========================================
  Files          29       29              
  Lines        1776     1778       +2     
  Branches      324      325       +1     
==========================================
+ Hits         1310     1312       +2     
  Misses        372      372              
  Partials       94       94              
Impacted Files Coverage Δ
packages/server/src/validator/objectTypes.ts 100.00% <ø> (ø)
packages/relay/src/lib/eth.ts 82.20% <100.00%> (ø)
packages/server/src/validator/utils.ts 88.09% <100.00%> (+0.59%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

georgi-l95
georgi-l95 previously approved these changes Jan 27, 2023
MM seems to send a null data param in the transaction object.
We should not be validating in that case.

- Expand trace logs to `eth.estimateGas()` to highlight param
- Add nullable concept to validation object params and set data in transaction object to nullable
- Expand `predefined.INVALID_PARAMETER` logs to make failures easier to troubleshoot
- Updated and expanded tests to confirm `isValidAndNonNullableParam` logic
- Updated RPC tests impacted by addition of value to the log

Signed-off-by: georgi-l95 <[email protected]>

Signed-off-by: Nana Essilfie-Conduah <[email protected]>
Signed-off-by: georgi-l95 <[email protected]>
Co-authored-by: georgi-l95 <[email protected]>
georgi-l95
georgi-l95 previously approved these changes Jan 27, 2023
Signed-off-by: georgi-l95 <[email protected]>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Nana-EC Nana-EC requested a review from georgi-l95 January 27, 2023 17:53
Copy link
Member

@georgi-l95 georgi-l95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@Nana-EC Nana-EC merged commit 3616571 into main Jan 30, 2023
@Nana-EC Nana-EC deleted the 836-estimategas-validation-fix branch January 30, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dev tools Features enabling dev tool integration P1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants