3

The transaction fees page says that transaction cost = lamports_per_signature * number_of_signatures.

Here, is the number of signatures calculated based only on the top-level instruction or are the signatures of invoke_signed() calls also being considered?

1 Answer 1

6

No. During invoke_signed(), the runtime artificially promotes the PDA(s) to signers for the duration of that instruction invocation only. Transaction fees are charged up front, before transaction execution and hence we know neither whether, which nor how many CPI calls will be made. Luckily this doesn't matter since, due to the fact that these are runtime driven, artificial "signers", there isn't actually a digital signature to verify, which is what the fee is ostensibly charging for. Instead the CPI invocations are taken from the compute budget.

2
  • 1
    "Transaction fees are charged up front, before transaction execution, at which point we don't know how many CPI calls will be made.", maybe?
    – man0s
    Commented Jul 22, 2022 at 6:40
  • 1
    no. but i clarified anyway. ty
    – trent.sol
    Commented Jul 22, 2022 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.