{"record":{"id":"bed710b4c2b88500","repo":"nautechsystems/nautilus_trader","slug":"signed-transaction-priority-fee-per-gas-wei-exc","errorCode":null,"errorMessage":"Signed transaction priority fee per gas {} wei exceeds max fee per gas {} wei","messagePattern":"Signed transaction priority fee per gas (.+?) wei exceeds max fee per gas (.+?) wei","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/transaction.rs","lineNumber":314,"sourceCode":"        \"Signed transaction value does not match persisted value\"\n    );\n    anyhow::ensure!(\n        tx.input == intent.input,\n        \"Signed transaction calldata does not match persisted calldata\"\n    );\n    anyhow::ensure!(\n        tx.gas_limit <= intent.gas_limit,\n        \"Signed transaction gas limit {} exceeds configured ceiling {}\",\n        tx.gas_limit,\n        intent.gas_limit\n    );\n    anyhow::ensure!(\n        tx.max_fee_per_gas <= u128::from(intent.max_fee_per_gas),\n        \"Signed transaction max fee per gas {} wei exceeds configured ceiling {} wei\",\n        tx.max_fee_per_gas,\n        intent.max_fee_per_gas\n    );\n    anyhow::ensure!(\n        tx.max_priority_fee_per_gas <= tx.max_fee_per_gas,\n        \"Signed transaction priority fee per gas {} wei exceeds max fee per gas {} wei\",\n        tx.max_priority_fee_per_gas,\n        tx.max_fee_per_gas\n    );\n\n    Ok(())\n}\n\n/// Applies `gas_buffer_bps` over the `eth_estimateGas` result.\n///\n/// A buffered estimate above `gas_limit` rejects the transaction rather than clamping to the\n/// ceiling: on Arbitrum the estimate folds the L1 data fee into gas units, and clamping\n/// guarantees a paid-for out-of-gas revert.\n///\n/// # Errors\n///\n/// Returns an error if the buffered estimate exceeds `gas_limit` or the arithmetic overflows.","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/transaction.rs#L296-L332","documentation":"validate_signed_transaction enforces EIP-1559 fee sanity: the max priority fee per gas (tip) must never exceed the max fee per gas. This error fires when a signed transaction violates that invariant, which would otherwise be invalid or economically nonsensical on-chain.","triggerScenarios":"tx.max_priority_fee_per_gas > tx.max_fee_per_gas during validation of a signed transaction inside validate_signed_transaction; e.g. a manually built 1559 transaction where the tip cap was raised above the fee cap.","commonSituations":"Hand-assembled EIP-1559 transactions with inverted fee fields; signing libraries or wallets configured with a fixed tip that exceeds a lowered max fee; unit tests or tooling setting priorityFee > maxFee.","solutions":["Set tx.max_priority_fee_per_gas <= tx.max_fee_per_gas before signing","Raise max_fee_per_gas so it covers the intended priority tip","Use a standard fee estimator (e.g. eth_maxPriorityFeePerGas) and clamp the tip to the max fee"],"exampleFix":"// before\nlet max_fee_per_gas = 20_000_000_000u128;\nlet max_priority_fee_per_gas = 25_000_000_000u128; // tip > cap\n// after\nlet max_priority_fee_per_gas = max_priority_fee_per_gas.min(max_fee_per_gas);","handlingStrategy":"validation","validationCode":"assert!(tx.max_priority_fee_per_gas <= tx.max_fee_per_gas, \"priority fee {} exceeds max fee {}\", tx.max_priority_fee_per_gas, tx.max_fee_per_gas);","typeGuard":"fn fees_valid(max_fee_per_gas: u128, max_priority_fee_per_gas: u128) -> bool {\n    max_priority_fee_per_gas <= max_fee_per_gas\n}","tryCatchPattern":null,"preventionTips":["Clamp the priority fee to the max fee right before signing","Use a shared fee-building helper so fee fields cannot diverge","Unit-test 1559 fee construction with edge-case values"],"tags":["gas-fees","eip-1559","transaction-validation","evm"],"backgroundTag":"invalid-argument-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}