Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Stratum Proxy Logs

This page explains the log lines the stratum proxy writes and what to do about them. Most of it covers connections and encryption. Those lines show whether miners and the pool can reach the proxy, and they are where tampering or interception shows up.

Many of the same lines are also written when the network is unreliable, so this page gives the ordinary causes and the suspicious causes for each one, and tells you how to tell them apart.


Log format

Each log line is one JSON object:

{"timestamp":"2026-12-01T14:03:22.418Z","level":"INFO","event":"Incoming connection","fields":{"ip":"10.0.4.17","port":51544},"target":"[SV2/svr_core/src/core/session_management.rs:77]"}
FieldMeaning
timestampUTC time of the event.
levelDEBUG, INFO, WARN or ERROR. DEBUG and INFO lines go to stdout. WARN and ERROR lines go to stderr. Lines below [logger] log_level are not written.
eventWhat happened. Search and alert on this field. The event names on this page are exact.
fieldsDetails. Field names vary by event.
targetThe source location that wrote the line. Include it when you report a problem to us.

Common fields

FieldMeaning
identityThe miner connection the line is about: connection_id, protocol (Sv1 or Sv2), and, once known, ip, channel_id, subaccount, worker_name and user_agent (firmware).
connection_idA number the proxy assigns to each miner connection. Use it to follow one connection through the log.
reasonWhy a connection or request ended. On socket closed this is the name of the error that closed it.
errorThe underlying error text.

The (Critical) and (Non-Critical) prefixes

Many error values begin with (Critical) or (Non-Critical). Pool connection errors can carry both, for example (Non-Critical) (Critical) Aead Error. These prefixes show how the proxy handled the error internally. They are not a severity rating for you. Use the level field and the guidance on this page instead.


How the proxy’s encryption works

Knowing what the encryption protects makes the encryption log lines much easier to read.

Stratum V2 connections are encrypted and authenticated with the Noise protocol. Every connection begins with a handshake. In the handshake, the server proves who it is by presenting a certificate signed with its authority key. The client checks that certificate against the authority public key it was configured with. After the handshake, every message is encrypted and carries an authentication tag. If anything changes, adds, removes or reorders bytes in transit, the receiver cannot decrypt the message and the connection is closed.

There are two encrypted links, and on each one only one side is the server:

LinkServer (presents the certificate)Client (checks the certificate)Who detects an impostor
Proxy → poolThe poolThe proxy, using authority_pubkey in [[upstream.endpoints]]The proxy, which logs it.
Miner → proxyThe proxy, using authority_public_key / authority_secret_key in [network]The miner, using the proxy public key you configured on itThe miner, which logs it in its own logs. The proxy only sees the connection close.

Four consequences follow from this:

  1. Only servers are authenticated. The handshake proves the pool’s identity to the proxy and the proxy’s identity to miners. It does not prove a miner’s identity to the proxy. The proxy identifies miners by the user name they authorize with, not cryptographically.
  2. Configure every SV2 miner with the proxy’s authority public key. Some firmware can connect without one. That connection is still encrypted, but the miner cannot tell the real proxy from an impostor, so an interceptor goes undetected.
  3. Clocks matter. The server signs a fresh certificate for every handshake, valid from that moment (valid_from) until not_valid_after. For the proxy’s own certificate that is one hour later (cert_validity_secs). The client allows 10 seconds of clock difference at each end. As a result, a client whose clock is more than 10 seconds behind the server rejects a genuine certificate, because it appears not yet valid. A client whose clock is ahead is accepted until it is more than the validity period (plus 10 seconds) ahead. Run NTP on the proxy host and on your miners.
  4. Stratum V1 has no encryption and no authentication. Nothing on the SV1 port (listen_port_sv1) can detect tampering or interception, so no log line will report it. Use SV2, or keep SV1 miners on a network you trust.

Ordinary network faults such as packet loss, a dropped Wi-Fi link or a rebooted switch do not cause decryption failures. TCP retransmits lost data and discards corrupted packets before the proxy sees them. Network faults show up as timeouts, resets and closed connections. A decryption or certificate failure has a short list of causes: misconfiguration, a wrong clock, a device that is not speaking SV2, or someone altering the traffic.


Pool connection (upstream)

Normal sequence

When the proxy starts, and after every reconnect, it logs:

  1. Connecting to upstream pool (address, endpoint_index)
  2. Upstream SetupConnection success
  3. Upstream channel opened (channel_id, extranonce_size, proxy_difficulty)

From then on it logs Dispatching upstream job downstream for every job the pool sends.

When the pool connection ends

Every time the pool connection ends, the proxy logs these lines:

EventLevelMeaning
Upstream connection endedERRORThe connection to the pool failed or was lost. error gives the reason. See the table below. consecutive_failures counts failures since the pool last sent work.
upstream disconnected: dropped all downstream connections and cleared job cacheWARNWithout a pool connection the proxy cannot give miners valid work, so it disconnects all of them. connections_dropped is how many. Miners reconnect once the pool channel is open again.
Failing over to next upstream endpointWARNfailover_threshold consecutive failures were reached, so the proxy is moving to the next [[upstream.endpoints]] entry (next_index, endpoint).
Rejecting new connection: no upstream connectionINFOA miner tried to connect while the pool connection was down and was turned away (ip, port). You will see many of these during a pool outage. That is expected.

The proxy retries with exponential backoff, waiting between 0.5 and 30 seconds between attempts.

Reading the error on Upstream connection ended

Look for the text in the first column inside error.

Before encryption: TCP connection

error containsMeaningOrdinary causesSuspicious causes / action
Connection refusedNothing is listening at address.Pool endpoint down or restarting, or a wrong port.Check address.
failed to lookup address informationDNS could not resolve the pool host name.DNS outage, or a typo in address.If the name resolves to an unexpected IP when it does work, investigate DNS.
Connection timed out, No route to host, Network is unreachableThe proxy cannot reach the pool.Internet outage, routing problem, or an egress firewall.—

During the encryption handshake

error containsMeaningOrdinary causesSuspicious causes / action
Failed to read upstream handshake reply: Timed out after 10sThe pool accepted the TCP connection but did not answer the handshake within 10 seconds.Wrong port (for example the pool’s SV1 port, which waits silently for a text line). Heavy packet loss. An overloaded pool.Firewalls that inspect traffic sometimes stall or drop mining traffic. If this happens only from one network, test from another.
Failed to read upstream handshake reply: Connection reset by peer / Connection closed during the handshakeThe pool side closed the connection during the handshake.Pool restart, a load balancer draining, wrong port, or a firewall that resets mining traffic.—
Initiator step_2 failed: Invalid Certificate: SignatureNoiseMessage { version: …, valid_from: …, not_valid_after: …, signature: … }The pool’s certificate was rejected. Either it was not signed by the key in authority_pubkey, or it is outside its validity window.A wrong or outdated authority_pubkey, or an address that points at a different server. Clock error on the proxy host.Someone presenting their own certificate in place of the pool’s (interception). See Diagnosing Invalid Certificate. The proxy does not connect, so no work or shares go through the impostor.
Initiator step_2 failed: Noise SV2 Error: Aead(Error)The pool’s handshake reply could not be decrypted.The endpoint is not an SV2 pool.Handshake bytes altered in transit. Investigate if address is definitely the pool’s SV2 port.
Invalid handshake reply sizeThe reply was not a valid SV2 handshake message.The endpoint is not an SV2 pool.Same as above.
Diagnosing Invalid Certificate from the pool

valid_from and not_valid_after are Unix timestamps in seconds. Convert them, for example with date -u -d @1796135745, and compare them with the line’s timestamp:

  • timestamp is more than 10 seconds before valid_from: the proxy’s clock is behind the pool’s. timestamp is more than 10 seconds after not_valid_after: the proxy’s clock is ahead. Either way it is a clock problem, not an attack. Fix NTP on the proxy host.
  • timestamp falls inside the window: the certificate’s signature does not match the key you configured.
    • If you recently changed authority_pubkey or address, it is almost certainly a configuration mistake. Re-copy the key the pool gave you, and check that the address is that pool’s SV2 endpoint.
    • If nothing changed, and an endpoint that used to work suddenly fails this way, treat it as possible interception. Check what IP the pool host name resolves to, check for transparent proxies or new network equipment on the path, and contact the pool operator. Do not work around it by changing authority_pubkey to make the error go away.

After the connection is set up

error containsMeaningOrdinary causesSuspicious causes / action
(Critical) secure stream closed by peerThe pool closed the connection.Pool restart or deployment, or a load balancer timeout.—
(Critical) Connection reset by peer, Connection timed out, Broken pipeThe connection broke at the network level.Network interruption, NAT or firewall state expiry, or pool restart.—
(Critical) Aead Error: `Error`A message from the pool failed decryption. The bytes were not produced by the pool with this connection’s keys.Very unlikely from ordinary network problems (see above). Possibly a faulty middlebox.Traffic injected or altered between the proxy and the pool. A single occurrence is worth noting. Repeated occurrences need investigating: look at the network path between the proxy and the pool. The connection is dropped, so no altered message is acted on.
timed out waiting for setup connection success / timed out waiting for channel open success, or deadline has elapsedThe pool did not answer the setup or channel-open request within 30 seconds.Pool overloaded or unhealthy.—
… since last job, limit …The stale-work watchdog fired: no new work arrived within max_job_delay_secs.Pool stalled. If the pool sends work only on new blocks, max_job_delay_secs is set too low for it (see the configuration reference).—
An error code from the pool, for example unknown-userThe pool refused the connection setup or the channel open.A wrong user_identity, or account not enabled for proxy use.Contact the pool.
granted N != requested 8The pool offered a different extranonce size than the proxy requires.Pool not compatible with this proxy.Contact the pool.

Other pool messages

EventLevelMeaning
Upstream SetTargetINFOThe pool changed the proxy’s channel difficulty (proxy_difficulty).
Upstream rotated extranonce prefixINFOThe pool assigned a new extranonce prefix. Normal.
Upstream rejected shareWARNThe pool rejected a share the proxy forwarded. error is the pool’s reason code, such as a stale share. An occasional rejection around block changes is normal. A steady stream is not normal and should be reported to the pool.
Ignoring unexpected upstream mining messageWARNThe pool sent a message the proxy does not use. Harmless. Report it if frequent.
Active NewExtendedMiningJob before any SetNewPrevHash; ignoring jobWARNThe pool sent a job before the block it builds on. That job is skipped. Harmless unless frequent.
failed to build upstream message, dropping itERROROne share or update could not be encoded and was dropped. The connection stays up. Report it to us.
Upstream outbound channel closed; stopping connection managerINFOPart of shutdown.

Miner connections (downstream)

Normal sequence

For a connection on the SV2 port:

  1. Incoming connection (ip, port)
  2. The encryption handshake. It is not logged when it succeeds.
  3. subscribe success. The miner’s SetupConnection was accepted.
  4. authorize success. The miner opened a mining channel (identity now includes subaccount and worker_name).

For a connection on the SV1 port there is no handshake. subscribe success follows mining.subscribe, and authorize success follows mining.authorize.

Every miner connection that gets past the handshake ends with exactly one socket closed line (INFO). Its reason says why, and its identity says which miner it was. A connection that fails during the handshake ends with Failed to initialize client session instead.

Matching lines for one connection. Incoming connection has the ip but no connection_id. Failed to initialize client session has the connection_id but no ip. Match them by time. socket closed includes both.

Failed to initialize client session (WARN): handshake failures

The connection was closed before the encryption handshake finished. Look for the text in the first column inside error.

error containsMeaningOrdinary causesSuspicious causes / action
Failed to read first handshake message: Connection closed during the handshakeSomething opened a TCP connection and closed it without starting a handshake.Load balancer or uptime-monitor health checks (often at a fixed interval from the same IP). Miners giving up on a slow connection.Port scanning. Many of these from IPs that are not yours means the port is reachable from places it should not be. Restrict it with a firewall.
Failed to read first handshake message: Timed out after 10sSomething connected and then sent too little to start a handshake within 10 seconds.A badly congested link. A non-SV2 client on the SV2 port that sent a short message.Scanners, or clients deliberately holding connections open. Restrict the port if the IPs are not yours.
Failed to read first handshake message: Connection reset by peerThe client reset the connection before the handshake.Miner reboot, network interruption.—
Failed to write second handshake message to streamThe client disappeared during the handshake.Network interruption, miner reboot.—

socket closed (INFO): why a miner connection ended

Read reason first, then error.

reasonMeaningOrdinary causesSuspicious causes / action
secure stream closed by peerThe miner closed the connection.Miner reboot, pool switch, or firmware reconnect.If it comes immediately after the handshake (no subscribe success between Incoming connection and socket closed), the miner probably rejected the proxy’s certificate. Check the miner’s own logs. Ordinary causes: the miner is configured with the wrong proxy public key, or the miner’s clock is more than 10 seconds behind the proxy’s. If neither applies, something between that miner and the proxy may be intercepting the connection. See Recognising tampering and interception.
failed to decode encrypted frame (error contains Aead Error)A message from the miner failed decryption. It was not produced with this connection’s keys.A device that is not speaking SV2 encryption on the SV2 port (for example an SV1 miner pointed at the SV2 port, or an SV2 client with encryption disabled). Faulty firmware. Packet loss does not cause this.Traffic injected or altered between that miner and the proxy. If it is always the same ip, check that device’s configuration first. If it suddenly affects many miners at once, especially after a network change, inspect the network path. The connection is dropped, so no altered message is acted on.
secure stream read after a failed decodeFollows a decode failure on the same connection.—Treat it like failed to decode encrypted frame.
failed to buffer secure stream bytesInternal buffering error on an encrypted connection.—Report it to us with the full line.

Network and timeout reasons

reasonMeaningOrdinary causesAction
error while reading secure stream buffer (SV2) / failed to read plaintext TCP buffer (SV1)The connection broke at the network level. error gives the OS reason: Connection reset by peer, Connection timed out, No route to host…Network interruption, a miner power-cycle, NAT or firewall state expiry.Only investigate if it is frequent for many miners at once.
Sv1 connection closed by peer (EOF)An SV1 miner closed the connection.Miner reboot or reconnect.—
client timeoutThe miner sent nothing for tcp_read_timeout_secs.Miner hung, powered off without closing, or its network path is gone.—
unauthorized timeoutThe miner connected but did not authorize within 30 seconds.A miner on the wrong port (for example SV1 firmware on the SV2 port). A miner stuck mid-setup.Check the miner’s pool URL and port. Many from unknown IPs means scanning.
graceful shutdownThe proxy closed the connection on purpose, for example during shutdown.——

Protocol reasons

These mean the client completed the encryption handshake, so it had valid keys, but then broke the protocol. They point to a misbehaving or incompatible client, not to tampering in transit.

reason / eventMeaningAction
Sv2 message before SetupConnection (also logged as Sv2 message before SetupConnection, closing connection, with msg_type)The client skipped the required first message.Check the firmware’s SV2 support.
Sv2 SetupConnection with unknown protocol, closing connectionThe client asked for a protocol the proxy does not serve.Point it at a mining endpoint.
Failed to parse Sv1 JSON messageAn SV1 line was not valid JSON. error quotes the start of it. If that looks like binary data, an SV2 miner is connected to the SV1 port.Fix the miner’s port.
plaintext message too largeAn SV1 line exceeded 16 KiB without a newline.Wrong client, or abuse.
client errorAnother error. See error.Report it to us if frequent.

Connections the proxy drops

EventLevelMeaning
dropping Sv2 connection: write failed / dropping Sv1 connection: write failedWARN / INFOSending to the miner failed. The connection was already broken.
dropping Sv2 connection: write did not complete (backpressure) / dropping Sv1 connection: write did not complete (backpressure)WARN / INFOThe miner was not reading fast enough to keep up with new jobs, so the proxy disconnected it rather than send it stale work. Usually a slow or congested link to that miner.
TCP write buffer full, dropping connection...WARNSame as backpressure.
dropping failed Sv2 writers due to failed job dispatch / dropping failed Sv1 writers due to failed job dispatchERRORSummary after a job broadcast: count connections could not be sent the job and were dropped. A few are normal. A large count means a network problem on the miner side.
Encryption state corrupted, dropping writerERRORAn internal encryption error on the sending side for one connection. This should not happen. Report it to us with the full line.

Recognising tampering and interception

Use the patterns below. Any one line on its own has ordinary explanations. Patterns are what matter.

What you seeMost likelyInvestigate as a security issue when…
Upstream connection ended with Invalid CertificateWrong authority_pubkey, or clock skew on the proxy hostThe certificate’s validity window covers the log time, the configuration has not changed, and the same endpoint worked before.
Upstream connection ended with (Critical) Aead ErrorInterference on the proxy–pool pathAlways worth noting. It is not caused by ordinary packet loss.
socket closed with failed to decode encrypted frame from one miner IPThat device is misconfigured or not speaking SV2Many miners are affected at the same time, or a device that worked before starts doing it.
socket closed, reason secure stream closed by peer, immediately after connecting, with no subscribe successThe miner rejected the proxy’s certificate (wrong key on the miner, or the miner’s clock)The miner’s logs show a certificate error and its key and clock are correct. Something on the path may be impersonating the proxy.
Many Failed to initialize client session lines from IPs that are not yoursPort scanningThe proxy’s ports are reachable from the internet and should not be.
Timeouts, resets and closed by peer that clear up on their ownNetwork instabilityThey come with certificate or decryption errors.

If you suspect interception:

  1. Do not “fix” it by changing the configured authority keys until you know why the certificate stopped matching.
  2. Keep the full log lines, including timestamp, ip and error.
  3. Check DNS resolution of the pool address, and any proxies, VPNs or new network equipment on the path.
  4. Contact the pool operator with the lines.

The proxy always disconnects when a certificate or decryption check fails. Unverified traffic never reaches the pool or your miners.


Miner sessions, jobs and shares

Session setup

EventLevelMeaning
subscribe successINFOSV2: SetupConnection accepted (version, flags). SV1: mining.subscribe accepted.
authorize successINFOThe miner opened a mining channel. identity has its subaccount, worker_name and user_agent.
authorize failureWARNAuthorization was refused. reason gives the cause (see below). name (and on SV1, password) is what the miner sent, with unusual characters removed.
Subscribed connection still unauthorized after a vardiff check intervalWARNThe miner subscribed but has not authorized yet. If it does not, it ends with unauthorized timeout.
Standard jobs requested, but only extended jobs are supportedWARNThe SV2 miner asked for standard jobs. The proxy serves only extended channels. Firmware incompatibility.
Work selection requested, but not supportedWARNThe SV2 miner asked to choose its own transactions. Not supported.
Received OpenStandardMiningChannel message, but standard channels are not supported yetWARNSame incompatibility as above.
group channels unsupported, Unimplemented function, Received SetCustomMiningJob message, but custom jobs are not supported yet, Received SubmitSharesStandard message, but standard shares are not supported yetWARNThe miner used an SV2 feature the proxy does not support.
failed to parse Sv1 messageWARNAn SV1 request had an unknown method or bad parameters. The connection stays open.
Failed to handle message: …WARNAn SV1 request could not be processed. error and message give details.

authorize failure reasons:

reasonMeaning
not-subscribedSV1 mining.authorize was sent before mining.subscribe.
empty-user-nameThe user name was empty after unusual characters were removed.
invalid-min-extranonce-sizeSV2: the miner requires more extranonce space than the proxy offers.
max-target-out-of-rangeSV2: the miner will not accept a difficulty as high as the proxy’s minimum.

Difficulty, jobs and shares

EventLevelMeaning
vardiff difficulty changeINFOA miner’s difficulty changed (old_difficulty, new_difficulty). Normal.
new job arrived, dispatched job, Dispatching upstream job downstreamINFOWork flowing from the pool to miners. Normal, once per job.
unclean job changes prevhash; dispatching as clean to Sv2INFOA job built on a new block was sent to SV2 miners as a clean job. Normal.
no buffered job to dispatchINFOA dispatch tick found no new work. Normal.
high diff shareINFOA miner found a share well above its difficulty.
block foundINFOA share met the network target (height, block_hash).
share.ntime == 0, overriding to job.ntimeWARNA miner submitted a share without a timestamp. The job’s timestamp was used. A firmware quirk.
invalid-channel-idERRORA miner sent a request for a channel it does not have. Firmware bug or desynchronised miner.
dropping difficulty update for a channel the write loop never addedWARNInternal timing during connection teardown. Harmless if occasional.

DEBUG-level lines (invalid shares, difficulty computation, per-message tracing) are written only with log_level = "DEBUG". Use that level for troubleshooting, not in normal operation.


Startup, shutdown and configuration

EventLevelMeaning
Listening on TCPINFOA miner listener is up (address). One per enabled port.
starting health check listenerINFOThe [health] endpoint is starting.
failed to bind health check listener / health check accept failedERRORThe health port could not be opened (usually already in use), or a health-check connection failed. Mining is not affected.
Sv1 server task ended / Sv2 server task endedERRORA miner listener stopped. Usually the port is already in use or cannot be bound. The proxy shuts down.
task exited, shutting down...ERRORA core task stopped (task, and panicked if it crashed). The proxy shuts down. Report a crash to us.
Critical error detected, shutting down server / Critical shutdown signal received, shutting down...ERROR / INFOAn unrecoverable internal error. Report it to us with the lines before it.
Critical error in CoreWriteLoop, Write loop terminatedWARNThe component that sends to miners stopped. Report it to us with the lines before it.
Received SIGTERM, shutting down... / Received SIGINT, shutting down...INFONormal stop requested by you or your orchestrator.
Server has stoppedINFOShutdown finished.
task did not stop after abort / client sessions did not stopERRORShutdown did not finish cleanly. The process still exits.
Failed to parse <VARIABLE>, using None, Failed to parse environment variable…, Unknown environment variableERRORA configuration override from the environment was ignored. Check the variable’s value.
Skipping upstream endpoint …ERRORAn upstream endpoint given through the environment was invalid and skipped.

Embedding the proxy as a library

These lines appear only when the proxy runs inside another program that receives its events. The standalone binary never writes them.

EventLevelMeaning
proxy event sink is full, dropping events until it drainsWARNThe embedding program is not reading events fast enough. Events are dropped until it catches up.
proxy event sink has room againINFOEvents are being delivered again.