fix(dash): normalize PlatformNodeId to canonical byte order at consensus boundary#888
fix(dash): normalize PlatformNodeId to canonical byte order at consensus boundary#888Shaurya2k06 wants to merge 2 commits into
Conversation
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
7ae2ee7 to
dac20f1
Compare
…sus boundary Dash Core serializes platformNodeID as uint160 whose wire blob is the reverse of the dashmate/Tenderdash form; reverse on encode/decode so derived and decoded ids compare equal. Closes #887. Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com>
6af82c1 to
bf059d3
Compare
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
Closes #887.
Problem
PlatformNodeId(#885) kept ProRegTx/ProUpServTx/SML wire bytes as-is, but Dash Core serializesplatformNodeIDasuint160whose on-wirem_datais the reverse of the GetHex / dashmate / Tenderdash form.from_ed25519_public_key(#884) already produces canonical-forward bytes, so decoded payload ids never equal derived ids — including key-wallet provider matching inaccount_checker.rs.Verified: wire
8cb97997…↔ canonical68794393…(exact reversal).Changes
PlatformNodeId::consensus_decodereverses wire → canonical inner bytesPlatformNodeId::consensus_encodereverses canonical → wirefrom_ed25519_public_key, Display, FromHex, serde unchangedCompatibility
PlatformNodeIdDisplay/compare semantics change to canonical (intentional)Tests
#884golden pubkey → canonical id → reversed wire → decode backcargo test -p dashcore --all-features,-p key-wallet --all-features,-p key-wallet-ffi --all-features, clippy-D warnings, fmt