1

Getting this error when trying to set priority fee

solders.SignerError: not enough signers

Python 3.10.2

Solders 0.18.1

Solana 0.30.2

Code example is just following the solana cookbook:

...

transaction = Transaction()
transaction.add(set_compute_unit_limit(1_000_000))
transaction.add(set_compute_unit_price(1_000))
transaction.add(transfer(TransferParams(
    from_pubkey=sender.pubkey(),
    to_pubkey=receiver.pubkey(),
    lamports=int(0.001*LAMPORT_PER_SOL))
    ))

signature = client.send_transaction(transaction, sender)

Error does not appear when removing the priority fee instructions.

Any help would be great.

Thanks

1 Answer 1

1

This looks like a bug, but it's hard to see exactly where. Somewhere, the logic is failing to identify the fee payer for the transaction to be the from_pubkey in your transfer.

Here are a couple of workarounds:

  • set the fee payer by hand
transaction = Transaction()
transaction.fee_payer = sender.pubkey()
transaction.add(set_compute_unit_limit(1_000_000))
transaction.add(set_compute_unit_price(1_000))
transaction.add(transfer(TransferParams(
    from_pubkey=sender.pubkey(),
    to_pubkey=receiver.pubkey(),
    lamports=int(0.001*LAMPORT_PER_SOL))
    ))

signature = client.send_transaction(transaction, sender)
  • add the compute budget instructions at the end
transaction = Transaction()
transaction.add(transfer(TransferParams(
    from_pubkey=sender.pubkey(),
    to_pubkey=receiver.pubkey(),
    lamports=int(0.001*LAMPORT_PER_SOL))
    ))
transaction.add(set_compute_unit_limit(1_000_000))
transaction.add(set_compute_unit_price(1_000))

signature = client.send_transaction(transaction, sender)

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.