alchemyplatform / multisig-plugin

GNU General Public License v3.0
7 stars 0 forks source link

feat: add variable gas feature #2

Closed howydev closed 8 months ago

howydev commented 8 months ago

userOp.signature format changes from:

  1. k signatures
  2. to: upperLimitPreVerificationGas | upperLimitMaxFeePerGas | upperLimitMaxPriorityFeePerGas | k signatures

If the upperLimitPreVerificationGas, upperLimitMaxFeePerGas or upperLimitMaxPriorityFeePerGas differs from preVerificationGas, userop.maxFeePerGas or userop.maxPriorityFeePerGas, we expect at least 1 sig on the actual gas values used in the userop. This verification prevents a bundler or front runner manually running entryPoint.handleOps with any gas values

We use the v value to switch between signatures on the userOpHashes with upper limit gas values or the actual gas values:

  1. v = 0 refers to contract sigs on upper limit values
  2. v = 32 refers to contract sigs on actual values
  3. v = 27/28 refers to EOA sigs on upper limit values
  4. v = 59/60 refers to EOA sigs on actual values

notes:

  1. requires via-ir to compile (else stack too deep)
  2. dummy sig should use variable gas by default. else it can potentially be underpriced on the order of a few hundred to thousands of gas