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

feat: add a revert decoder to eagerly hash error selectors #7133

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Feb 15, 2024

Eagerly hash selectors once instead of on every call to decode_revert. This improves performance when decoding lots of traces with lots of contracts as decoding custom errors is now trivial.

Diff is kinda bad but the decoding logic is unchanged (review with "hide whitespace").

Closes #7119

See render_trace_arena, from ~2000 to ~750 samples for the same task (FOUNDRY_PROFILE=lite forge t -vvvvv --nmc Fork in sablier/v2-core):

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

hell yeah

@DaniPopes DaniPopes merged commit 95aae1e into master Feb 15, 2024
19 checks passed
@DaniPopes DaniPopes deleted the dani/revert-decoder branch February 15, 2024 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't use JsonAbi to pass around custom errors
2 participants