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

LIVE-12087 - Fix llm prepare sign tx #6759

Closed
wants to merge 2 commits into from

Conversation

ComradeAERGO
Copy link
Contributor

@ComradeAERGO ComradeAERGO commented Apr 26, 2024

βœ… Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    Transactions creation with Wallet API on LLM

πŸ“ Description & ❓ Context

Figment is having issues with eth_sendTransaction on LLM (full details on the issue in this thread) and while investigating we figured the issue was coming from the way we are setting the customGasLimit here.

The problem doesn't appear on LLD, and as you can see, the custom prepareSignTransaction function we were doing in LLM doesn't exist on LLD.

The change introduced by this PR sets the behavior of LLM on par with LLD in regard to tx preparation in Wallet API.


🧐 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)

@ComradeAERGO ComradeAERGO requested a review from a team April 26, 2024 07:49
@ComradeAERGO ComradeAERGO self-assigned this Apr 26, 2024
@ComradeAERGO ComradeAERGO requested a review from a team as a code owner April 26, 2024 07:49
Copy link

vercel bot commented Apr 26, 2024

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

5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview Apr 26, 2024 0:32am
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Apr 26, 2024 0:32am
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Apr 26, 2024 0:32am
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Apr 26, 2024 0:32am
web-tools ⬜️ Ignored (Inspect) Visit Preview Apr 26, 2024 0:32am

@live-github-bot live-github-bot bot added the mobile Has changes in LLM label Apr 26, 2024
@ComradeAERGO ComradeAERGO changed the title Fix llm prepare sign tx Fix llm prepare sign tx [LIVE-12087] Apr 26, 2024
@ComradeAERGO ComradeAERGO changed the title Fix llm prepare sign tx [LIVE-12087] LIVE-12087 - Fix llm prepare sign tx Apr 26, 2024
@ComradeAERGO ComradeAERGO force-pushed the fix_llm_prepareSignTx branch 3 times, most recently from c67871c to c57dae3 Compare April 26, 2024 10:00
Copy link
Contributor

@sprohaszka-ledger sprohaszka-ledger left a comment

Choose a reason for hiding this comment

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

LGTM

@ComradeAERGO ComradeAERGO requested review from sprohaszka-ledger and a team and removed request for a team April 26, 2024 12:28
@@ -21,23 +21,15 @@ describe("prepareSignTransaction", () => {
// Given
const parentAccount = createAccount("12");
const childAccount = createTokenAccount("22", "js:2:ethereum:0x012:");
const expectedResult: EvmTransaction = {
const expectedResult: Partial<EvmTransaction> = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure that testing half of the expected result is enough.
The function is expected to return a full Transaction object, not a Partial one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is what the prepareSignTransaction returns

): TransactionCommon {
const bridge = getAccountBridge(account, parentAccount);
const t = bridge.createTransaction(account);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it okay to not go through the createTransaction anymore ?
I understand you made it the same as LLD but I think that some special defaults could be setup in this function IIRC

@@ -21,23 +21,15 @@ describe("prepareSignTransaction", () => {
// Given
const parentAccount = createAccount("12");
const childAccount = createTokenAccount("22", "js:2:ethereum:0x012:");
const expectedResult: EvmTransaction = {
const expectedResult: Partial<EvmTransaction> = {
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels a bit wrong to expect a partial transaction now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is what the prepareSignTransaction returns

@Justkant
Copy link
Contributor

Justkant commented May 7, 2024

Superseded by #6814

@Justkant Justkant closed this May 7, 2024
@Justkant Justkant deleted the fix_llm_prepareSignTx branch May 7, 2024 07:20
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.

None yet

3 participants