0

I'm trying to measure the compute unit cost for my transaction which has 2 instructions:

{
  ix0: native ed25519 sig verify (Ed25519SigVerify111111111111111111111111111)
  ix1: myprogram.foobar
}

but on my local machine the reported amount from solana logs only has numbers for myprogram.foobar. No mention of the native ed25519 program.

Transaction executed in slot 62:
  Signature: qPGf7Trp9KnRCfBVphsckxdE9M5PwLdcNGbjHbBu46r4m7jCvhPRYkctBVL2RnHX4GbKaJJTHza9348WF4gtRnq
  Status: Ok
  Log Messages:
    Program BJpP8hHbVz5uoSqDM1CBjc2GoQnayssyZvYe7qLoaA49 invoke [1]
    Program log: Instruction: myprogram.foobar
    Program BJpP8hHbVz5uoSqDM1CBjc2GoQnayssyZvYe7qLoaA49 consumed 21997 of 400000 compute units
    Program BJpP8hHbVz5uoSqDM1CBjc2GoQnayssyZvYe7qLoaA49 success

Is there a compute cost for the ed25519 instruction that counts towards the 1.4m total tx compute budget? And what is the lamport SOL cost for the ed25519 instruction?

1 Answer 1

1

The ED25519 program is a bit special, since it doesn't require any accounts to be loaded or modified. It's run as a "precompile" during transaction sanitization: https://github.com/solana-labs/solana/blob/b5b48eeb72a1824b0d48f1cca3ba59b518932153/sdk/src/transaction/sanitized.rs#L272

As for the compute cost, this took me awhile to dig through, but it looks like it only has a lamport cost, as reported through SanitizedMessage::num_signatures https://github.com/solana-labs/solana/blob/b5b48eeb72a1824b0d48f1cca3ba59b518932153/sdk/program/src/message/sanitized.rs#L354-L357

This way, the instruction signature is treated the same as any other signature in your transaction.

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.