Skip to content

Conversation

@abhijit0943
Copy link
Contributor

Fix protobuf3 serialization mismatch for TRON BANDWIDTH transactions.

Problem:

  • BitGoJS explicitly encoded resource=BANDWIDTH (value 0) in protobuf
  • TRON node re-serializes transactions and omits default values per protobuf3
  • Different bytes → different txID → signature mismatch (SIGERROR)

Solution:

  • Omit resource field when it's BANDWIDTH (the default value = 0)
  • Update decode functions to treat missing resource as BANDWIDTH
  • Add comprehensive round-trip tests for BANDWIDTH serialization

Files changed:

  • freezeBalanceTxBuilder.ts: omit resource field for BANDWIDTH
  • unfreezeBalanceTxBuilder.ts: omit resource field for BANDWIDTH
  • delegateResourceTxBuilder.ts: omit resource field for BANDWIDTH
  • undelegateResourceTxBuilder.ts: omit resource field for BANDWIDTH
  • utils.ts: handle missing resource as BANDWIDTH in decode functions

Ticket: SC-5030

…RROR)

Fix protobuf3 serialization mismatch for TRON BANDWIDTH transactions.

Problem:
- BitGoJS explicitly encoded resource=BANDWIDTH (value 0) in protobuf
- TRON node re-serializes transactions and omits default values per protobuf3
- Different bytes → different txID → signature mismatch (SIGERROR)

Solution:
- Omit resource field when it's BANDWIDTH (the default value = 0)
- Update decode functions to treat missing resource as BANDWIDTH
- Add comprehensive round-trip tests for BANDWIDTH serialization

Files changed:
- freezeBalanceTxBuilder.ts: omit resource field for BANDWIDTH
- unfreezeBalanceTxBuilder.ts: omit resource field for BANDWIDTH
- delegateResourceTxBuilder.ts: omit resource field for BANDWIDTH
- undelegateResourceTxBuilder.ts: omit resource field for BANDWIDTH
- utils.ts: handle missing resource as BANDWIDTH in decode functions

Ticket: SC-5030
@abhijit0943 abhijit0943 force-pushed the SC-5030 branch 2 times, most recently from 92e15f3 to 24e133e Compare January 21, 2026 13:25
@abhijit0943 abhijit0943 marked this pull request as ready for review January 21, 2026 13:46
@abhijit0943 abhijit0943 requested review from a team as code owners January 21, 2026 13:46
@abhijit0943 abhijit0943 requested review from a team as code owners January 21, 2026 14:50
@abhijit0943 abhijit0943 marked this pull request as draft January 21, 2026 14:54
@abhijit0943 abhijit0943 force-pushed the SC-5030 branch 2 times, most recently from 76382a5 to ee32ee3 Compare January 21, 2026 14:57
Exclude the tar vulnerability instead of bumping version because:
- Lerna requires tar v6, but fix only exists in v7.5.4+
- Forcing tar v7.x breaks lerna publishing
- This is a race condition in tar's path reservation system

Ticket: SC-5030
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