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

Implement eth_sendRawTransaction for large Ethereum TXns #15

Closed
Kalina-Todorova opened this issue Apr 15, 2022 · 3 comments · Fixed by #281
Closed

Implement eth_sendRawTransaction for large Ethereum TXns #15

Kalina-Todorova opened this issue Apr 15, 2022 · 3 comments · Fixed by #281
Assignees
Labels
enhancement New feature or request limechain P1
Milestone

Comments

@Kalina-Todorova
Copy link

Kalina-Todorova commented Apr 15, 2022

Economics should be cleared out
Depends on services implementation

@Nana-EC Nana-EC added the P1 label May 16, 2022
@Kalina-Todorova Kalina-Todorova added enhancement New feature or request and removed hashio limechain labels May 16, 2022
@Daniel-K-Ivanov Daniel-K-Ivanov changed the title Implement eth_sendRawTransaction for contract create Implement eth_sendRawTransaction for large Ethereum TXns May 25, 2022
@Daniel-K-Ivanov
Copy link
Collaborator

Problem
eth_sendRawTransaction assumes that the provided Ethereum transaction is lower than 6KB, thus it directly uses the new EthereumTransaction().setEthereumData(transactionBuffer) functionality from the Hedera JS SDK.

If a user wants to submit a transaction > 6kb (contract deployment), the submission will fail.

Short term Solution
Change the implementation of the relay such that, if the transaction submitted is >= 4KB (we need a buffer for the relay signature), a new flow is executed, which uploads the data of the transaction with the following algorithm:

  1. Cut the data property from the encoded transaction
  2. Upload the first 4kb of the data property using FileCreate
  3. If the data property is >=4kb, execute n number of FileAppends where n is Math.ceil(TransactionBytes - 4kb)
  4. Populate the callData property of the EthereumTransaction with the ID of the created File
  5. Submit the Ethereum transaction without the data property

Details on how to utilise the File ID for passing data in the transaction payload can be found here:
https://hips.hedera.com/hip/hip-410

@Nana-EC
Copy link
Collaborator

Nana-EC commented May 26, 2022

We should be able to simplify the logic since SDK intend to implement this.

In which case we are just left with the economics of it

@Nana-EC Nana-EC added this to the 0.3.0 milestone Jun 21, 2022
@natanasow
Copy link
Collaborator

Blocked, because we need this fix to be merged/released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request limechain P1
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants