Skip to content

Commit

Permalink
Update spec (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristofgazso authored Feb 11, 2024
1 parent 626af49 commit 549a29b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions erc/ERCS/erc-4337.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,18 @@ To avoid Ethereum consensus changes, we do not attempt to create new transaction
| `preVerificationGas` | `uint256` | Extra gas to pay the bunder |
| `maxFeePerGas` | `uint256` | Maximum fee per gas (similar to [EIP-1559](./eip-1559.md) `max_fee_per_gas`) |
| `maxPriorityFeePerGas` | `uint256` | Maximum priority fee per gas (similar to EIP-1559 `max_priority_fee_per_gas`) |
| `paymaster` | `address` | address of paymaster contract, (or empty, if account pays for itself) |
| `paymaster` | `address` | Address of paymaster contract, (or empty, if account pays for itself) |
| `paymasterVerificationGasLimit` | `uint256` | The amount of gas to allocate for the paymaster validation code |
| `paymasterPostOpGasLimit` | `uint256` | The amount of gas to allocate for the paymaster post-operation code |
| `paymasterData` | `uint256` | data for paymaster (only if paymaster exists) |
| `paymasterData` | `bytes` | Data for paymaster (only if paymaster exists) |
| `signature` | `bytes` | Data passed into the account to verify authorization |

Users send `UserOperation` objects to a dedicated user operation mempool. The are not concerned with the packed version.
A specialized class of actors called **bundlers** (either block builders running special-purpose code, or users that can relay transactions to block builders eg. through a bundle marketplace such as Flashbots that can guarantee next-block-or-never inclusion) listen in on the user operation mempool, and create **bundle transactions**. A bundle transaction packages up multiple `UserOperation` objects into a single `handleOps` call to a pre-published global **entry point contract**.

To prevent replay attacks (both cross-chain and multiple `EntryPoint` implementations), the `signature` should depend on `chainid` and the `EntryPoint` address.

When passed to on-chain contacts (the EntryPoint contract, and then to account and paymasdter), a packed version of the above structure is used:
When passed to on-chain contacts (the EntryPoint contract, and then to account and paymaster), a packed version of the above structure is used:

| Field | Type | Description |
|----------------------|-----------|------------------------------------------------------------------------|
Expand All @@ -88,7 +88,7 @@ When passed to on-chain contacts (the EntryPoint contract, and then to account a
| `callData` | `bytes` | |
| `accountGasLimits` | `bytes32` | concatenation of verificationGas (16 bytes) and callGas (16 bytes) |
| `preVerificationGas` | `uint256` | |
| `gasLimits` | `bytes32` | concatenation of maxPriorityFee (16 bytes) and maxFeePerGas (16 bytes) |
| `gasFees` | `bytes32` | concatenation of maxPriorityFee (16 bytes) and maxFeePerGas (16 bytes) |
| `paymasterAndData` | `bytes` | concatenation of paymaster fields (or empty) |
| `signature` | `bytes` | |

Expand Down Expand Up @@ -601,6 +601,10 @@ Request:
preVerificationGas, // uint256
maxFeePerGas, // uint256
maxPriorityFeePerGas, // uint256
paymaster, // address
paymasterVerificationGasLimit, // uint256
paymasterPostOpGasLimit, // uint256
paymasterData, // bytes
signature // bytes
},
entryPoint // address
Expand Down Expand Up @@ -669,6 +673,8 @@ Still, it might require putting a "semi-valid" signature (e.g. a signature in th
* **preVerificationGas** gas overhead of this UserOperation
* **verificationGasLimit** actual gas used by the validation of this UserOperation
* **callGasLimit** value used by inner account execution
* **paymasterVerificationGasLimit** value used for paymaster verification (if paymaster exists in the UserOperation)
* **paymasterPostOpGasLimit** value used for paymaster post op execution (if paymaster exists in the UserOperation)

##### Error Codes:

Expand Down

0 comments on commit 549a29b

Please sign in to comment.