nautechsystems/nautilus_trader · error
Failed to parse full transaction in eth_getBlockByNumber res
Error message
Failed to parse full transaction in eth_getBlockByNumber response
What it means
When `block_by_tag` fetches a block with `full_transactions: true`, each transaction in the response is deserialized from its JSON value into the library's transaction type. This error is raised if any transaction object in the `eth_getBlockByNumber` response cannot be parsed — the block envelope was valid, but a transaction's shape or field types are unexpected.
Source
Thrown at crates/adapters/blockchain/src/rpc/http.rs:700
async fn block_by_tag(&self, tag: &str, full_transactions: bool) -> anyhow::Result<RpcBlock> {
let result: Option<RpcBlockResponse> = self
.execute_execution_rpc_call(
"eth_getBlockByNumber",
serde_json::json!([tag, full_transactions]),
)
.await?;
let response = result.ok_or_else(|| {
anyhow::anyhow!("eth_getBlockByNumber returned no result for block tag {tag}")
})?;
let mut block = response.block;
if full_transactions {
block.transactions = response
.transactions
.into_iter()
.map(|transaction| {
serde_json::from_value(transaction).map_err(|_| {
anyhow::anyhow!(
"Failed to parse full transaction in eth_getBlockByNumber response"
)
})
})
.collect::<anyhow::Result<_>>()?;
}
Ok(block)
}
/// Returns the receipt for the given transaction hash via `eth_getTransactionReceipt`.
///
/// A `null` result maps to `Ok(None)`: the transaction is pending and no receipt
/// exists yet.
///
/// # Errors
///
/// Returns an error if the RPC call fails or the response is malformed.
pub async fn get_transaction_receipt(View on GitHub (pinned to 18893faf8b)
Solutions
- Check the inner serde message by reproducing the call and inspecting the raw JSON transaction objects
- Upgrade the adapter to a version that supports the transaction types the node emits
- Use `full_transactions: false` if only block headers are needed, avoiding per-tx parsing
- Exclude non-standard transaction types at the node level or use a mainstream chain/node combo
Example fix
// before: adapter predates blob transactions let block = client.block_by_number(height, true).await?; // Err parsing EIP-4844 tx // after: upgrade adapter, or fetch headers only let block = client.block_by_number(height, false).await?;
Defensive patterns
Strategy: fallback
Type guard
fn transactions_parseable(block_json: &serde_json::Value) -> bool {
block_json["transactions"].as_array().map(|txs| {
txs.iter().all(|t| t.get("hash").map(|h| h.is_string()).unwrap_or(false))
}).unwrap_or(true)
} Try / catch
match client.block_by_number(height, true).await {
Ok(b) => Ok(b),
Err(e) if e.to_string().contains("Failed to parse full transaction") => {
log::warn!("unsupported tx shape; degrading to headers-only");
client.block_by_number(height, false).await
}
Err(e) => Err(e),
} Prevention
- Keep the adapter updated for new EIP-2718 transaction types (4844 blobs, etc.)
- Test full-transaction fetching against the target chain after upgrades
- Use full_transactions=false when only block headers are needed
- Prefer mainstream chain/node combinations that emit spec-compliant transaction JSON
When it happens
Trigger: A transaction in the full-transaction array has missing/unexpected fields: non-standard transaction types (e.g. newer EIP-2718 typed transactions the library version doesn't know), null `to`/fields in unexpected places, or node-specific extra/mis-typed fields breaking serde deserialization.
Common situations: Running an adapter version older than a new transaction type (e.g. blobs/EIP-4844 or future EIPs) against a node that includes them; exotic chains with extra fields; node returning `null` where the library expects a value.
Understand the failure class
Background: "failed to unmarshal" / json.Unmarshal errors: why parsing a response into a Go struct fails and how to fix it — this error's family across 23 libraries.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Included wrap transaction {tx_hash} has invalid block number
- RPC error {}: {}
- {method} RPC error {code}
- {method} RPC error {}
- Failed to parse {method} response
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/942bc493357ef571.
Report an issue: GitHub.