Repository navigation
fix(bundle): enforce strict fixed pricing when signing bundles - #774
Merged
Merged
Conversation
signTransaction rejects a transaction whose real cost exceeds the strict fixed price, but signBundle and signAndSendBundle never ran that check, so a bundle could make Kora pay more than the fixed price covers. process_bundle now totals each transaction's real cost, applying the same missing-payment waiver as the required fee, and sign_all rejects the bundle before signing when that total exceeds the fixed price.
Contributor
[Medium impact] The PR appears safe to merge; no new blocking issue was found. SummaryThe PR checks strict fixed pricing against bundle costs before signing and keeps the missing-payment waiver from reducing the fixed price.
Reviews (3) · Last reviewed commit: "test(bundle): move process_bundle totals..." · Reviewed by Greptile |
A fixed price never includes the missing-payment penalty, but the bundle waiver subtracted it from the fixed total anyway. Strict fixed bundles were charged up to 50 lamports less per transaction than non-strict ones, and a fixed price under 25 lamports per transaction underflowed and failed the bundle. The waiver now applies to the fixed price's real cost only, and a multi-transaction test covers both totals.
The Miri job runs bundle::helper::tests, and process_bundle initializes the price oracle, which needs filesystem access Miri isolation blocks. The test now sits with the other RPC-backed bundle tests in sign_bundle.
amilz
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
None. Found during an internal duplication review.
What and why
With
[validation.price] type = "fixed"andstrict = true,signTransactionandsignAndSendTransactionreject a transaction whose real cost (base fee, Kora signature fee, fee payer outflow, missing-payment penalty, transfer fee) exceeds the fixed price. The bundle pipeline inBundleProcessorprices each transaction through the sameestimate_kora_fee, but never ranvalidate_strict_pricing_with_fee. SosignBundleandsignAndSendBundlesigned bundles that cost Kora more than the fixed price covers, which is the case strict mode exists to prevent.Changes:
process_bundlenow also totals each transaction's real cost intototal_cost_lamports. It applies the same missing-payment waiver astotal_required_lamports, so a bundle that pays once is not charged a penalty per transaction.sign_allruns the strict check on the bundle totals before the existing payment check and before any signing.TransactionValidator::validate_strict_pricingtakes the two lamport amounts.validate_strict_pricing_with_feenow delegates to it, with unchanged behavior.The check covers the whole bundle, not each transaction. That matches how bundle payment is already validated: the client pays one total, and one transaction may carry the payment for all of them.
As in the single-transaction path,
estimateBundleFeedoes not run the strict check. Only the signing paths reject.Testing
test_sign_bundle_rejects_cost_above_strict_fixed_price: a one-transaction bundle under a strict fixed price that comes to 0 lamports. Without the fixsign_bundlesigns it and the test fails. With the fix it is rejected with "Strict pricing violation".sign_allunit tests: rejected when cost is above the fixed price, accepted at exactly the fixed price, accepted above it whenstrict = false.test_process_bundle_waives_missing_payment_penalty_once_under_strict_fixed_price: one-transaction and three-transaction bundles throughprocess_bundle. It fails if the waiver is skipped on the cost side or applied to the fixed price.cargo test -p kora-lib --lib: 1009 passed, 4 ignored.rpc(63),usage_limit(17),free_signing(9),payment_address(9),adversarial(11) pass on the first commit.rpc,free_signingandpayment_addresswere rerun and pass on the second.cargo fmt --all -- --checkandcargo clippy -p kora-lib -- -D warningsare clean.AI disclosure
Check exactly one. See CONTRIBUTING.md.