Transaction preparation and journals
Transaction preparation and journals
RpcClient::prepare returns a legacy PreparedTransaction. prepare_with_lookup_tables returns a v0 PreparedVersionedTransaction. Preparation simulates the unsigned instruction set and derives a bounded compute limit. Sign the result, then simulate before submission. Simulation validates the pending transaction locally and sends a copy with signatures removed.
Large bookings can need address lookup tables for canonical provider pages. Tables must be valid and contain usable addresses. They compress account keys; they do not change matching or account-lock limits.
Both prepared types require every signature. Legacy message_bytes and attach_signatures support external signing. PendingTransaction retains signed legacy or v0 bytes. Its versioned_transaction() accepts both; transaction() accepts legacy only.
Save the pending transaction before broadcast. save writes a durable journal and refuses overwrite. load validates its bytes and signatures. Keep journals private: they contain broadcastable transactions. Preserve the same bytes during recovery and reconcile execution before preparing a replacement.