Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Commit 66c4fe0

Browse files
authored
Replace all bytes in signature with 01 to reduce variability in PVG estimate (#154)
1 parent b14d8bb commit 66c4fe0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/client/client.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
package client
33

44
import (
5+
"bytes"
56
"errors"
67
"math/big"
78

@@ -177,13 +178,15 @@ func (i *Client) EstimateUserOperationGas(op map[string]any, ep string) (*gas.Ga
177178
}
178179
data["verificationGasLimit"] = hexutil.EncodeBig(big.NewInt(int64(vg)))
179180
data["callGasLimit"] = hexutil.EncodeBig(big.NewInt(int64(cg)))
181+
data["signature"] = hexutil.Encode(bytes.Repeat([]byte{1}, len(userOp.Signature)))
180182
userOp, err = userop.New(data)
181183
if err != nil {
182184
l.Error(err, "eth_estimateUserOperationGas error")
183185
return nil, err
184186
}
185187

186-
// Return gas values with a PVG calculation that takes into account updated gas limits.
188+
// Return gas values with a PVG calculation that takes into account updated gas limits and a signature
189+
// with no zero bytes.
187190
l.Info("eth_estimateUserOperationGas ok")
188191
return &gas.GasEstimates{
189192
PreVerificationGas: gas.NewDefaultOverhead().CalcPreVerificationGas(userOp),

0 commit comments

Comments
 (0)