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

Include ptr , len and bytes in ABI Receipts #6115

Closed
maschad opened this issue Jun 12, 2024 · 2 comments
Closed

Include ptr , len and bytes in ABI Receipts #6115

maschad opened this issue Jun 12, 2024 · 2 comments
Labels
enhancement New feature or request triage This issue was opened with a template and needs to be triaged by code owners.

Comments

@maschad
Copy link
Member

maschad commented Jun 12, 2024

Related Component

compiler

Problem you are trying to solve

On beta5, when decoding a contract call from a transaction ABI receipt, one could have used the previous Param1 to determine the function selector.

Now with the new encoding for contract calls the contract calls first param is now encoded using the pointer and so consumers can no longer determine the function selector from the transaction receipt.

Solution you'd like

Screenshot 2024-06-12 at 12 55 50 PM

As shown in the screenshot above from the following transaction, given that Param1 and Param2 are pointers, they will always return the same values, and more importantly they are meaningless without access to the VM memory (which a consumer can't access at this point).

One solution could be to return thee ptr, len and bytes when returning the ABI Receipt.

Notes

No response

@maschad maschad added enhancement New feature or request triage This issue was opened with a template and needs to be triaged by code owners. labels Jun 12, 2024
@IGI-111
Copy link
Contributor

IGI-111 commented Jun 13, 2024

This should be convenience provided by the SDK when it reports the receipts, not a change in how the VM or Sway works.

The problem is not that it's a pointer, but that you didn't have the value recorder before giving up access to VM memory.

@maschad
Copy link
Member Author

maschad commented Jun 13, 2024

Thanks for clarifying. As it turns out I may have overcomplicated this as we can actually access the scriptData in contract calls and thus we can slice the encoded selector offset. Closing as this is no longer relevant.

@maschad maschad closed this as completed Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage This issue was opened with a template and needs to be triaged by code owners.
Projects
None yet
Development

No branches or pull requests

2 participants