fix: buffer gas prices in self-funded session fallback - #107
Merged
tarrencev merged 1 commit intoSep 8, 2026
Merged
Conversation
This was referenced Sep 8, 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.
Self-funded session transactions can fail when gas prices rise between estimation and submission, even with
selfFundedGasMultiplier: 10. Add 50% headroom to all three gas prices in the automatic paymaster-to-self-funded fallback, matching the keychain confirmation flow.Cause
try_session_execute_with_gas_multiplierfirst tries outside execution. OnPaymasterNotSupported, it passes the result ofestimate_invoke_feedirectly toexecute_with_gas_multiplier.estimate_fee()returns raw RPC prices: the.gas_price_estimate_multiplier(2.0)on its builder does not modify the returned estimate. Execution then explicitly sets each price from that estimate, bypassing starknet-rs's automatic price buffering.This path also bypasses the keychain's
toStarknetFeeEstimate, which normally adds 50% to prices. The amount multiplier introduced by cartridge-gg/controller#2669 only changes gas amounts, so raising it cannot address this rejection.Observed L1 gas price: signed cap
96966059925918, submission price97728921905943. L1 data gas: signed cap134488580849, submission price135546644105. Both increased by roughly 0.79%.Paymaster success uses a different path: the SDK signs an outside-execution message and the relayer submits the outer transaction. The SDK never constructs self-funded resource bounds in that case. Cartridge's public paymaster implementation independently buffers both amounts and prices; its default is 2.5x. This is a source comparison, not a claim about the hosted service's deployed configuration.
Change
overall_feeas the raw cost estimate.No automatic resubmission is added. This addresses missing price headroom; it does not guarantee acceptance through arbitrary price increases or delays. Browser rollout requires publishing the updated WASM package and consuming it in the hosted keychain.
Validation
cargo test -p account_sdk --lib gas::tests— 8 passed.cargo test -p account_sdk --lib session_execution_test— 3 passed.cargo test -p account_sdk --lib --features filestorage session_execution_test— 3 passed.cargo test -p account_sdk --lib test_paymaster_fallback -- --test-threads=1with Katana v1.7.0-alpha.0 — 2 passed.cargo clippy -p account_sdk --lib -- -D warnings— passed.cargo check -p account-wasm --target wasm32-unknown-unknown --features controller_account— passed, with warnings in unchanged code.git diff --check— passed.The full all-feature CI suite was not run locally.