Skip to content
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

Update transaction params validation #9992

Merged
merged 4 commits into from
Dec 4, 2020
Merged

Conversation

rekmarks
Copy link
Member

@rekmarks rekmarks commented Dec 3, 2020

During review of #9984, we discovered that our transaction validation logic permits transactions without to and data fields. Such transactions seem to force our UI into a bad state. Minimally, a meaningful transaction must have either or both fields, in addition to a from address. See eth_sendTransaction on eth.wiki for details.

This PR ensures that transactions without to and data fields are rejected outright. In addition, it:

  • Ensures that all errors thrown by validateTxParams are properly formatted JSON-RPC invalidParams errors.
  • Improves the error thrown when txParams is not a plain object.

@rekmarks rekmarks requested review from Gudahtt and tmashuang December 3, 2020 18:44
@rekmarks rekmarks requested a review from a team as a code owner December 3, 2020 18:44
@metamaskbot
Copy link
Collaborator

Builds ready [c21b4e7]
Page Load Metrics (409 ± 43 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint3084572411
domContentLoaded3145904079043
load3155924099043
domInteractive3145904079043

@metamaskbot
Copy link
Collaborator

Builds ready [17b96ba]
Page Load Metrics (432 ± 48 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint3193552311
domContentLoaded30058343010048
load30258643210048
domInteractive30058243010048

@metamaskbot
Copy link
Collaborator

Builds ready [2224166]
Page Load Metrics (426 ± 51 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint32101672311
domContentLoaded31761842410551
load31962042610551
domInteractive31761842410551

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@rekmarks rekmarks merged commit baea1b5 into develop Dec 4, 2020
@rekmarks rekmarks deleted the tx-params-validation-update branch December 4, 2020 02:16
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants