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

Implement the PackedUserOperation #669

Closed
TheDivic opened this issue Aug 8, 2024 · 0 comments · Fixed by #677
Closed

Implement the PackedUserOperation #669

TheDivic opened this issue Aug 8, 2024 · 0 comments · Fixed by #677
Assignees

Comments

@TheDivic
Copy link
Collaborator

TheDivic commented Aug 8, 2024

What?

There's a skeleton implementation in this file in our Draft PR.

You need to:

  • figure out how do we pack & unpack user operations (start with how do we pack a field like accountGasLimits) and implement that logic.
  • figure out how do we hash a user operation now the structure has changed. There's a Solidity reference implementation in the stub implementation.
  • write tests that check our packing & hashing logic using examples that we know are valid (figure out where to get them).

Why?

  • We need to start with this domain logic & entities because everything else depends on this.
  • EP V7 requires packed user operations and it's not backwards compatible with the old user operation entity.

How?

Overall:

  • Work on the branch related to the Draft PR. You may branch out and create PRs from your feature branch to the Draft PR branch, but let's not merge anything into master yet.
  • Consider consulting with the SDK team to see if they may already have an alpha version of the SDK so you can maybe take something from them.

🧪 How to test:

  • For testing the new getUserOpHash function you can generate a fixture file of N user operations and their (known) correct hashes by calling the getUserOpHash function on the EP contract. Then you can create hashes using your offchain logic and compare them to the expected results from the fixture file.
  • To test the packing / unpacking logic, maybe look into the implementations of our competitors for test cases you can replicate.

📚 Resources

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 a pull request may close this issue.

2 participants