-
Notifications
You must be signed in to change notification settings - Fork 37
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
Make new_mint_transaction()
, new_send_transaction()
, and new_consume_transaction()
automatically use delegated proving if available
#736
Comments
@dagarcia7 - this may have been fixed in #720? But if not, is this something we could address for v0.7.1 release?
I think one of the things we wanted to do is let the user chose if they want to use delegated proving or not on per-transaction basis. Maybe there is an argument that can be passed to these methods to indicate whether to use delegated proving or not? |
I think what @partylikeits1983 is referring to would apply specifically for transaction helpers such as Currently the API exists for submitting transactions with a prover, but only for user-built transaction requests. A good workaround could be to have these transaction helpers return a |
I like @igamigo ;s approach, using the existing Also, we might want to consider returning to |
Yes. The functions
Would this look something like this in TypeScript: let delegated_prover_url = "http://18.118.151.210:8082";
let tx_request = await client.new_consume_transaction(
AccountId.from_hex(aliceIdHex),
mintedNoteIds,
);
await client.submit_transaction_with_prover(tx_request, delegated_prover_url); The only thing is that
|
Yes, that's about what I was referring to and agreed, we would have to remove the |
That is a really good approach as it keeps things clean. Calling await client.submit_transaction(transaction_request); or await client.submit_transaction_with_prover(transaction_request, delegated_prover_url); after creating the |
Feature description
Description
Currently, to leverage delegated proving in the web client, you must manually craft and submit a custom transaction via
submit_transaction_with_prover()
. ReferenceThis process is cumbersome because it involves building a
TransactionRequest
from scratch in the browser if you want to use delegated proving.It would be more user-friendly if the existing functions (
new_mint_transaction()
,new_send_transaction()
,new_consume_transaction()
) could automatically detect and use delegated proving when the client is initialized with a delegated proving URL. However, the recently merged webWorker PR no longer initializes the client with aremote_prover_endpoint
, so not 100% what would be the best approach now.What is happening now?
submit_transaction_with_prover()
directly.Proposed Solution
.submit_transaction()
, add a simple check to see if a delegated proving endpoint is defined..submit_transaction()
..submit_transaction_with_prover()
.new_mint_transaction()
,new_send_transaction()
,new_consume_transaction()
) can seamlessly handle delegated proving without additional user intervention.Why is this important?
Possible Implementation Steps
new_mint_transaction()
,new_send_transaction()
, andnew_consume_transaction()
to check for adelegatedProverURL
(or similar config) in the client..submit_transaction_with_prover()
..submit_transaction()
.Additional Context
Please let me know your thoughts. If this sounds good, I can open a draft PR to illustrate the changes.
Note:
Previous versions of this issue mentioned manipulating MASM in the browser. Sort of mixed things up, that is because the
create_p2id_note()
function in the webClient hasn't been pushed to NPM, and I was testing the 1 to N transfer (which requires MASM strings in TS) with delegated proving.The text was updated successfully, but these errors were encountered: