diff --git a/common/user_op/user_operation.go b/common/user_op/user_operation.go index e8b96e63..32167b9e 100644 --- a/common/user_op/user_operation.go +++ b/common/user_op/user_operation.go @@ -267,23 +267,6 @@ type UserOpInput struct { ComputeGasOnly bool } -func packUserOpV6ForUserOpHash(userOp *UserOperationV06) (string, []byte, error) { - //TODO disgusting logic - encoded, err := userOpV06PackArg.Pack(userOp.Sender, userOp.Nonce, userOp.InitCode, userOp.CallData, userOp.CallGasLimit, userOp.VerificationGasLimit, userOp.PreVerificationGas, userOp.MaxFeePerGas, userOp.MaxPriorityFeePerGas, global_const.DummyPaymasterDataByte, userOp.Sender) - if err != nil { - return "", nil, err - } - //https://github.com/jayden-sudo/SoulWalletCore/blob/dc76bdb9a156d4f99ef41109c59ab99106c193ac/contracts/utils/CalldataPack.sol#L51-L65 - hexString := hex.EncodeToString(encoded) - //1. get From 63*10+ 1 ~64*10 - hexString = hexString[64:] - //hexLen := len(hexString) - subIndex := GetIndex(hexString) - hexString = hexString[:subIndex] - //fmt.Printf("subIndex: %d\n", subIndex) - return hexString, encoded, nil -} - func (userOp *UserOpInput) PackUserOpForMock(version global_const.EntrypointVersion) (string, []byte, error) { if version == global_const.EntrypointV07 { gasFee := utils.PackIntTo32Bytes(userOp.MaxPriorityFeePerGas, userOp.MaxFeePerGas) diff --git a/gas_executor/pre_vertification_gas.go b/gas_executor/pre_vertification_gas.go index 45217127..65d6cb52 100644 --- a/gas_executor/pre_vertification_gas.go +++ b/gas_executor/pre_vertification_gas.go @@ -44,8 +44,8 @@ func ArbitrumPreVerificationGasFunc() PreVerificationGasFunc { if err != nil { return nil, err } - big.NewInt(0).Add(base, big.NewInt(int64(estimateOutPut.GasEstimateForL1))) - return big.NewInt(0), nil + + return big.NewInt(0).Add(base, big.NewInt(int64(estimateOutPut.GasEstimateForL1))), nil } } func DefaultPreVerificationGasFunc() PreVerificationGasFunc { @@ -116,7 +116,8 @@ func getBasicPreVerificationGas(op *user_op.UserOpInput, strategy *model.Strateg callDataConst += global_const.GasOverHand.NonZeroByte } } - floatRes := math.Round(callDataConst + global_const.GasOverHand.Fixed/global_const.GasOverHand.BundleSize + global_const.GasOverHand.PerUserOp + global_const.GasOverHand.PerUserOpWord*lengthInWord) + floatRes := math.Round(callDataConst + global_const.GasOverHand.Fixed/global_const.GasOverHand.BundleSize + + global_const.GasOverHand.PerUserOp + global_const.GasOverHand.PerUserOpWord*lengthInWord) floatVal := new(big.Float).SetFloat64(floatRes) result := new(big.Int) floatVal.Int(result) diff --git a/go.mod b/go.mod index 7cb8bb9e..d5018508 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/NethermindEth/starknet.go v0.7.0 github.com/appleboy/gin-jwt/v2 v2.9.2 github.com/deckarep/golang-set/v2 v2.6.0 - github.com/ethereum/go-ethereum v1.13.14 + github.com/ethereum/go-ethereum v1.14.3 github.com/gin-contrib/cors v1.7.1 github.com/gin-gonic/gin v1.9.1 github.com/go-playground/validator/v10 v10.19.0 @@ -57,10 +57,10 @@ require ( github.com/chenzhuoyu/iasm v0.9.1 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect - github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect; indirect(force degrade) + github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect; indirect(force degrade) github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect - github.com/ethereum/c-kzg-4844 v0.4.0 // indirect; indirect (force degrade) + github.com/ethereum/c-kzg-4844 v1.0.0 // indirect; indirect (force degrade) github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gin-contrib/sse v0.1.0 // indirect diff --git a/go.sum b/go.sum index 06e7de14..eebfdc2f 100644 --- a/go.sum +++ b/go.sum @@ -57,6 +57,8 @@ github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUp github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= +github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= +github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -70,8 +72,12 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnN github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= +github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.13.14 h1:EwiY3FZP94derMCIam1iW4HFVrSgIcpsu0HwTQtm6CQ= github.com/ethereum/go-ethereum v1.13.14/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU= +github.com/ethereum/go-ethereum v1.14.3 h1:5zvnAqLtnCZrU9uod1JCvHWJbPMURzYFHfc2eHz4PHA= +github.com/ethereum/go-ethereum v1.14.3/go.mod h1:1STrq471D0BQbCX9He0hUj4bHxX2k6mt5nOQJhDNOJ8= github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=