chore(deps): bump vendored nbio to v1.6.11 (and llib to v1.2.3)#40
Open
moralpriest wants to merge 2 commits into
Open
chore(deps): bump vendored nbio to v1.6.11 (and llib to v1.2.3)#40moralpriest wants to merge 2 commits into
moralpriest wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
nbhttpcode importslesismal/llib/std/crypto/tls, sollib is bumped in lockstep from ~v1.1.4 to v1.2.3.
Consumer changes —
cmd/derod/rpc/websocket_getwork_server.gonbio v1.6.11 changed two APIs the daemon uses:
websocket.Connis now a concrete type (was an interface) → dropped theconn.(*websocket.Conn)assertion.OnReadBufferAlloc/OnReadBufferFreecallbacks now take*[]byte(matching nbio v1.6.11's
AllocatorAPI) → updated the mempoolcallbacks 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.closedereferencesc.rawInputwithout a nil check. nbio v1.6.11 forcesTLS 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 realnbhttpserver (HTTP→websocket upgrade, echo round-trip, connectionlifecycle, TLS handshake through the llib fix). Passes.
tests/normal/nbio_getwork_test/run_test.sh— boots a realderod --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.modstays atgo 1.17— this is prep only, no toolchain bump.go.modrequires,no
vendor/modules.txt, nogo.sum).run_integration_test.shsuite does not exercise thegetwork/nbio path, so it is out of scope; the change is isolated to the
getwork server and its vendored deps.