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

Abstract sanity check and simulation rules #162

Merged
merged 2 commits into from
Aug 2, 2023
Merged

Abstract sanity check and simulation rules #162

merged 2 commits into from
Aug 2, 2023

Conversation

Vid201
Copy link
Member

@Vid201 Vid201 commented Jul 15, 2023

This PR abstracts sanity check and simulation results, making it easier to implement alternative mempools when they arrive. It's easy to add new rules if necessary and decide which rules you want to use.

I added 3 steps to user operation validator:

  • sanity -> basic sanity checks
  • simulation -> calls simulateValidation but without tracing
  • simulation trace -> call simulateValidation with JS tracing

Feel free to suggest any changes (outcome and helpers of validation could probably be improved in the future, but I didn't think of a better solution at the moment).

@Vid201 Vid201 changed the title Feat/altmempools Abstract sanity check and simulation rules Jul 15, 2023
@Vid201 Vid201 linked an issue Jul 26, 2023 that may be closed by this pull request
@Vid201 Vid201 force-pushed the feat/altmempools branch 2 times, most recently from bf37e3a to 8e77860 Compare July 26, 2023 21:32
@Vid201 Vid201 marked this pull request as ready for review July 26, 2023 21:59
@Vid201 Vid201 requested a review from zsluedem July 26, 2023 22:00
Copy link
Collaborator

@zsluedem zsluedem left a comment

Choose a reason for hiding this comment

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

Generally looks good.Left some comments.

crates/uopool/src/validate/simulation_trace/call_stack.rs Outdated Show resolved Hide resolved
crates/uopool/src/validate/mod.rs Show resolved Hide resolved
crates/grpc/src/uopool.rs Show resolved Hide resolved
crates/grpc/src/uopool.rs Outdated Show resolved Hide resolved
@Vid201 Vid201 requested a review from zsluedem August 1, 2023 10:00
Copy link
Collaborator

@zsluedem zsluedem left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments. Very nice work! 👍

@Vid201 Vid201 merged commit e420ad3 into main Aug 2, 2023
2 checks passed
@Vid201 Vid201 deleted the feat/altmempools branch August 2, 2023 07:14
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.

Abstract sanity check and simulation rules
2 participants