Skip to content

fix: peersync - case insensitive asset parsing#437

Merged
YusukeShimizu merged 1 commit into
ElementsProject:masterfrom
LN-Zap:fix/case-insensitive-asset-parsing-clean
May 14, 2026
Merged

fix: peersync - case insensitive asset parsing#437
YusukeShimizu merged 1 commit into
ElementsProject:masterfrom
LN-Zap:fix/case-insensitive-asset-parsing-clean

Conversation

@ronballesteros
Copy link
Copy Markdown
Contributor

Context

Related to #435

Nodes running the peersync-based daemon (post-v5.0.0) silently drop all inbound poll messages from peers still on v5.0.0, causing a one-way compatibility break.

NewAsset() performs a direct map lookup against stringToAsset, which only contains uppercase keys ("BTC", "LBTC"). v5.0.0 nodes advertise assets in lowercase in their poll payloads. The lookup fails, the poll is discarded, and observedAt never refreshes on the remote side. The remote peer ages the node off their active list within hours and cannot recover without restarting their daemon.

Logs on the node show:

  failed to parse poll message: invalid poll payload: unsupported asset: btc
  failed to parse poll message: invalid poll payload: unsupported asset: lbtc

Fix

Normalize the input with strings.ToUpper before lookup so both uppercase and lowercase symbols are accepted.

Testing

Verified manually against a v5.0.0 peer. Poll messages containing lowercase "btc"/"lbtc" are now parsed correctly and observedAt stays current.

Copy link
Copy Markdown
Contributor

@YusukeShimizu YusukeShimizu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Thanks for the focused fix.
I also checked the previous misc_2 CI failure.
It was an unrelated integration-test/glightning shutdown race, and the rerun is green now.

@YusukeShimizu YusukeShimizu merged commit d813007 into ElementsProject:master May 14, 2026
49 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants