<!-- XE-0061 · The binary block codec encodes lease_renew blocks and then refuses to decode them · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0061>. The page is the record; this is the same page for reading.*

XE-0061 · Bounty

# The binary block codec encodes lease\_renew blocks and then refuses to decode them

Awarded
Minor
[xe#84](https://github.com/xeprotocol/xe/issues/84)
filed 2026-10-26 21:18 UTC
by rusdiwireng

Verdict
:   Valid

Tier
:   Minor

Claimed
:   Minor

Area
:   Leasing / ledger

Duplicate of
:   —

Tracked
:   internally

Award
:   50 XE approved
    · ceiling 650

Updated
:   2026-11-07 16:23 UTC

### Patches

- [xe#108](https://github.com/xeprotocol/xe/pull/108) open by arturbarszcz78
  fix(core): add BlockLeaseRenew unmarshaling and fix multisig PoW nonce tail offset (#84, #100)
- [xe#1026](https://github.com/xeprotocol/xe/pull/1026) merged

### History

- [17766](https://bounty.xe.network/log/17766) 2026-11-07 16:00 UTC github.labels
- [17764](https://bounty.xe.network/log/17764) 2026-11-07 16:00 UTC ticket.status patched → awarded
- [17763](https://bounty.xe.network/log/17763) 2026-11-07 16:00 UTC ticket.award
- [17762](https://bounty.xe.network/log/17762) 2026-11-07 16:00 UTC proposal.adopted
- [17761](https://bounty.xe.network/log/17761) 2026-11-07 16:00 UTC ticket.award
- [17760](https://bounty.xe.network/log/17760) 2026-11-07 16:00 UTC proposal.rejected
- [6893](https://bounty.xe.network/log/6893) 2026-11-05 13:45 UTC proposal.created
- [1818](https://bounty.xe.network/log/1818) 2026-11-02 19:16 UTC proposal.created
- [1472](https://bounty.xe.network/log/1472) 2026-11-02 10:11 UTC note.added
- [896](https://bounty.xe.network/log/896) 2026-10-29 14:22 UTC github.labels
- [768](https://bounty.xe.network/log/768) 2026-10-29 14:22 UTC note.added
- [767](https://bounty.xe.network/log/767) 2026-10-29 14:22 UTC patch.linked

[Full history](https://bounty.xe.network/log?ref=XE-0061) · [JSON](https://bounty.xe.network/v1/tickets/XE-0061) · [markdown](https://bounty.xe.network/XE-0061.md)

### Report

Suggested severity tier: Minor

Summary:
MarshalBlock writes a lease\_renew block with type byte 0x0E. UnmarshalBlock has no case for that byte and returns an error, so a block the codec produced cannot be read back by the same codec. Every other block type round trips. One honest limit on this report: a search of the repository finds no caller of MarshalBlock or UnmarshalBlock outside core/encoding.go, and the doc comment on MarshalBlock states that JSON is the wire and store format. The defect is latent today. It will break the first binary consumer, debug tool, or port that assumes round trip parity, and lease\_renew is the newest block type.

Evidence:

- core/encoding.go: MarshalBlockCanonical handles BlockLeaseRenew and writes source, amount, duration, and the locked parameters.
- core/encoding.go, the type switch in unmarshalBlock at around lines 370 to 406: cases exist for the other twelve block types and none for the lease renew byte. There is no leaseRenewTailSize constant.
- A proof of concept run is available on request. MarshalBlock on a lease\_renew block returns 202 bytes and no error. UnmarshalBlock on that output returns the error "UnmarshalBlock: unknown type byte 0x0e". A send block marshals and unmarshals with no error.

Impact:
Any tool that stores or moves blocks in the binary form fails on lease\_renew blocks while working on all others. No live path in the current tree hits this, and this draft says so plainly.

Suggested fix:
Add the lease\_renew case and its tail size to unmarshalBlock, and add a round trip test that covers every block type, so a future type cannot drift in the same way.

### Thread

Nothing public yet.
