ethereum/go-ethereum · warning

./bench: ElligatorSwift module not enabled.\n

Error message

./bench: ElligatorSwift module not enabled.\n

What it means

Compile-time guard for the ElligatorSwift module: without ENABLE_MODULE_ELLSWIFT, any bench argument mentioning 'ellswift', 'encode', 'decode', 'ellswift_keygen', or 'ellswift_ecdh' makes the tool print this message and exit. ElligatorSwift is used by BIP-324 v2 transport, so this module matters for P2P-encryption-related benchmarking.

Source

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

        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");
        fprintf(stderr, "Use ./configure --enable-module-ellswift.\n\n");
        return EXIT_FAILURE;
    }
#endif

    /* ECDSA benchmark */
    data.ctx = secp256k1_context_create(SECP256K1_CONTEXT_NONE);

    for (i = 0; i < 32; i++) {
        data.msg[i] = 1 + i;
    }
    for (i = 0; i < 32; i++) {
        data.key[i] = 33 + i;
    }
    data.siglen = 72;
    CHECK(secp256k1_ecdsa_sign(data.ctx, &sig, data.msg, data.key, NULL, NULL));
    CHECK(secp256k1_ecdsa_signature_serialize_der(data.ctx, data.sig, &data.siglen, &sig));
    CHECK(secp256k1_ec_pubkey_create(data.ctx, &pubkey, data.key));

View on GitHub (pinned to 6bb0588ad8)

Solutions

  1. Rebuild with ./configure --enable-module-ellswift
  2. Remove ellswift/encode/decode tokens from the invocation
  3. Mirror geth's own cgo flags (see crypto/secp256k1 build tags) when assembling the bench build

Example fix

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

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

Strategy: validation

Validate before calling

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

Prevention

When it happens

Trigger: Running ./bench with any ellswift-related token on a libsecp256k1 build configured without --enable-module-ellswift. Geth's cgo build of the vendored library enables only the modules it uses, so a manual bench build lacking the flag will refuse these benchmarks.

Common situations: Benchmarking v2-transport crypto on a manually built vendored copy; stale bench scripts after upstream added ellswift benchmarks; minimal ./configure builds.

Related errors


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