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

feature: Add packed user op for EntryPoint v0.7 #670

Merged
merged 5 commits into from
Aug 13, 2024

Conversation

veljkovranic
Copy link
Contributor

@veljkovranic veljkovranic commented Aug 12, 2024

📖 Context

Type of change

  • Non-breaking change (backwards compatible)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Why are we doing this

Entypoint v0.7 smart contract introduces a new PackedUserOperation type that packs the following fields

  • accountGasLimits as (concatenation of verificationGas (16 bytes) and callGas (16 bytes))
  • gasFees (concatenation of maxPriorityFee (16 bytes) and maxFeePerGas (16 bytes))

To achieve this, we introduce packAccountGasLimits and packGasFees, both relying on packUint methods.

To be able to undo the packing operation, this PR introduces unpacking methods for PackedUserOperation, with the necessary helper functions.

Related issues:

What did we do?

  • Implemented packing/unpacking + encoding/hashing methods for new UserObject in EntryPoint v0.7

How Has This Been Tested?

  • Added unit tests that check simple cases + real-world example from transaction of Base Sepolia (link provided in the comment)

@veljkovranic veljkovranic changed the title Feature/add packed user op feature: Add packed user op for entrypoint v0.7 Aug 12, 2024
@veljkovranic veljkovranic changed the title feature: Add packed user op for entrypoint v0.7 feature: Add packed user op for EntryPoint v0.7 Aug 12, 2024
Copy link
Collaborator

@TheDivic TheDivic left a comment

Choose a reason for hiding this comment

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

Good job on the implementation! 🥇

Please just add some comments and docs.

@veljkovranic veljkovranic merged commit 8e63592 into feature/entrypoint-v7-api Aug 13, 2024
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.

3 participants