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

Full support for transaction chaining #499

Open
1 task
HinsonSIDAN opened this issue Feb 6, 2025 · 4 comments
Open
1 task

Full support for transaction chaining #499

HinsonSIDAN opened this issue Feb 6, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@HinsonSIDAN
Copy link
Member

HinsonSIDAN commented Feb 6, 2025

Describe the feature you'd like

Currently transaction chaining is supported only by OfflineEvaluator in core-csl. When we want to have full support, it has to be integrated with other evaluator instances also.

Is your feature request related to a problem? Please describe.

Also, the tx chaining capability is not documented currently. There are 2 relevant apis in particular to supply information which is not available in the global blockchain:

https://github.com/MeshJS/mesh/blob/main/packages/mesh-transaction/src/mesh-tx-builder/tx-builder-core.ts#L1503-L1549

These 2 apis can allow users to provider previous unrecorded tx and particular utxos for evaluation.

Describe the solution you'd like

Improve current evaluateTx method for all IEvaluator to consider additionalTxs and additionalUtxos

Additional context

No response

Would you be willing to implement it?

  • Yes, I will implement it.
@HinsonSIDAN HinsonSIDAN added the enhancement New feature or request label Feb 6, 2025
@logicalmechanism
Copy link

Any work on this?

It would be really helpful to be able to build a TX and provide an additional utxo set to resolve the input's output for arbitrary utxos.

@HinsonSIDAN
Copy link
Member Author

Right now the txchaining capability is supported through offline evaluator, you can try it. No timeline for implementing into service providers, if you want it now, feel free to create a PR

      const evaluator = new OfflineEvaluator(
        provider,
        network.toLocaleLowerCase() as "mainnet" | "preprod"
      );
    const txBuilderConfig: MeshTxBuilderOptions = {
      fetcher: provider,
      serializer: new CSLSerializer(),
      evaluator,
      verbose: true,
    };
    const txBuilder = new MeshTxBuilder(txBuilderConfig);

@logicalmechanism
Copy link

I'd like to brainstorm some ideas. I have a project where this would be useful. My initial thought was having something like

.resolvedTxIn to the MeshTxBuilder

Then you can do something like

draft.TxIn(..).resolvedTxIn(..)

In that case, the service provider would know not to query the chain for that input but to use the resolved input for the additional utxos parameter field inside the evaluateTx call. There are probably better ways to do this.

I will check out the offline evaluator, though.

@HinsonSIDAN
Copy link
Member Author

This endpoint has been already implemented at inputForEvaluation - https://github.com/MeshJS/mesh/blob/main/packages/mesh-transaction/src/mesh-tx-builder/tx-builder-core.ts#L1520. What's remaining is integrating at evaluator provider instances

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

No branches or pull requests

2 participants