This repository was archived by the owner on Oct 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
package gas
2
2
3
3
import (
4
+ "bytes"
4
5
"context"
5
6
"math"
6
7
"math/big"
@@ -39,9 +40,22 @@ func CalcArbitrumPVGWithEthClient(
39
40
pk , _ := crypto .GenerateKey ()
40
41
dummy , _ := signer .New (hexutil .Encode (crypto .FromECDSA (pk ))[2 :])
41
42
return func (op * userop.UserOperation , static * big.Int ) (* big.Int , error ) {
43
+ // Sanitize paymasterAndData.
44
+ // TODO: Figure out why variability in this field is causing Arbitrum's precompile to return different
45
+ // values.
46
+ data , err := op .ToMap ()
47
+ if err != nil {
48
+ return nil , err
49
+ }
50
+ data ["paymasterAndData" ] = hexutil .Encode (bytes .Repeat ([]byte {1 }, len (op .PaymasterAndData )))
51
+ tmp , err := userop .New (data )
52
+ if err != nil {
53
+ return nil , err
54
+ }
55
+
42
56
// Pack handleOps method inputs
43
57
ho , err := methods .HandleOpsMethod .Inputs .Pack (
44
- []entrypoint.UserOperation {entrypoint .UserOperation (* op )},
58
+ []entrypoint.UserOperation {entrypoint .UserOperation (* tmp )},
45
59
dummy .Address ,
46
60
)
47
61
if err != nil {
@@ -50,7 +64,7 @@ func CalcArbitrumPVGWithEthClient(
50
64
51
65
// Encode function data for gasEstimateL1Component
52
66
create := false
53
- if op .Nonce .Cmp (common .Big0 ) == 0 {
67
+ if tmp .Nonce .Cmp (common .Big0 ) == 0 {
54
68
create = true
55
69
}
56
70
ge , err := nodeinterface .GasEstimateL1ComponentMethod .Inputs .Pack (
You can’t perform that action at this time.
0 commit comments