chore(deps): migrate jrpc2 v0 → v1.3.5#19
Draft
moralpriest wants to merge 5 commits into
Draft
Conversation
- Remove jrpc2/code subpackage imports (constants moved to root package) - Update error code references: code.* -> jrpc2.* - Change custom error code types: code.Code -> jrpc2.Code - Replace DecodeContext with handler wrapper for metrics timing - Update SignData/CheckSignature to use [1][]byte for JSON-RPC 2.0 compliance - Fix xswd tests to send params as arrays (JSON-RPC 2.0 spec) - Update test assertions to use jrpc2.* constants Breaking changes in jrpc2 v1: - jrpc2/code subpackage removed - ServerOptions.DecodeContext removed - ServerOptions.Metrics removed - Params must be array/object (not string) Pre-existing issues (not from this migration): - metrics: kcp.FECShortShards undefined (kcp version mismatch) - wallet-cli: readline.Operation.KickReader undefined
- cmd/dero-wallet-cli/prompt.go: replace deprecated readline.KickReader with Instance.Close() - cmd/derod/rpc/websocket_getwork_server.go: fix nbio v1.6.9 API (Upgrade return type, OnReadBufferAlloc/Free signatures) - cmd/derod/rpc/websocket_server.go: remove unused encoding/json import
15e852b to
4b1f737
Compare
- Remove deprecated FECShortShards metric - Add new FEC metrics - Reorganize imports using grouped import syntax for better readability
4b1f737 to
018a95f
Compare
Author
Status: DraftConverting to draft pending consensus-critical fix patches. This PR is functionally complete (jrpc2 v0 → v1.3.5, XSWD tests pass, builds clean) but must not be deployed to mainnet consensus nodes without the follow-up fixes documented in `docs/go-1.26-upgrade-audit.md`. The Go runtime upgrade (1.17 → 1.26.0, forced by jrpc2 v1.3.5 minimum of 1.25.0) introduces 8 consensus-critical map iteration sites that produce divergent state hashes. A follow-up PR will land the deterministic-sort fixes. See audit doc §5 for the 8 sites and §15 for the 7 patch files. |
- go.mod: bump go directive from 1.25.0 → 1.26.0 - docs/go-1.26-upgrade-audit.md: full audit (17 sections) - docs/go-1.26-fix-patches/: 6 deterministic-sort patches + gob replacement - docs/go-1.26-differential-test-spec.md: shadow testnet spec - consensus/go126_compat_test.go: runtime compat tests - PR DEROFDN#19 converted to draft pending fix PR Refs: - jrpc2 v1.3.5 requires go 1.25.0 minimum; we adopt 1.26.0 - Audit identified 8 consensus-critical map iteration sites - 7 fix patches documented in docs/go-1.26-fix-patches/ - DO NOT deploy to mainnet consensus until patches land
Reclassifies 6 of 7 consensus-critical sites as mitigated by operator-set GODEBUG=randmapiter=0 env var rather than requiring code patches. Changes: - docs/go-1.26-upgrade-audit.md: reclassify sites, add §18 §19 - docs/go-1.26-fix-patches/README.md: mark 1-6 deferred, 7 mandatory - docs/go-1.26-differential-test-spec.md: add Workaround C option - docs/go-1.26-operator-guide.md: NEW (operator quick-start) - consensus/godebug_check_test.go: NEW (placeholder test) - consensus/go126_compat_test.go: augment with self-check test Still required in a follow-up code PR: - cmd/derod/godebug_check.go (~25 lines, init() self-check) - p2p/chunk_server.go gob → custom encoding (patch 07)
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.
What
Migrate
github.com/creachadair/jrpc2from the vendored v0 to the latest release (v1.3.5).Why
Breaking Changes Addressed
jrpc2/codesubpackage removedInvalidParams,ParseError, etc.) moved to rootjrpc2packagexswd.goandxswd_test.goServerOptions.DecodeContextremovedtimedHandlerwrapper around each RPC handlerServerOptions.MetricsremovedSignData/CheckSignaturewere called with string params (accepted by v0, rejected by v1)[1][]byteto match specPre-existing Fixes (unrelated to jrpc2, but required for compilation)
These issues existed before this migration and would block a clean build:
readline.KickReader()deprecatedcmd/dero-wallet-cli/prompt.goInstance.Close()cmd/derod/rpc/websocket_getwork_server.goUpgradereturnkcp-go/v5v5.6.72 removedFECShortShardsgo.modFiles Changed
Core jrpc2 migration:
walletapi/xswd/xswd.go— imports, error code constants, handler callwalletapi/xswd/methods.go—SignData/CheckSignatureparam types for JSON-RPC 2.0 compliancewalletapi/xswd/xswd_test.go— test assertions and param arrayscmd/derod/rpc/websocket_server.go—DecodeContextremoved, handler wrapper for metrics timinggo.mod/go.sum— jrpc2 v1.3.5, Go 1.25.0Pre-existing fixes:
cmd/dero-wallet-cli/prompt.go— readline API updatecmd/derod/rpc/websocket_getwork_server.go— nbio API updatego.mod/go.sum— kcp-go/v5 pinTesting
getinfo,getheight,getblockcount,getblockheaderbytopoheightreturn valid JSON-RPC 2.0 responseswalletapi/rpcserverbuildsPrunedHeightin getinfo, gas estimate fix, proof arithmetic hardening)Unchanged Files
These files use stable jrpc2 APIs (
jrpc2.Request,jrpc2.Server,jrpc2.NewClient,handler.Map,handler.New) that survived v1 — no changes needed:cmd/dero-wallet-cli/easymenu_post_open.gocmd/dero-wallet-cli/prompt.go(already modified for readline)cmd/explorer/explorerlib/explorerlib.gocmd/simulator/wallets.gowalletapi/daemon_connectivity.gowalletapi/daemon_connectivity_wasm.gowalletapi/daemon_communication.gowalletapi/rpcserver/rpc_websocket_server.go(usesNewContext, still exists in v1)References
Logger,RPCLog,AllowPush,DisableBuiltin,Concurrency,NewContext,StartTimeParseError,InvalidRequest,MethodNotFound,InvalidParams,InternalError,NoError,SystemError,Cancelled,DeadlineExceeded