You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dash-spv: the user agent is no longer normalized or capped at 256 bytes #1242
All paths are under dash-spv/src/ at 8dde9d0c (dev after #902).
build_version sends user_agent exactly as configured (network/peer.rs:538-552). Before #902, handshake.rs wrapped it in / delimiters and truncated it at 256 bytes. Dash Core reads the field with LIMITED_STRING(strSubVer, MAX_SUBVERSION_LENGTH) (net_processing.cpp:4020, limit 256 in net.h:86), which throws on a longer string. Core catches the exception and only logs it (net_processing.cpp:6002-6005), so our version is dropped, Core never sends its own, and the handshake times out. This only affects a custom user agent longer than 256 bytes, the default is short.
Evidence. A throwaway test set a 300-byte agent through ClientConfig::default().with_user_agent(..), built the version message and round-tripped it:
client/config.rs:192 and dash-spv-ffi/src/config.rs:186 still promise normalization. ClientConfig::user_agent changed from Option<String> to String in the same change, a public API break that the #902 title did not mark with !. The default also changed from /rust-dash-spv:VER/ to /dash-spv:VER/, while the devnet agent still uses rust-dash-spv.
Fix. Restore the normalization in build_version (add the delimiters, truncate on a char boundary at 256), and align the devnet agent with the new default.
Activity