Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(llm): πŸ› fix long Memo Tag issue on Cardano #8608

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

thesan
Copy link
Contributor

@thesan thesan commented Dec 5, 2024

βœ… Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ...

πŸ“ Description

Truncate Cardano memos in the input to prevent the transaction validation errors.
(Follow up to #8340 and #8604).

Screen.Recording.2024-12-05.at.11.59.52.mov

❓ Context


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

@thesan thesan requested a review from a team as a code owner December 5, 2024 11:01
Copy link

vercel bot commented Dec 5, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Dec 6, 2024 0:29am
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Dec 6, 2024 0:29am
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Dec 6, 2024 0:29am
web-tools ⬜️ Ignored (Inspect) Visit Preview Dec 6, 2024 0:29am

@live-github-bot live-github-bot bot added the mobile Has changes in LLM label Dec 5, 2024
@thesan thesan force-pushed the fix/llm-cardano-memo-too-long branch from 8fb32ec to e4a8ded Compare December 5, 2024 19:08
themooneer
themooneer previously approved these changes Dec 6, 2024
ComradeAERGO
ComradeAERGO previously approved these changes Dec 6, 2024
@thesan
Copy link
Contributor Author

thesan commented Dec 6, 2024

TLDR I removed the last commit because I did one last test which went wrong and there's a minor bug on the backend.

If I send a memo with loads of emojies like 50πŸ‘ then maxLength will cut it to 32πŸ‘. It felt wrong to just use 2bytes per πŸ‘ but it passes the backend doesn't report the "string or buffer length invalid" (like in LIVE-15162) so I assumed it was fine.
However when I actually sent the transaction it failed with the backend returning: API HTTP 400 https://cardano.coin.ledger.com/api/v1/transaction/submit. When reverting to truncateUtf8 it correctly truncate to 16πŸ‘ (which should fit in 64bytes).

This means that the backend validation is incorect it probably checks for the length of the string instead of the bytes size of the string (in most emojies get encoded in 2 characters).

@thesan thesan dismissed stale reviews from ComradeAERGO and themooneer via 1c9256b December 6, 2024 12:29
@thesan thesan force-pushed the fix/llm-cardano-memo-too-long branch from e4a8ded to 1c9256b Compare December 6, 2024 12:29
@thesan thesan requested a review from ComradeAERGO December 6, 2024 16:40
@thesan thesan merged commit 1daabaf into develop Dec 6, 2024
43 checks passed
@thesan thesan deleted the fix/llm-cardano-memo-too-long branch December 6, 2024 17:19
thesan added a commit that referenced this pull request Dec 6, 2024
* fix(llm): fix long memo issue on Cardano

* chore: update change log
thesan added a commit that referenced this pull request Dec 6, 2024
* fix(llm): fix long memo issue on Cardano

* chore: update change log
thesan added a commit that referenced this pull request Dec 9, 2024
* fix(llm): fix long memo issue on Cardano

* chore: update change log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Has changes in LLM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants