ethereum/go-ethereum · warning

./bench: Public key recovery module not enabled.\n

Error message

./bench: Public key recovery module not enabled.\n

What it means

Same compile-time module guard as the ECDH one, but for public-key recovery: if ENABLE_MODULE_RECOVERY is not defined and you pass 'recover' or 'ecdsa_recover' to ./bench, the tool prints this message and exits. Recovery is optional because it pulls in extra code paths, so builds that skip it must fail fast when asked to benchmark it.

Source

Thrown at crypto/secp256k1/libsecp256k1/src/bench.c:211

        } else if (invalid_args) {
            fprintf(stderr, "./bench: unrecognized argument.\n\n");
            help(default_iters);
            return EXIT_FAILURE;
        }
    }

/* Check if the user tries to benchmark optional module without building it */
#ifndef ENABLE_MODULE_ECDH
    if (have_flag(argc, argv, "ecdh")) {
        fprintf(stderr, "./bench: ECDH module not enabled.\n");
        fprintf(stderr, "Use ./configure --enable-module-ecdh.\n\n");
        return EXIT_FAILURE;
    }
#endif

#ifndef ENABLE_MODULE_RECOVERY
    if (have_flag(argc, argv, "recover") || have_flag(argc, argv, "ecdsa_recover")) {
        fprintf(stderr, "./bench: Public key recovery module not enabled.\n");
        fprintf(stderr, "Use ./configure --enable-module-recovery.\n\n");
        return EXIT_FAILURE;
    }
#endif

#ifndef ENABLE_MODULE_SCHNORRSIG
    if (have_flag(argc, argv, "schnorrsig") || have_flag(argc, argv, "schnorrsig_sign") || have_flag(argc, argv, "schnorrsig_verify")) {
        fprintf(stderr, "./bench: Schnorr signatures module not enabled.\n");
        fprintf(stderr, "Use ./configure --enable-module-schnorrsig.\n\n");
        return EXIT_FAILURE;
    }
#endif

#ifndef ENABLE_MODULE_ELLSWIFT
    if (have_flag(argc, argv, "ellswift") || have_flag(argc, argv, "ellswift_encode") || have_flag(argc, argv, "ellswift_decode") ||
        have_flag(argc, argv, "encode") || have_flag(argc, argv, "decode") || have_flag(argc, argv, "ellswift_keygen") ||
        have_flag(argc, argv, "ellswift_ecdh")) {
        fprintf(stderr, "./bench: ElligatorSwift module not enabled.\n");

View on GitHub (pinned to 6bb0588ad8)

Solutions

  1. Rebuild with ./configure --enable-module-recovery
  2. Compare with the flags geth itself uses in crypto/secp256k1/schnorr/* and build/cgo configuration to keep the bench build equivalent
  3. Remove the 'recover'/'ecdsa_recover' tokens from the invocation if you don't need that benchmark

Example fix

# before
./configure && make && ./src/bench recover   # -> module not enabled

# after
./configure --enable-module-recovery && make && ./src/bench recover
Defensive patterns

Strategy: validation

Validate before calling

#!/bin/sh
if grep -q 'ENABLE_MODULE_RECOVERY' config.h 2>/dev/null; then
  ./src/bench recover
else
  echo "recovery module off; skipping" >&2
fi

Prevention

When it happens

Trigger: Running './bench recover' or './bench ecdsa_recover' against a libsecp256k1 build configured without --enable-module-recovery. Note geth's production cgo build of the vendored libsecp256k1 does enable recovery (secp256k1.go needs it), but a hand-rolled ./configure without the flag will not.

Common situations: Building the vendored library manually with plain './configure' (modules off by default); CI benchmark images built from minimal configure lines; version updates where recovery stopped being default.

Related errors


AI-assisted analysis of ethereum/go-ethereum@6bb0588ad8 (2026-08-15). Data as JSON: /api/errors/95e3cc79e6929658. Report an issue: GitHub.