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

Given list of necessary resources, automatically populate reference arrays #5616

Open
algoanne opened this issue Jul 27, 2023 · 0 comments
Open
Assignees
Labels
new-feature-request Feature request that needs triage Team Scytale

Comments

@algoanne
Copy link
Contributor

algoanne commented Jul 27, 2023

In #5366 we enable using simulate to call a contract without populating the reference arrays. The simulate response then includes a list of all "touched" resources.

Given this list, it should be possible to optimally populate foreign reference arrays for the transactions to be accepted by the network. This will allow dapps (if they choose to) to mostly stop managing foreign references themselves.

There will be some complexity in the logic to populate the arrays, because:

  • some resources are implicitly available based on the transaction itself (e.g. the sender account is accessible).
  • the group resource sharing rules are not straightforward when it comes to cross-products. e.g. it may in some situations be necessary to include the same reference in multiple transactions' arrays.

It is not a requirement to find a truly optimal packing of the arrays if it proves algorithmically difficult.

The output may include additional new app call transactions to the group (using a null app of some kind that just approves).

This issue is to create a function
populate_reference_arrays(transaction group, list of necessary resources) -> suggested arrays for each txn.

We could add this to simulate, as a new flag called pack-my-arrays or something. If they already packed some refs in their arrays, we don't touch those, we just add what's needed.

note: if you need to pack an address that is the hash of an app that you are calling, you should notice that (because you already have access to it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature-request Feature request that needs triage Team Scytale
Projects
None yet
Development

No branches or pull requests

2 participants