-
Notifications
You must be signed in to change notification settings - Fork 45
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
feat: allow to pass interaction transaction input in transaction "data" field #178
Comments
I don't know how feasible this would be but one way to make this feature extremely versatile would be to allow having a manifest in the data field (as described at https://github.com/ArweaveTeam/arweave/blob/master/doc/path-manifest-schema.md) and require one of the files listed to be named, e.g., Being able to specify other arbitrary files along the interaction input would allow for NFT minting, for example, to have a tx that includes the mint interaction input and any files attached to the NFT (images, music files, or basically anything else). And this way, all these files could be uploaded separately as bundle txs, so the Sequencer would only have to manage the upload of the manifest file, which should, in most cases, be pretty lightweight. |
That's a neat idea, but one issue I'm having with this flow is that (if I understand correctly) it would be now users' responsibility to post the input transaction to Bundlr first (and then post the complete manifest to our sequencer)..so they would need to have a Bundlr account created, funded, etc... |
Ok, how about this "hybrid" approach:
|
I'm not sure I'm getting point 3, the Sequencer would create a new tx with a data containing the original tx's input tag plus the manifest file? What happens to the first tx? Also, would this data field be interoperable with existing the tooling (sonar, viewblock, ...)? Ideally the manifest file should be very easy to discover, given the tx id, so that the files that it refers to are also easily discoverable. Also, maybe I'm missing something but I'm not sure whether the idea of allowing a manifest to contain both the input and arbitrary data is really incompatible with the current flow. The |
ok, to sum-up your idea in simple steps:
|
Yes I think that could match what I was thinking. For point 3, when you say Ideally the manifest tx should be considered as the "interaction" tx, the input one just being a piece of data of this interaction. The manifest tx would be the one showing up in |
side-note: this implementation should be made compatible with the "nested-bundles" example presented here ArweaveTeam/arweave-standards#22 (comment) |
Ok, I get the idea. In my ideal world I would prefer the original tx (created and signed by the user) to be considered as the SmartWeave interaction (not the "manifest tx") - because that is what client is creating and signing with his/her wallet. The owner of the transaction (from the SmartWeave protocol perspective) must be set to the original input tx owner. So here's another issue - from one hand we want to use the manifest tx id (e.g. in the validity report, etc), on the other hand - we cannot use its owner/signature - because that will always be set to the Warp's jwk that is used to create and sign the "manifest" transaction. I'll need to think a bit more about this idea... |
Ok so I have been trying to wrap my head around ANS-666 and refresh my mind on ANS-104. Taking inspiration from the structure you described (ArweaveTeam/arweave-standards#22 (comment)):
I see two scenarios regarding linking arbitrary data to a contract interaction. 1. Using a
|
Unfortunately number 1. is out of the question...for the exact reason that you've mentioned...we really want our GW to stay as lightweight and fast as possible. await warp.
.connectBundlrAccount()
.uploadFile()
.uploadFile()
.uploadFile()
.writeInteraction()
I like the 2nd. approach the most and that's what we will probably will implement - but I believe it needs some more analysis. E.g. one thing that I don't fully understand in the proposed flow is who is actually sending the input tx to bundlr - i.e. the transaction created in point 3. of your flow. If all the Warp Sequencer gets is the manifest file with the tx-ids - the Warp Sequencer will need to first to load the input tx metadadata - owner, tags, etc. (by the I'm not sure if it's even possible right now - in case of data-items, the gateway and Bundlr nodes offer only the "data" endpoint (e.g. Also - if we force users to send the |
So, the only way I see it right now is:
and then sends this whole nested bundle to Bundlr. |
Just putting in my two cents:
So, point 4 is basically the solution we've been discussing. I'm just proposing a shortcut for less complex scenarios where we could fit everything into a single tx. |
Yup, but I believe both Akord and Pianity (the first real life users of this feature) fall into point 4 - so there's a question whether it makes sense to implement the simpler versions - since in real life, only the 4th (at least now) will be used (plus it handles the 1, 2, 3 cases as well). Btw. re.3 - I'm not sure if pushing large amount of data through a sequencer is a good thing (even if it won't be effectively indexed/stored by our gw) - i.e. it may quickly drain sequencer's memory. I also believe that this feature is already handled by the "true" AtomicNFT feature that @asiaziola is currently implementing (warp-contracts/gateway#124 "register atomic contract"). |
Also - we need to define some 'realistic' limits for the input itself. As far as I remember - Akord need few kilobytes... It's still much more than 2048 bytes (effectively less, cause 2048 is for all tags, not only the input tag) On the other hand - it would be cool to offer sth that is "significantly" better than (for example) limits on Ethereum, Solana, etc. ( The other thing is data encoding - I wonder if the input stored in the data field shouldn't be by default encoded with sth like msgpack. |
As for the limits 100kB allowance from Bundlr seems like a pragmatic approach. I also agree that we may skip the 3rd variant (direct content storage). However, I still see value in the 2nd variant of extending the payload in the data field without the overhead of separate bundles and manifest. As far as I remember that feature was exactly what Akord asked for. |
The 2nd variant would be ideal for Akord, we could then merge the input JSON directly into the contract state during contract evaluation. As @jakub-wojciechowski says, it would keep things simpler. Then of course we can also use the 4th variant, I believe it would remain similar to what we are doing now: merging the current JSON data state outside the contract, bundling it as a data item and referencing it in the contract state. |
In case of point 4. - it would be up to our infra and execution engine to supply the input (stored in this case as a part of the manifest) directly into the contract (without having to manually load it by txid in the contract code). In other words - in case of a manifest file - our infra "extracts" the input content and indexes it internally - and supplies it for the state evaluation (just like for the point 2.). From the contract state evaluation perspective - it would work exactly the same as for point 2. Having two completely different formats (point 2 and point 4) maps to me to a more complicated code - but we will need to analyse this a bit more. IMO point 2. is simply a special case for point 4. |
Ok, that makes sense, thank you for the explanation @ppedziwiatr :) |
@noomly @wkolod So we would have our original transaction as it is right now with the input in the data field of the tx (with the size limitation of 100kb). Apart from that, user could pass other txs which should be linked to the input transaction (indicating its id and content type) - so it would cover the need of attaching some files e.g. pngs or mp3s. Warp would be then responsible for creating two data items - one with the input transaction and second one with manifest with the paths to the input and all txs attached. Sequencer would then attach sequence and create a nested bundle containing two data items. Original tx id and nested bundle id would be returned from I believe this would handle both of your use cases @noomly @wkolod ? Can you see any bottlenecks in this approach? |
This sounds like it's very close to the second solution I described here: #178 (comment) so I think it should be good! I have a few questions regarding your description of this beautiful piece of imagery you guys drew @asiaziola. 1.
What would be the use of providing the content type at this stage? It should be included in the data transaction anyway. I think the two data required from the user at this point would be the data tx id & its path, as I described in my previous comment linked above at 2.b.2. 2.
By "original tx id" do you mean the interaction transaction? By interaction transaction I mean the transaction that has the 3.To what transactions exactly are the sequencer tags attached to? Is it the interaction transaction? My concern is that if that's the case then the manifest transaction wouldn't really represent the "authority" of the interaction and could easily be discarded. What I mean by this is that, for example, when looking through the interactions of a contract on Sonar, if I try to look into the details of a particular interaction, how will I know that this interaction has anything else (images, music or any kind of arbitrary data) attached to it? Basically, are there actually any differences between the solution you guys have in mind and tried to describe in #178 (comment) and the solution number 2 I described a few months ago? If there are, do you mind trying to go through them in detail so we can make sure there wouldn't be any surprises? Btw thank you for this, it's going to be yet another great step into making the ecosystem better. Also, sorry for being a bit repetitive, just want to make sure everything is extra clear. |
Thanks for the response :) ad. 1 ad. 2 ad. 3 I guess the main difference is that this diagram:
...does not include creating main interaction transaction. In our approach
My main question to you is will you need the information about additional manifest in the contract itself? I guess for now when executing the contract it will have the information about the main interaction transaction - either through the input tag or data field of the transaction but we will not have any info about the manifest itself. Most probably we could provide access to the information about it but I'm wondering if you need it. |
Looks like it should be ok then, thank you for taking the time to answer my points!
We don't have any planned features that would require having access to information about the files attached to the interaction; although it might be interesting to have that in the future! |
We're starting development of this feature :)
|
Stage 1 - preparing minimal arbundles library version (the original one adds ~600kb to the resulting SDK bundle 😮) is done, right? @asiaziola warp-arbundles adds ~9kb, right? |
yes, sir. looks like it's done . |
done |
Requires warp-contracts/gateway#89
The text was updated successfully, but these errors were encountered: