Conversation
octobocto
force-pushed
the
2026-08-31-deposit-address
branch
from
August 31, 2026 08:45
98e12d4 to
cdc6e5f
Compare
Coinelius
pushed a commit
to Coinelius/plain-bitassets
that referenced
this pull request
Sep 1, 2026
The enforcer hands the node a deposit address as UTF-8 in the form `s4_<address>_<checksum>`. proto.rs called `Address::from_str` on that whole string, which base58 decodes it and fails, and the code then took `Address::ALL_ZEROS` with only a warning — so every deposit credited `11111111111111111111` and was unspendable. The node could already write that format with `format_for_deposit` but could never read it back. `from_deposit_address` reverses it, and the deposit path still accepts a bare address. The silent ALL_ZEROS fallback stays, because failing there could stop a node mid-sync. Ported from LayerTwo-Labs/thunder-rust#142 by @octobocto, which fixes the same bug in Thunder (slot 9), adapted to this crate's layout and `AddressParseError`. Tests cover the round trip, a longer checksum, a wrong checksum, a wrong sidechain number, and a bare address. This changes which address a deposit credits, so every node on a chain must run the same side of it. Do not mix patched and unpatched nodes on eCash alphanet slot 4. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i7HNfwdUXvoHEzp6MCmBE
octobocto
force-pushed
the
2026-08-31-deposit-address
branch
2 times, most recently
from
September 5, 2026 06:21
f7b0bdd to
290f56d
Compare
octobocto
force-pushed
the
2026-08-31-deposit-address
branch
from
September 27, 2026 13:59
290f56d to
553db60
Compare
octobocto
force-pushed
the
2026-08-31-deposit-address
branch
from
September 27, 2026 14:43
553db60 to
0d292a4
Compare
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.
A deposit credited the all-zeros address on every network, because
proto.rspassed the wholes{slot}_{base58}_{checksum}string toAddress::from_str, which decodes base58 only.from_deposit_addressstrips the prefix, parses the address, and compares the whole string againstformat_for_deposit, so a wrong or short checksum fails. A bare address still parses, and every node must upgrade together.