How to estimate gas fees for transactions on Canton Network

Hi Canton team,

I have a question regarding estimating gas fees on the Canton Network.

As I understand, the Global Synchronizer reduces the participant node’s balance to cover gas fees. However, in my use case, I’m hosting services for multiple users, and I’d like to charge each user for their respective gas fees.

Is there any way to estimate the gas fee for a transaction before execution? I’ve gone through the whitepaper, but I’m aware that the gas model configuration (e.g., parameters in the Super Validator in cn-quickstart repo) can change, which may make the whitepaper values inaccurate.

Could you please clarify:

  1. Whether there’s an API or method to estimate or simulate the gas cost for a transaction; and

  2. How to reliably obtain the current gas model configuration to keep my estimates accurate?

  3. I found the contract splice-amulet:Splice.AmuletRules:AmuletRules that appears to be held the Super Validator’s ledger.

    • Can a participant node programmatically read these rules at runtime to build an accurate fee quote?

    • If yes, what’s the canonical way (e.g., SDK call, CLI, ledger query) to fetch the current AmuletRules?

Thanks in advance for your help!

2 Likes

Splice 0.5.1 introduces support for traffic fee estimation as part of transaction preparation.
Details on how to use this endpoint will be added to the documentation released with Splice 0.5.2, available on Monday, November 24th.

HT: @Wayne_Collier

1 Like