EPF Update 7

Summary

I didn't get a very good progress this week. This week I mostly focus on the create clients to connect to the EntryPoint contract in the network. But I met problems while I was testing Georli testnet.

Incompatible UserOperation struct

I was spending a lot of time trying to connect to the Georli EntryPoint contract but the client always return code 32000 message execution reverted error. I was able to locate the problem at first.

I tried to start a new test node by Anvil and deploy all the entrypoint contract in the node and it worked fine. Then I start to look at the contracts in the explorer. And I found that the UserOperation struct is different between the latest codes and the codes in the previous deployed contracts in Goerli.

Current version:

struct UserOperation { address sender; uint256 nonce; bytes initCode; bytes callData; uint256 callGasLimit; uint256 verificationGasLimit; uint256 preVerificationGas; uint256 maxFeePerGas; uint256 maxPriorityFeePerGas; bytes paymasterAndData; bytes signature; }

Previous Verion:

struct UserOperation { address sender; uint256 nonce; bytes initCode; bytes callData; uint256 callGas; uint256 verificationGas; uint256 preVerificationGas; uint256 maxFeePerGas; uint256 maxPriorityFeePerGas; address paymaster; bytes paymasterData; bytes signature; }

Except for the field name changes, there is one important change that paymaster and paymasterData fields are merged into the one single field paymasterAndData. This is mostly the incompatible changes.

The situation above raise a new question that why this change is needed? I asked the question in the discord and get a answer from this pr. I haven't reviewed the pr yet. Make it a task next week.

Rust async-trait problem

I came into a problem in rust async-trait. The problem is

expected trait `Future<Output = Result<(), EntrypointContractErr>>`, found trait `Future<Output = Result<(), EntrypointContractErr>> + Send

I haven't figured why and how to solve the problem. I would put more next week.

Reading List

  1. https://blog.rust-lang.org/inside-rust/2019/10/11/AsyncAwait-Not-Send-Error-Improvements.html
  2. https://blog.rust-lang.org/2015/05/11/traits.html