metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

Skip searching 4byte directory if we don't have a full 4 bytes of data

Open adonesky1 opened this issue 3 years ago • 3 comments

We should only query 4byte.directory if we have a full 4bytes of data in hex-string form to query against. 4byte.directory will return an unfiltered list of signatures without a full valid query: https://www.4byte.directory/api/v1/signatures/?hex_signature=0x0. Discovered as part of this thread.

Before: https://user-images.githubusercontent.com/34557516/182933602-1b3925e9-4e88-40f8-a2d9-566c1f56a2a0.mp4

https://user-images.githubusercontent.com/34557516/182933715-b29ed147-251b-4344-a6ce-b68ebd184583.mp4

After: https://user-images.githubusercontent.com/34557516/182933915-b5854ed7-2c4f-4b38-8586-99fd797fd6e9.mov

adonesky1 avatar Aug 04 '22 19:08 adonesky1

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

github-actions[bot] avatar Aug 04 '22 19:08 github-actions[bot]

from QA looks good

seaona avatar Aug 05 '22 10:08 seaona

Builds ready [d8e4868]
Page Load Metrics (1685 ± 44 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint84147107178
domContentLoaded1551189116608440
load1563191016859144
domInteractive1551189116608440

highlights:

storybook

metamaskbot avatar Aug 08 '22 19:08 metamaskbot

Builds ready [eaec140]
Page Load Metrics (1401 ± 95 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint93149117168
domContentLoaded12271984138220096
load12271984140119795
domInteractive12271984138220096

highlights:

storybook

metamaskbot avatar Sep 14 '22 17:09 metamaskbot

Just saw this other issue related to resolving contract functions. It seems it's a different one, but not sure if this PR would also affect this behaviour. Just tagging FYI @adonesky1 @digiwand

Zero-arg function calls shown as "Contract interaction" rather than function name

seaona avatar Sep 15 '22 13:09 seaona