Skip to content

fix: harden client info pprof gating and SPV proof-header validation - #4339

Merged
piotr-roslaniec merged 5 commits into
devfrom
fix/pr-4256-review-findings
Sep 25, 2026
Merged

piotr-roslaniec merged 5 commits into
devfrom
fix/pr-4256-review-findings

Conversation

@piotr-roslaniec

@piotr-roslaniec piotr-roslaniec commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Three fixes found while reviewing the cumulative dev → main diff in
#4256. Each was verified against dev before being fixed; both behavioral
changes have a regression test that fails without the fix.

pprof exposed while disabled

EnablePprof: false did not disable profiling. Importing net/http/pprof
registers /debug/pprof/* on http.DefaultServeMux from that package's
init, whether the import is blank or named. EnableServer built an
http.Server with a nil Handler, so it served DefaultServeMux and
exposed the profiling endpoints on the client info port regardless of the
setting.

Reproduced before fixing: GET /debug/pprof/ against the existing
port-9799 test server returned 200 while profiling was disabled.

Impact is bounded by whether the client info port is reachable. Where it
is, a caller gets goroutine and runtime introspection plus the expensive
profile and trace endpoints, and an operator who explicitly disabled
profiling is silently overridden. To be precise about scope: Go's heap
profile reports allocation metadata and stacks, not arbitrary process
memory, so this is not a key-material dump.

The handler is now built on a mux created per registry, with the pprof
handlers registered only when profiling is enabled. That also removes a
latent panic: registering the registry's routes on the process-global mux
made a second registry fail with a duplicate-pattern conflict.

EnableServer(port int) keeps its signature and never exposes profiling;
Initialize calls a private enableServer(port, cfg.EnablePprof). No
exported API change.

--spv.maxProofHeaders 0 silently disables SPV proving

The flag uses cobra's UintVar, which accepts 0, and nothing validated
the parsed value — the 144 default only covers omission. getProofInfo
compares the running header count against the bound at loop entry with the
count starting at zero, so a zero bound returns
proofSkipExceededMaxHeaders on the first iteration for every
transaction. SPV proving stops entirely while the logs report each
transaction as possibly permanently unprovable, which reads as a chain
condition rather than a misconfiguration.

Rejected at startup rather than normalized to the default, so an explicit
operator instruction is not silently replaced. Validation runs via
validateMaintainerConfig, the first statement in maintainers(), before
any chain connection is attempted.

Documentation corrections

docs/release-process.md described sub-PRs merging into dev and
main before closing. If they also landed on main, the aggregation PR's
diff would be empty and there would be nothing to release, contradicting
the adjacent text describing that diff as what is queued for the next
release.

The maxWalletTxVsize comment called 10M vbytes "~2x Bitcoin block
weight". A block is capped at 4,000,000 weight units, which is 1,000,000
vbytes, so the bound is ~10x a maximum block's vsize; the original also
conflated vbytes with weight units. The bound itself is unchanged.

Verification

Run locally — not a full-repository suite, and CI has not been observed:

  • go build ./...
  • go vet on pkg/clientinfo, pkg/maintainer/spv, pkg/tbtcpg, cmd
  • go test on pkg/clientinfo, cmd, pkg/maintainer/...,
    pkg/tbtcpg, pkg/tbtc

Tests added: pprof disabled (404 on the real server mux) and enabled (200
via serverHandler(true)); Config.Validate rejecting zero; and the
command-level flag path asserting --spv.maxProofHeaders 0 parses into
config and is then rejected.

pkg/clientinfo was run serially — its TestMain binds a fixed port, so
concurrent runs can cross-talk.

Scope

These are the findings confirmed from a partial review of #4256; the
review did not cover the whole aggregation diff, so this PR is not
evidence that the rest of it is clean. Pre-existing issues unchanged by
#4256 (the latest tag in tbtc-v2-monitoring, thresholdnetwork
references in scripts/build.sh and the docker sample) were deliberately
left alone.

Importing net/http/pprof registers /debug/pprof/* on http.DefaultServeMux
from that package's init, regardless of whether the import is blank or
named. The client info server built an http.Server with a nil Handler, so
it served DefaultServeMux and exposed the profiling endpoints on the
client info port even when EnablePprof was false.

Any caller able to reach that port got goroutine and runtime
introspection plus the expensive profile and trace endpoints, and an
operator who explicitly disabled profiling was silently overridden.

Build the handler on a mux created per registry instead, registering the
pprof handlers on it only when profiling is enabled. Constructing the mux
per call also removes a latent panic: registering the registry's routes
on the process-global mux made a second registry fail with a duplicate
pattern conflict.

EnableServer keeps its signature and never exposes profiling; Initialize
routes through a private helper that takes the flag.
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: ba69cd33-9ae7-4e46-a75c-0ed6a5f4beba

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The flag is registered with cobra's UintVar, which accepts 0, and nothing
validated the parsed value. The 144 default only covers the case where
the flag is omitted, so --spv.maxProofHeaders 0 reached the proof
assembly loop.

getProofInfo compares the running header count against the bound at loop
entry, with the count starting at zero, so a zero bound returns
proofSkipExceededMaxHeaders on the first iteration for every transaction.
That disables SPV proving entirely while logging each transaction as
possibly permanently unprovable, which reads as a chain condition rather
than a misconfiguration.

Reject the value at startup rather than normalizing it to the default, so
an explicit instruction is not silently replaced. Validation runs before
any chain connection is attempted.
The release process described sub-PRs merging into dev and main before
closing. If sub-PRs also landed on main, the aggregation PR's diff would
be empty and there would be nothing left to release, contradicting the
adjacent text describing that diff as what is queued for the next
release.

The maxWalletTxVsize comment called 10M vbytes roughly 2x a Bitcoin block
weight. A block is capped at 4,000,000 weight units, which is 1,000,000
vbytes, so the bound is about 10x a maximum block's vsize; the original
also conflated vbytes with weight units.
@piotr-roslaniec
piotr-roslaniec force-pushed the fix/pr-4256-review-findings branch from 8cb2644 to be4371d Compare September 23, 2026 08:44
@piotr-roslaniec piotr-roslaniec changed the title fix: address review findings from the dev-to-main aggregation PR fix: harden client info pprof gating and SPV proof-header validation Sep 23, 2026
- align validateMaintainerConfig with the library maintainer.Config.Validate
  conditional rule so a disabled-SPV setup is not rejected on an unrelated
  zero maxProofHeaders
- extend spv.Config.Validate to reject zero/non-positive HistoryDepth,
  TransactionLimit, and backoff times: the flag defaults only cover
  omission, and each of these values silently degrades the maintainer at
  runtime the same way a zero MaxProofHeaders bound did
- harden the clientinfo live-server tests: reserve an OS ephemeral port
  instead of the fixed 9799, following the cmd/maintainer_test.go pattern
- add /profile and /trace to the enabled-path pprof endpoint assertions
- warn when EnablePprof is set without a Port so the misconfiguration is
  not silently ignored
- cover custom positive maxProofHeaders values through the
  flag -> config -> validation path
- correct the stale DefaultServeMux comment in cmd/maintainer_test.go
- document who merges sub-PRs into dev in docs/release-process.md
@github-actions

Copy link
Copy Markdown

client-bench results

Baseline: latest successful push on the target branch.

benchstat vs baseline
goos: linux
goarch: amd64
pkg: github.com/keep-network/keep-core/pkg/altbn128
cpu: AMD EPYC 7763 64-Core Processor                
                                │ bench-prev/bench.txt │              bench.txt               │
                                │        sec/op        │    sec/op      vs base               │
CompressG1-4                             317.8n ± 162%   311.8n ± 156%       ~ (p=0.101 n=10)
DecompressG1-4                           41.77µ ±   3%   40.40µ ±   4%       ~ (p=0.052 n=10)
CompressDecompressRoundTripG1-4          41.47µ ±   2%   41.68µ ±   3%       ~ (p=0.481 n=10)
CompressDecompressRoundTripG2-4          1.899m ±   2%   1.879m ±   1%  -1.08% (p=0.001 n=10)
geomean                                  31.98µ          31.51µ         -1.45%

                                │ bench-prev/bench.txt │               bench.txt               │
                                │         B/op         │     B/op      vs base                 │
CompressG1-4                                224.0 ± 0%     224.0 ± 0%       ~ (p=1.000 n=10) ¹
DecompressG1-4                            4.587Ki ± 2%   4.579Ki ± 2%       ~ (p=0.403 n=10)
CompressDecompressRoundTripG1-4           4.872Ki ± 1%   4.833Ki ± 3%       ~ (p=0.304 n=10)
CompressDecompressRoundTripG2-4           1.138Mi ± 2%   1.148Mi ± 2%       ~ (p=0.280 n=10)
geomean                                   8.688Ki        8.686Ki       -0.02%
¹ all samples are equal

                                │ bench-prev/bench.txt │              bench.txt               │
                                │      allocs/op       │  allocs/op   vs base                 │
CompressG1-4                                5.000 ± 0%    5.000 ± 0%       ~ (p=1.000 n=10) ¹
DecompressG1-4                              146.5 ± 4%    142.0 ± 5%       ~ (p=0.107 n=10)
CompressDecompressRoundTripG1-4             149.0 ± 3%    151.5 ± 5%       ~ (p=0.419 n=10)
CompressDecompressRoundTripG2-4            15.85k ± 2%   16.00k ± 2%       ~ (p=0.353 n=10)
geomean                                     203.9         203.7       -0.13%
¹ all samples are equal

pkg: github.com/keep-network/keep-core/pkg/beacon/gjkr
                                            │ bench-prev/bench.txt │             bench.txt              │
                                            │        sec/op        │   sec/op     vs base               │
MarshalEphemeralPublicKeyMessage-4                     1.295µ ± 0%   1.298µ ± 0%       ~ (p=0.145 n=10)
UnmarshalEphemeralPublicKeyMessage-4                   53.22µ ± 0%   53.25µ ± 0%       ~ (p=0.225 n=10)
MarshalEphemeralPublicKeyMessage_64Keys-4              24.37µ ± 0%   24.33µ ± 0%       ~ (p=0.515 n=10)
UnmarshalEphemeralPublicKeyMessage_64Keys-4            1.664m ± 0%   1.664m ± 0%       ~ (p=0.853 n=10)
geomean                                                40.89µ        40.89µ       +0.01%

                                            │ bench-prev/bench.txt │               bench.txt               │
                                            │         B/op         │     B/op      vs base                 │
MarshalEphemeralPublicKeyMessage-4                      784.0 ± 0%     784.0 ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalEphemeralPublicKeyMessage-4                  1.255Ki ± 0%   1.255Ki ± 0%       ~ (p=1.000 n=10) ¹
MarshalEphemeralPublicKeyMessage_64Keys-4             15.91Ki ± 0%   15.91Ki ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalEphemeralPublicKeyMessage_64Keys-4           32.00Ki ± 0%   32.00Ki ± 0%       ~ (p=1.000 n=10) ¹
geomean                                               4.703Ki        4.703Ki       +0.00%
¹ all samples are equal

                                            │ bench-prev/bench.txt │              bench.txt              │
                                            │      allocs/op       │ allocs/op   vs base                 │
MarshalEphemeralPublicKeyMessage-4                      16.00 ± 0%   16.00 ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalEphemeralPublicKeyMessage-4                    24.00 ± 0%   24.00 ± 0%       ~ (p=1.000 n=10) ¹
MarshalEphemeralPublicKeyMessage_64Keys-4               384.0 ± 0%   384.0 ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalEphemeralPublicKeyMessage_64Keys-4             584.0 ± 0%   584.0 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                 96.33        96.33       +0.00%
¹ all samples are equal

pkg: github.com/keep-network/keep-core/pkg/bitcoin
                                  │ bench-prev/bench.txt │             bench.txt              │
                                  │        sec/op        │   sec/op     vs base               │
ComputeSignatureHashes_1Input-4              1.452µ ± 2%   1.443µ ± 1%  -0.59% (p=0.011 n=10)
ComputeSignatureHashes_5Inputs-4             4.355µ ± 0%   4.351µ ± 0%  -0.08% (p=0.027 n=10)
ComputeSignatureHashes_20Inputs-4            15.16µ ± 0%   15.08µ ± 0%  -0.49% (p=0.001 n=10)
geomean                                      4.575µ        4.558µ       -0.39%

                                  │ bench-prev/bench.txt │               bench.txt               │
                                  │         B/op         │     B/op      vs base                 │
ComputeSignatureHashes_1Input-4               752.0 ± 0%     752.0 ± 0%       ~ (p=1.000 n=10) ¹
ComputeSignatureHashes_5Inputs-4            2.367Ki ± 0%   2.367Ki ± 0%       ~ (p=1.000 n=10) ¹
ComputeSignatureHashes_20Inputs-4           8.672Ki ± 0%   8.672Ki ± 0%       ~ (p=1.000 n=10) ¹
geomean                                     2.470Ki        2.470Ki       +0.00%
¹ all samples are equal

                                  │ bench-prev/bench.txt │              bench.txt              │
                                  │      allocs/op       │ allocs/op   vs base                 │
ComputeSignatureHashes_1Input-4               18.00 ± 0%   18.00 ± 0%       ~ (p=1.000 n=10) ¹
ComputeSignatureHashes_5Inputs-4              72.00 ± 0%   72.00 ± 0%       ~ (p=1.000 n=10) ¹
ComputeSignatureHashes_20Inputs-4             270.0 ± 0%   270.0 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                       70.47        70.47       +0.00%
¹ all samples are equal

pkg: github.com/keep-network/keep-core/pkg/bls
                     │ bench-prev/bench.txt │             bench.txt              │
                     │        sec/op        │   sec/op     vs base               │
Sign-4                          197.4µ ± 1%   196.2µ ± 1%  -0.63% (p=0.035 n=10)
Verify-4                        1.986m ± 1%   1.979m ± 0%       ~ (p=0.436 n=10)
AggregateBLS/N=10-4             1.889m ± 0%   1.891m ± 0%  +0.14% (p=0.000 n=10)
AggregateBLS/N=50-4             1.985m ± 0%   1.990m ± 0%  +0.26% (p=0.019 n=10)
AggregateBLS/N=100-4            2.107m ± 0%   2.109m ± 0%       ~ (p=0.143 n=10)
ThresholdVerify-4               3.222m ± 0%   3.206m ± 0%  -0.50% (p=0.003 n=10)
geomean                         1.467m        1.465m       -0.17%

                     │ bench-prev/bench.txt │               bench.txt               │
                     │         B/op         │     B/op      vs base                 │
Sign-4                         14.21Ki ± 0%   14.21Ki ± 0%       ~ (p=1.000 n=10) ¹
Verify-4                       95.31Ki ± 0%   95.31Ki ± 0%       ~ (p=0.810 n=10)
AggregateBLS/N=10-4            82.36Ki ± 0%   82.36Ki ± 0%       ~ (p=1.000 n=10) ¹
AggregateBLS/N=50-4            82.36Ki ± 0%   82.36Ki ± 0%       ~ (p=1.000 n=10) ¹
AggregateBLS/N=100-4           82.36Ki ± 0%   82.36Ki ± 0%       ~ (p=1.000 n=10) ¹
ThresholdVerify-4              362.8Ki ± 0%   362.8Ki ± 0%       ~ (p=0.948 n=10)
geomean                        80.61Ki        80.61Ki       +0.00%
¹ all samples are equal

                     │ bench-prev/bench.txt │              bench.txt               │
                     │      allocs/op       │  allocs/op   vs base                 │
Sign-4                           712.0 ± 0%    712.0 ± 0%       ~ (p=1.000 n=10) ¹
Verify-4                        1.453k ± 0%   1.453k ± 0%       ~ (p=1.000 n=10) ¹
AggregateBLS/N=10-4              764.0 ± 0%    764.0 ± 0%       ~ (p=1.000 n=10) ¹
AggregateBLS/N=50-4              764.0 ± 0%    764.0 ± 0%       ~ (p=1.000 n=10) ¹
AggregateBLS/N=100-4             764.0 ± 0%    764.0 ± 0%       ~ (p=1.000 n=10) ¹
ThresholdVerify-4               9.204k ± 0%   9.204k ± 0%       ~ (p=1.000 n=10) ¹
geomean                         1.273k        1.273k       +0.00%
¹ all samples are equal

                  │ bench-prev/bench.txt │             bench.txt              │
                  │      p50-sec/op      │ p50-sec/op   vs base               │
ThresholdVerify-4            3.179m ± 0%   3.166m ± 0%  -0.40% (p=0.000 n=10)

                  │ bench-prev/bench.txt │           bench.txt           │
                  │      p95-sec/op      │ p95-sec/op   vs base          │
ThresholdVerify-4            3.508m ± 1%   3.500m ± 1%  ~ (p=0.796 n=10)

                  │ bench-prev/bench.txt │           bench.txt           │
                  │      p99-sec/op      │ p99-sec/op   vs base          │
ThresholdVerify-4            3.692m ± 3%   3.654m ± 1%  ~ (p=0.063 n=10)

pkg: github.com/keep-network/keep-core/pkg/net/libp2p
                               │ bench-prev/bench.txt │             bench.txt              │
                               │        sec/op        │   sec/op     vs base               │
ChannelDeliver_SingleHandler-4            35.71n ± 3%   35.86n ± 2%       ~ (p=0.239 n=10)
ChannelDeliver_10Handlers-4               156.1n ± 0%   156.1n ± 0%       ~ (p=0.864 n=10)
ProcessPubsubMessage-4                    276.2n ± 0%   274.3n ± 0%  -0.69% (p=0.000 n=10)
geomean                                   115.5n        115.4n       -0.10%

                               │ bench-prev/bench.txt │              bench.txt              │
                               │         B/op         │    B/op     vs base                 │
ChannelDeliver_SingleHandler-4             8.000 ± 0%   8.000 ± 0%       ~ (p=1.000 n=10) ¹
ChannelDeliver_10Handlers-4                80.00 ± 0%   80.00 ± 0%       ~ (p=1.000 n=10) ¹
ProcessPubsubMessage-4                     192.0 ± 0%   192.0 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                    49.72        49.72       +0.00%
¹ all samples are equal

                               │ bench-prev/bench.txt │              bench.txt              │
                               │      allocs/op       │ allocs/op   vs base                 │
ChannelDeliver_SingleHandler-4             1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
ChannelDeliver_10Handlers-4                1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
ProcessPubsubMessage-4                     3.000 ± 0%   3.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                    1.442        1.442       +0.00%
¹ all samples are equal

pkg: github.com/keep-network/keep-core/pkg/net/retransmission
                       │ bench-prev/bench.txt │              bench.txt              │
                       │        sec/op        │    sec/op     vs base               │
BackoffStrategyTick-4             5.296n ± 0%    5.260n ± 1%  -0.70% (p=0.009 n=10)
StandardStrategyTick-4           0.6241n ± 0%   0.6248n ± 0%  +0.11% (p=0.022 n=10)
geomean                           1.818n         1.813n       -0.29%

                       │ bench-prev/bench.txt │              bench.txt              │
                       │         B/op         │    B/op     vs base                 │
BackoffStrategyTick-4            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
StandardStrategyTick-4           0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                     ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                       │ bench-prev/bench.txt │              bench.txt              │
                       │      allocs/op       │ allocs/op   vs base                 │
BackoffStrategyTick-4            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
StandardStrategyTick-4           0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                     ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/keep-network/keep-core/pkg/tbtc
                                │ bench-prev/bench.txt │             bench.txt              │
                                │        sec/op        │   sec/op     vs base               │
GetRecentWindows_100Windows-4              69.41µ ± 1%   69.35µ ± 1%       ~ (p=0.190 n=10)
GetRecentWindows_1000Windows-4             804.8µ ± 1%   813.0µ ± 1%       ~ (p=0.089 n=10)
GetSummary_100Windows-4                    63.03µ ± 1%   62.61µ ± 0%  -0.66% (p=0.000 n=10)
GetSummary_1000Windows-4                   721.4µ ± 1%   717.2µ ± 2%       ~ (p=0.315 n=10)
CleanupOldWindows_1000Windows-4            104.0µ ± 1%   103.7µ ± 1%       ~ (p=0.315 n=10)
geomean                                    192.5µ        192.3µ       -0.11%

                                │ bench-prev/bench.txt │               bench.txt               │
                                │         B/op         │     B/op      vs base                 │
GetRecentWindows_100Windows-4             90.87Ki ± 0%   90.87Ki ± 0%       ~ (p=1.000 n=10) ¹
GetRecentWindows_1000Windows-4            906.7Ki ± 0%   906.7Ki ± 0%       ~ (p=0.885 n=10)
GetSummary_100Windows-4                   89.94Ki ± 0%   89.94Ki ± 0%       ~ (p=1.000 n=10) ¹
GetSummary_1000Windows-4                  898.6Ki ± 0%   898.6Ki ± 0%       ~ (p=0.965 n=10)
CleanupOldWindows_1000Windows-4           8.055Ki ± 0%   8.055Ki ± 0%       ~ (p=1.000 n=10) ¹
geomean                                   139.9Ki        139.9Ki       +0.00%
¹ all samples are equal

                                │ bench-prev/bench.txt │              bench.txt               │
                                │      allocs/op       │  allocs/op   vs base                 │
GetRecentWindows_100Windows-4               804.0 ± 0%    804.0 ± 0%       ~ (p=1.000 n=10) ¹
GetRecentWindows_1000Windows-4             8.004k ± 0%   8.004k ± 0%       ~ (p=1.000 n=10) ¹
GetSummary_100Windows-4                     801.0 ± 0%    801.0 ± 0%       ~ (p=1.000 n=10) ¹
GetSummary_1000Windows-4                   8.001k ± 0%   8.001k ± 0%       ~ (p=1.000 n=10) ¹
CleanupOldWindows_1000Windows-4             3.000 ± 0%    3.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                     658.4         658.4       +0.00%
¹ all samples are equal

pkg: github.com/keep-network/keep-core/pkg/tecdsa/dkg
                                             │ bench-prev/bench.txt │             bench.txt              │
                                             │        sec/op        │   sec/op     vs base               │
MarshalEphemeralPublicKeyMessage-4                      1.114µ ± 1%   1.116µ ± 2%       ~ (p=0.268 n=10)
UnmarshalEphemeralPublicKeyMessage-4                    1.176µ ± 0%   1.173µ ± 0%  -0.30% (p=0.004 n=10)
MarshalEphemeralPublicKeyMessage_100Keys-4              29.18µ ± 1%   29.30µ ± 0%  +0.42% (p=0.041 n=10)
UnmarshalEphemeralPublicKeyMessage_100Keys-4            37.48µ ± 1%   37.38µ ± 1%       ~ (p=0.060 n=10)
RoundTripDKGMessage-4                                   2.446µ ± 1%   2.440µ ± 0%       ~ (p=0.148 n=10)
geomean                                                 5.116µ        5.113µ       -0.06%

                                             │ bench-prev/bench.txt │               bench.txt               │
                                             │         B/op         │     B/op      vs base                 │
MarshalEphemeralPublicKeyMessage-4                       624.0 ± 0%     624.0 ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalEphemeralPublicKeyMessage-4                     917.0 ± 0%     917.0 ± 0%       ~ (p=1.000 n=10) ¹
MarshalEphemeralPublicKeyMessage_100Keys-4             14.33Ki ± 0%   14.33Ki ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalEphemeralPublicKeyMessage_100Keys-4           21.42Ki ± 0%   21.42Ki ± 0%       ~ (p=1.000 n=10) ¹
RoundTripDKGMessage-4                                  1.422Ki ± 0%   1.422Ki ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                2.988Ki        2.988Ki       +0.00%
¹ all samples are equal

                                             │ bench-prev/bench.txt │              bench.txt              │
                                             │      allocs/op       │ allocs/op   vs base                 │
MarshalEphemeralPublicKeyMessage-4                       12.00 ± 0%   12.00 ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalEphemeralPublicKeyMessage-4                     12.00 ± 0%   12.00 ± 0%       ~ (p=1.000 n=10) ¹
MarshalEphemeralPublicKeyMessage_100Keys-4               402.0 ± 0%   402.0 ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalEphemeralPublicKeyMessage_100Keys-4             314.0 ± 0%   314.0 ± 0%       ~ (p=1.000 n=10) ¹
RoundTripDKGMessage-4                                    25.00 ± 0%   25.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                  53.89        53.89       +0.00%
¹ all samples are equal

pkg: github.com/keep-network/keep-core/pkg/tecdsa/signing
                                             │ bench-prev/bench.txt │             bench.txt              │
                                             │        sec/op        │   sec/op     vs base               │
MarshalEphemeralPublicKeyMessage-4                      1.117µ ± 1%   1.120µ ± 0%       ~ (p=0.253 n=10)
UnmarshalEphemeralPublicKeyMessage-4                    1.188µ ± 0%   1.187µ ± 1%       ~ (p=0.782 n=10)
MarshalEphemeralPublicKeyMessage_100Keys-4              28.71µ ± 0%   28.75µ ± 0%       ~ (p=0.148 n=10)
UnmarshalEphemeralPublicKeyMessage_100Keys-4            37.37µ ± 0%   37.15µ ± 1%  -0.60% (p=0.003 n=10)
MarshalSigningShareMessage-4                            1.112µ ± 0%   1.110µ ± 0%       ~ (p=0.063 n=10)
UnmarshalSigningShareMessage-4                          1.188µ ± 0%   1.181µ ± 0%  -0.59% (p=0.000 n=10)
RoundTripEphemeralKey-4                                 2.458µ ± 0%   2.451µ ± 0%  -0.31% (p=0.015 n=10)
geomean                                                 3.338µ        3.332µ       -0.19%

                                             │ bench-prev/bench.txt │               bench.txt               │
                                             │         B/op         │     B/op      vs base                 │
MarshalEphemeralPublicKeyMessage-4                       624.0 ± 0%     624.0 ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalEphemeralPublicKeyMessage-4                     917.0 ± 0%     917.0 ± 0%       ~ (p=1.000 n=10) ¹
MarshalEphemeralPublicKeyMessage_100Keys-4             14.33Ki ± 0%   14.33Ki ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalEphemeralPublicKeyMessage_100Keys-4           21.42Ki ± 0%   21.42Ki ± 0%       ~ (p=1.000 n=10) ¹
MarshalSigningShareMessage-4                             592.0 ± 0%     592.0 ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalSigningShareMessage-4                           864.0 ± 0%     864.0 ± 0%       ~ (p=1.000 n=10) ¹
RoundTripEphemeralKey-4                                1.505Ki ± 0%   1.505Ki ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                1.989Ki        1.989Ki       +0.00%
¹ all samples are equal

                                             │ bench-prev/bench.txt │              bench.txt              │
                                             │      allocs/op       │ allocs/op   vs base                 │
MarshalEphemeralPublicKeyMessage-4                       12.00 ± 0%   12.00 ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalEphemeralPublicKeyMessage-4                     12.00 ± 0%   12.00 ± 0%       ~ (p=1.000 n=10) ¹
MarshalEphemeralPublicKeyMessage_100Keys-4               402.0 ± 0%   402.0 ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalEphemeralPublicKeyMessage_100Keys-4             314.0 ± 0%   314.0 ± 0%       ~ (p=1.000 n=10) ¹
MarshalSigningShareMessage-4                             12.00 ± 0%   12.00 ± 0%       ~ (p=1.000 n=10) ¹
UnmarshalSigningShareMessage-4                           13.00 ± 0%   13.00 ± 0%       ~ (p=1.000 n=10) ¹
RoundTripEphemeralKey-4                                  24.00 ± 0%   24.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                  35.28        35.28       +0.00%
¹ all samples are equal

@piotr-roslaniec
piotr-roslaniec merged commit bc4a10e into dev Sep 25, 2026
38 checks passed
@piotr-roslaniec
piotr-roslaniec deleted the fix/pr-4256-review-findings branch September 25, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant