diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 2be7ece273..60453543fb 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -1,5 +1,3 @@ -// nolint - // Copyright 2014 The go-ethereum Authors // This file is part of the go-ethereum library. // @@ -1164,19 +1162,25 @@ func (c *bls12381MapG2) Run(input []byte) ([]byte, error) { } // kzgPointEvaluation implements the EIP-4844 point evaluation precompile. +// +//nolint:unused type kzgPointEvaluation struct{} // RequiredGas estimates the gas required for running the point evaluation precompile. +// +//nolint:unused func (b *kzgPointEvaluation) RequiredGas(input []byte) uint64 { return params.BlobTxPointEvaluationPrecompileGas } +//nolint:unused const ( blobVerifyInputLength = 192 // Max input length for the point evaluation precompile. blobCommitmentVersionKZG uint8 = 0x01 // Version byte for the point evaluation precompile. blobPrecompileReturnValue = "000000000000000000000000000000000000000000000000000000000000100073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001" ) +//nolint:unused var ( errBlobVerifyInvalidInputLength = errors.New("invalid input length") errBlobVerifyMismatchedVersion = errors.New("mismatched versioned hash") @@ -1184,6 +1188,8 @@ var ( ) // Run executes the point evaluation precompile. +// +//nolint:unused func (b *kzgPointEvaluation) Run(input []byte) ([]byte, error) { if len(input) != blobVerifyInputLength { return nil, errBlobVerifyInvalidInputLength @@ -1220,6 +1226,8 @@ func (b *kzgPointEvaluation) Run(input []byte) ([]byte, error) { } // kZGToVersionedHash implements kzg_to_versioned_hash from EIP-4844 +// +//nolint:unused func kZGToVersionedHash(kzg kzg4844.Commitment) common.Hash { h := sha256.Sum256(kzg[:]) h[0] = blobCommitmentVersionKZG diff --git a/core/vm/contracts_test.go b/core/vm/contracts_test.go index af2f058e43..60b9c1bc47 100644 --- a/core/vm/contracts_test.go +++ b/core/vm/contracts_test.go @@ -331,10 +331,6 @@ func TestPrecompiledBLS12381Pairing(t *testing.T) { testJson("blsPairing", "f func TestPrecompiledBLS12381MapG1(t *testing.T) { testJson("blsMapG1", "f0f", t) } func TestPrecompiledBLS12381MapG2(t *testing.T) { testJson("blsMapG2", "f10", t) } -func TestPrecompiledPointEvaluation(t *testing.T) { testJson("pointEvaluation", "0a", t) } - -func BenchmarkPrecompiledPointEvaluation(b *testing.B) { benchJson("pointEvaluation", "0a", b) } - func BenchmarkPrecompiledBLS12381G1Add(b *testing.B) { benchJson("blsG1Add", "f0a", b) } func BenchmarkPrecompiledBLS12381G1MultiExp(b *testing.B) { benchJson("blsG1MultiExp", "f0b", b) } func BenchmarkPrecompiledBLS12381G2Add(b *testing.B) { benchJson("blsG2Add", "f0c", b) }