{"record":{"id":"2fae65c071de94c8","repo":"nautechsystems/nautilus_trader","slug":"latest-block-has-no-base-fee","errorCode":null,"errorMessage":"Latest block {} has no base fee","messagePattern":"Latest block (.+?) has no base fee","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":1462,"sourceCode":"    ) -> anyhow::Result<PreparedTransaction> {\n        let expected_chain_id = u64::from(self.chain_id);\n        let actual_chain_id = self.http_rpc_client.chain_id().await?;\n        if actual_chain_id != expected_chain_id {\n            anyhow::bail!(\n                \"Chain ID mismatch: expected {expected_chain_id}, node reported {actual_chain_id}\"\n            );\n        }\n\n        let nonce = self\n            .http_rpc_client\n            .get_transaction_count_pending(&self.wallet_address)\n            .await?;\n        self.database\n            .assign_execution_intent_nonce(intent_id, nonce)\n            .await?;\n        let latest_block = self.http_rpc_client.latest_block().await?;\n        let base_fee_per_gas_wei = latest_block.base_fee_per_gas.ok_or_else(|| {\n            anyhow::anyhow!(\"Latest block {} has no base fee\", latest_block.number)\n        })?;\n        let priority_fee_per_gas_wei = self.http_rpc_client.max_priority_fee_per_gas().await?;\n        let (max_fee_per_gas, max_priority_fee_per_gas) = derive_fees(\n            base_fee_per_gas_wei,\n            priority_fee_per_gas_wei,\n            self.base_fee_buffer_bps,\n            u128::from(self.max_fee_per_gas_wei),\n        )?;\n        let gas_estimate = self\n            .http_rpc_client\n            .estimate_gas(&self.wallet_address, &to, value, &input)\n            .await?;\n        let gas_limit = derive_gas_limit(gas_estimate, self.gas_buffer_bps, self.gas_limit)?;\n        let max_gas_cost = U256::from(gas_limit)\n            .checked_mul(U256::from(max_fee_per_gas))\n            .ok_or_else(|| anyhow::anyhow!(\"Maximum gas cost overflow\"))?;\n        let max_transaction_cost = value\n            .checked_add(max_gas_cost)","sourceCodeStart":1444,"sourceCodeEnd":1480,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/2114cf6f761429e0adb5ca9596fcd7b895b16011/crates/adapters/blockchain/src/execution/client.rs#L1444-L1480","documentation":"prepare_and_sign builds an EIP-1559 transaction, which requires a base fee; latest_block.base_fee_per_gas was None. That field is only populated on chains that implement EIP-1559 fee markets, so the connected network (or a degenerate block response) does not provide baseFeePerGas and the transaction cannot be fee-priced.","triggerScenarios":"prepare_and_sign on a pre-EIP-1559 chain (no London hardfork) or a network whose blocks omit baseFeePerGas; an RPC gateway returning a stripped eth_getBlockByNumber response; a misconfigured http_rpc_url that lands on such a network.","commonSituations":"Pointing the adapter at private/consortium chains (Besu/Geth in legacy mode, older forks) or testnets without EIP-1559; fat-fingered RPC URLs selecting a different network than intended.","solutions":["Verify the target chain supports EIP-1559: eth_getBlockByNumber('latest') must include baseFeePerGas","Fix http_rpc_url / chain config so it points at the intended EIP-1559 network (Ethereum mainnet, most L2s)","For private chains, upgrade/enable the London fork on the nodes, since the client signs only EIP-1559 transactions"],"exampleFix":"# before: legacy chain, no base fee\nblock = w3.eth.get_block('latest')\nblock.get('baseFeePerGas')  # None -> Latest block has no base fee\n\n# after: preflight the endpoint before trading\nblock = w3.eth.get_block('latest')\nassert 'baseFeePerGas' in block, 'chain lacks EIP-1559; pick another endpoint'\nconfig.http_rpc_url = 'https://<eip1559-endpoint>'","handlingStrategy":"validation","validationCode":"from web3 import Web3\n\nw3 = Web3(Web3.HTTPProvider(config.http_rpc_url))\nlatest = w3.eth.get_block('latest')\nassert 'baseFeePerGas' in latest and latest['baseFeePerGas'] is not None, (\n    'target chain lacks EIP-1559 base fee; the client only signs EIP-1559 transactions'\n)","typeGuard":"def chain_supports_eip1559(block: dict) -> bool:\n    return block.get('baseFeePerGas') is not None","tryCatchPattern":null,"preventionTips":["Preflight eth_getBlockByNumber('latest') for baseFeePerGas whenever the RPC URL or chain config changes","Keep a documented list of supported EIP-1559 networks in deployment runbooks"],"tags":["blockchain","eip-1559","gas-pricing","rpc","network-support"],"backgroundTag":"eip1559-not-supported","analyzedSha":"2114cf6f761429e0adb5ca9596fcd7b895b16011","analyzedAt":"2026-08-21T11:28:30.864Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}