Skip to content

chore(deps): bump vendored nbio to v1.6.11 (and llib to v1.2.3)#40

Open
moralpriest wants to merge 2 commits into
DEROFDN:community-devfrom
moralpriest:chore/deps/nbio-v1.6.11
Open

chore(deps): bump vendored nbio to v1.6.11 (and llib to v1.2.3)#40
moralpriest wants to merge 2 commits into
DEROFDN:community-devfrom
moralpriest:chore/deps/nbio-v1.6.11

Conversation

@moralpriest

Copy link
Copy Markdown

Summary

Prep work for a future Go toolchain bump: upgrade the vendored nbio
(mining/getwork websocket server) from the community-dev-pinned version to
v1.6.11.

nbio v1.6.11's nbhttp code imports lesismal/llib/std/crypto/tls, so
llib is bumped in lockstep from ~v1.1.4 to v1.2.3.

Consumer changes — cmd/derod/rpc/websocket_getwork_server.go

nbio v1.6.11 changed two APIs the daemon uses:

  • websocket.Conn is now a concrete type (was an interface) → dropped the
    conn.(*websocket.Conn) assertion.
  • OnReadBufferAlloc / OnReadBufferFree callbacks now take *[]byte
    (matching nbio v1.6.11's Allocator API) → updated the mempool
    callbacks accordingly.

No change to daemon getwork behavior or protocol.

Vendored upstream fix

llib v1.2.3 has a nil-pointer panic in non-blocking TLS mode: its deferred
conn.close dereferences c.rawInput without a nil check. nbio v1.6.11 forces
TLS on the server, so this path is always hit. Applied a one-line nil-guard at
vendor/github.com/lesismal/llib/std/crypto/tls/conn.go:
if c.rawInput != nil && len(*c.rawInput) == c.rawInputOff { ... }.

Tests

  • cmd/derod/rpc/nbio_websocket_test.go — Go unit test exercising a real
    nbhttp server (HTTP→websocket upgrade, echo round-trip, connection
    lifecycle, TLS handshake through the llib fix). Passes.
  • tests/normal/nbio_getwork_test/run_test.sh — boots a real derod --testnet
    (which starts the getwork server on nbio) and a real dero-miner
    (gorilla/websocket client); verifies the miner connects and receives work
    with no Error connecting. Passes.

Scope notes

  • go.mod stays at go 1.17 — this is prep only, no toolchain bump.
  • Pure vendored source swap (community-dev convention: no go.mod requires,
    no vendor/modules.txt, no go.sum).
  • The simulator-based run_integration_test.sh suite does not exercise the
    getwork/nbio path, so it is out of scope; the change is isolated to the
    getwork server and its vendored deps.

Upgrade the vendored nbio (mining/getwork websocket server) from the
community-dev-pinned version to v1.6.11 as prep for a future Go toolchain
bump. nbio v1.6.11's nbhttp code imports lesismal/llib/std/crypto/tls, so
llib is bumped in lockstep from ~v1.1.4 to v1.2.3.

Consumer changes in cmd/derod/rpc/websocket_getwork_server.go:
- websocket.Conn is now a concrete type (drop the *websocket.Conn assertion)
- OnReadBufferAlloc/Free callbacks take *[]byte (nbio v1.6.11 Allocator API)

Also apply an upstream llib nil-guard fix: in non-blocking TLS mode
llib's deferred conn.close triggers a nil deref on c.rawInput; guard it.

Tests: added cmd/derod/rpc/nbio_websocket_test.go (nbio HTTP->websocket
upgrade round-trip) and tests/normal/nbio_getwork_test/run_test.sh (real
derod --testnet + dero-miner end-to-end). Both pass.
Build to /tmp/nbio_derod + /tmp/nbio_miner so the test never clobbers the
harness's /tmp/derod build, and bind derod to a dedicated --rpc-bind=18093
with --p2p-bind=:0 so it is fully self-contained and never collides with the
run_integration_test.sh simulator (20000/8080) or the persistent dev daemon
(10100/10102). Verified PASS both standalone and inside the harness.
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