Skip to content

revert tagged serialization for contract addresses and coin public#853

Merged
gilescope merged 7 commits into
mainfrom
fix/revert-tagged-serialization-contract-addrs-coin-public
Mar 3, 2026
Merged

revert tagged serialization for contract addresses and coin public#853
gilescope merged 7 commits into
mainfrom
fix/revert-tagged-serialization-contract-addrs-coin-public

Conversation

@justinfrevert

@justinfrevert justinfrevert commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Overview

Reverts changes to add tagged serialization for contract addresses and coin public. These were not needed.

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Links

@justinfrevert justinfrevert requested a review from a team as a code owner March 3, 2026 15:15
@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

kics-logo

KICS version: v2.1.19

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 47
LOW LOW 3
INFO INFO 59
TRACE TRACE 0
TOTAL TOTAL 109
Metric Values
Files scanned placeholder 27
Files parsed placeholder 27
Files failed to scan placeholder 0
Total executed queries placeholder 73
Queries failed to execute placeholder 0
Execution time placeholder 11

@justinfrevert justinfrevert enabled auto-merge March 3, 2026 15:39
@justinfrevert justinfrevert added this pull request to the merge queue Mar 3, 2026
@justinfrevert justinfrevert removed this pull request from the merge queue due to a manual request Mar 3, 2026
@gilescope gilescope enabled auto-merge March 3, 2026 18:02
@gilescope gilescope added this pull request to the merge queue Mar 3, 2026
gilescope added a commit that referenced this pull request Mar 3, 2026
)

* revert tagged serialization for contract addresses and coin public

* change file

* remove remaining tag arguments for coin publics and contract addresses

* comment out ephemeral env test in ci

* remove --tagged

---------

Co-authored-by: Squirrel <giles.cope@shielded.io>
Signed-off-by: Giles Cope <gilescope@gmail.com>
Merged via the queue into main with commit 592416c Mar 3, 2026
35 checks passed
@gilescope gilescope deleted the fix/revert-tagged-serialization-contract-addrs-coin-public branch March 3, 2026 21:58
gilescope pushed a commit that referenced this pull request Apr 8, 2026
m2ux added a commit that referenced this pull request Apr 23, 2026
This reverts commit 2e3dba3.
Signed-off-by: Mike Clay <mike.clay@shielded.io>
m2ux added a commit that referenced this pull request Apr 23, 2026
This reverts commit 2e3dba3.
Signed-off-by: Mike Clay <mike.clay@shielded.io>
m2ux added a commit that referenced this pull request May 5, 2026
Revert coin_public_decode and contract_address_decode to use
hex_ledger_untagged_decode. Per ADR-0022 wallet keys and addresses use
untagged serialization; Bech32m HRP plays the role of a tag at the
user-facing boundary. The same tagged-switch was attempted and reverted
in PR #853; inline comments above both parsers cite ADR-0022 and PR #853
to prevent future re-introduction.

EOF enforcement on hex_ledger_untagged_decode (the audit-#307 fix) and
the improved error-message wording ("invalid hex input") are retained.
The unit tests are rewritten to assert untagged-acceptance plus EOF /
truncation / invalid-hex rejection on coin_public_decode,
contract_address_decode, and hex_ledger_untagged_decode::<HashOutput>.
The tagged test fixture (contract_address_undeployed_tagged.mn) is
removed and generate_txs.rs reverts to the existing untagged fixture.

Closes #307

Signed-off-by: Mike Clay <mike.clay@shielded.io>
Minhcardanian pushed a commit to Minhcardanian/midnight-node that referenced this pull request May 9, 2026
…t Issue H) (midnightntwrk#1437)

* fix(toolkit): switch CLI parsers to tagged deserialization

Switch coin_public_decode and contract_address_decode from
hex_ledger_untagged_decode to hex_ledger_decode (tagged), eliminating
the unconditional fallback that accepted untagged input for types that
implement Tagged.

- Replace hex_ledger_untagged_decode with hex_ledger_decode in
  coin_public_decode and contract_address_decode
- Add EOF enforcement to hex_ledger_untagged_decode (defense-in-depth)
- Update test fixture in generate_txs.rs to use tagged hex format
- Add 11 unit tests covering tagged/untagged/wrong-tag/trailing-bytes/
  invalid-hex scenarios

Closes #307

Signed-off-by: Mike Clay <mike.clay@shielded.io>

* fix(toolkit): keep CLI parsers untagged per ADR-0022; enforce EOF

Revert coin_public_decode and contract_address_decode to use
hex_ledger_untagged_decode. Per ADR-0022 wallet keys and addresses use
untagged serialization; Bech32m HRP plays the role of a tag at the
user-facing boundary. The same tagged-switch was attempted and reverted
in PR midnightntwrk#853; inline comments above both parsers cite ADR-0022 and PR midnightntwrk#853
to prevent future re-introduction.

EOF enforcement on hex_ledger_untagged_decode (the audit-#307 fix) and
the improved error-message wording ("invalid hex input") are retained.
The unit tests are rewritten to assert untagged-acceptance plus EOF /
truncation / invalid-hex rejection on coin_public_decode,
contract_address_decode, and hex_ledger_untagged_decode::<HashOutput>.
The tagged test fixture (contract_address_undeployed_tagged.mn) is
removed and generate_txs.rs reverts to the existing untagged fixture.

Closes #307

Signed-off-by: Mike Clay <mike.clay@shielded.io>

---------

Signed-off-by: Mike Clay <mike.clay@shielded.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants