Skip to content

Scalus offline evaluator#20

Open
sae3023 wants to merge 2 commits intoFluidTokens:mainfrom
sae3023:offline-evaluator
Open

Scalus offline evaluator#20
sae3023 wants to merge 2 commits intoFluidTokens:mainfrom
sae3023:offline-evaluator

Conversation

@sae3023
Copy link
Copy Markdown

@sae3023 sae3023 commented Dec 23, 2025

This PR adds and configures ScalusTransactionEvaluator to ScheduledTransactionService.

When evaluating transactions, it doesn't make a network call for script evaluation, instead using its own cek machine implementation.

I may have configured its dependencies, namely Protocol Parameters and the UTxO supplier, incorrectly, as I'm not Spring-savvy. If you know a better way and would like me to improve this patch -- please share.

The gist of it is pretty simple -- Scalus implements a bloxbean-compatible interface for tx evaluation, and this PR adds it.
Will be happy to help with improvements and further integration!

@nemo83
Copy link
Copy Markdown
Collaborator

nemo83 commented Jan 12, 2026

This PR adds and configures ScalusTransactionEvaluator to ScheduledTransactionService.

When evaluating transactions, it doesn't make a network call for script evaluation, instead using its own cek machine implementation.

I may have configured its dependencies, namely Protocol Parameters and the UTxO supplier, incorrectly, as I'm not Spring-savvy. If you know a better way and would like me to improve this patch -- please share.

The gist of it is pretty simple -- Scalus implements a bloxbean-compatible interface for tx evaluation, and this PR adds it. Will be happy to help with improvements and further integration!

thanks for the contribution, does the evaluator still require an independent ScriptSupplier (coz previous versions needed it?)

@sae3023
Copy link
Copy Markdown
Author

sae3023 commented Jan 13, 2026

We don't require it, but if your transaction includes reference scripts, then it's going to be used to look those up, see CclUtxoResolver.

If you are indeed using reference scripts, Scalus provides several types to choose from. Seeing that you are using Bloxbean already, ScriptServiceSupplier will do.

If you aren't using them, then you can just use a constructor that doesn't take ScriptSupplier as a parameter.

@nemo83
Copy link
Copy Markdown
Collaborator

nemo83 commented Jan 13, 2026

Yeah in the tx we have 3 ref inputs, one of which is the tank script: https://github.com/FluidTokens/ft-aquarium-node/blob/main/src/main/java/com/fluidtokens/aquarium/offchain/service/ScheduledTransactionService.java#L190-L192

So I guess we need the ScriptSupplier too.

@sae3023
Copy link
Copy Markdown
Author

sae3023 commented Jan 14, 2026

Yeah, but should be pretty straightforward.

Wherever the QuickTxBuilder is created, it probably receives either a BackendService, or a ScriptService, or something like that. So, the dependency already exists, and to make the Scalus evaluator work, you just supply the same script service that the BackendService receives to our evaluator.

@sae3023
Copy link
Copy Markdown
Author

sae3023 commented Feb 5, 2026

hi! sorry for the delay

added the ScriptSupplier @nemo83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants