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

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

Merged
merged 3 commits into from
Sep 14, 2022

Conversation

adonesky1
Copy link
Contributor

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

rentals-parsed-func.mp4

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

@adonesky1 adonesky1 requested a review from a team as a code owner August 4, 2022 19:11
@adonesky1 adonesky1 requested a review from ryanml August 4, 2022 19:11
@adonesky1 adonesky1 changed the title Skip searching 4byte directory if we don't have a full 4bytes of data Skip searching 4byte directory if we don't have a full 4 bytes of data Aug 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2022

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.

@seaona
Copy link
Contributor

seaona commented Aug 5, 2022

from QA looks good

NiranjanaBinoy
NiranjanaBinoy previously approved these changes Aug 8, 2022
@metamaskbot
Copy link
Collaborator

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

Copy link
Contributor

@digiwand digiwand left a comment

Choose a reason for hiding this comment

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

request to remove unutilized fourBytePrefix === 0x check

Copy link
Contributor

@digiwand digiwand left a comment

Choose a reason for hiding this comment

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

🙌

@metamaskbot
Copy link
Collaborator

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

@adonesky1 adonesky1 merged commit 0026966 into develop Sep 14, 2022
@adonesky1 adonesky1 deleted the only-search-4byte-with-4bytes branch September 14, 2022 18:36
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2022
@seaona
Copy link
Contributor

seaona commented Sep 15, 2022

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

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.

7 participants