Skip to content

IND-277 | Implement bundler-based gas estimation and signature-aware preVerificationGas#5

Closed
enis-incentiv wants to merge 1 commit intomainfrom
IND-175-dynamic-gas-estimation-with-bundler-simulation
Closed

IND-277 | Implement bundler-based gas estimation and signature-aware preVerificationGas#5
enis-incentiv wants to merge 1 commit intomainfrom
IND-175-dynamic-gas-estimation-with-bundler-simulation

Conversation

@enis-incentiv
Copy link
Collaborator

Story

https://incentiv-net.atlassian.net/browse/IND-277

Summary

This PR improves gas estimation in the UI-SDK by implementing bundler-based gas estimation for transaction gas limits, while separately optimizing preVerificationGas calculation based on signature types. This ensures more accurate gas estimation for user operations while properly accounting for different signature sizes in the preVerificationGas overhead.

Key Changes:

  1. Gas Estimation Improvements:

    • Implemented bundler-based gas estimation for transaction gas limits
    • Added proper error handling and logging for bundler estimation responses
    • Preserved user-provided gas limits when explicitly set
  2. PreVerificationGas Optimization:

    • Enhanced preVerificationGas calculation to account for different signature sizes
    • Added proper handling of EOA (65 bytes) and Passkey (536 bytes) signatures
    • Added fallback minimum gas value (49,024) to ensure bundler requirements
  3. Debug Improvements:

    • Added detailed debug logs for gas estimation process
    • Enhanced error reporting for bundler estimation failures

Testing:

  • Verified gas estimation works correctly for both EOA and Passkey signatures
  • Tested bundler estimation with various transaction types (transfers, contract interactions)
  • Confirmed proper error handling when bundler estimation fails

Technical Notes:

  • The bundler estimation is now the primary source of gas limits
  • Gas estimation takes into account the signature type (65 bytes for EOA, 536 bytes for Passkey)
  • Added safeguards to prevent underestimation of gas limits

@enis-incentiv enis-incentiv deleted the IND-175-dynamic-gas-estimation-with-bundler-simulation branch December 30, 2024 22:39
@enis-incentiv
Copy link
Collaborator Author

Closing this PR as it was created with incorrect story number in the branch name (IND-175 instead of IND-277).
Created a new PR with the correct branch name IND-277-dynamic-gas-estimation-with-bundler-simulation to ensure proper JIRA linking.

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.

1 participant