diff --git a/op-program/client/l2/engineapi/precompiles.go b/op-program/client/l2/engineapi/precompiles.go index fa925d4bc38..845d2e0dc6e 100644 --- a/op-program/client/l2/engineapi/precompiles.go +++ b/op-program/client/l2/engineapi/precompiles.go @@ -29,6 +29,7 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/bitutil" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/kzg4844" @@ -175,7 +176,7 @@ func (c *ecrecoverOracle) Run(input []byte) ([]byte, error) { v := input[63] - 27 // tighter sig s values input homestead only apply to tx sigs - if !allZero(input[32:63]) || !crypto.ValidateSignatureValues(v, r, s, false) { + if bitutil.TestBytes(input[32:63]) || !crypto.ValidateSignatureValues(v, r, s, false) { return nil, nil } @@ -187,15 +188,6 @@ func (c *ecrecoverOracle) Run(input []byte) ([]byte, error) { return result, nil } -func allZero(b []byte) bool { - for _, byte := range b { - if byte != 0 { - return false - } - } - return true -} - type bn256PairingOracle struct { Orig vm.PrecompiledContract Oracle PrecompileOracle