Custom error 170 on preprod public RPC with ledger-v8 8.0.3, but 8.1.0 deploys fine — version requirement or RPC-specific?

Hi — a question about contract deploy on preprod vs the ledger version requirement.

Setup: a contract built with @midnight-ntwrk/ledger-v8 8.0.3 (compact toolchain 0.30.0, language 0.22.0, midnight-js 4.0.4) deploys fine to mainnet via the foundation RPC and has been running there since May 31. But the exact same 8.0.3 stack, deploying to preprod via the public RPC (rpc.preprod.midnight.network), gets rejected at submit with “1010 Invalid Transaction: Custom error: 170”. Rebuilding the identical contract with ledger-v8 8.1.0 (everything else the same, via temp-log’s lockfile) deploys cleanly to preprod with no 170.

Both networks report the same state_getRuntimeVersion (specVersion 22000, transactionVersion 2).

Question: Is Custom error 170 a ledger-version requirement (i.e. spec 22000 expects ledger 8.1.0 and 8.0.3 tx are no longer valid), or is it specific to the public preprod RPC’s behavior? In other words — for a contract we want to deploy to mainnet, should we be on ledger 8.1.0, or is 8.0.3 still correct for mainnet?

Also: what exactly does Custom error 170 mean (which validation in the runtime)? Couldn’t find it documented.

Thanks!

@takuya Custom error 170 is InvalidDustSpendProof: the node rejected the DUST fee proof on the deploy tx, not the contract deploy proof. See error codes and decode 1010.

Matching specVersion on mainnet and preprod doesn’t mean ledger, proof-server, and wallet stacks are interchangeable. 8.0.3 failing on public preprod while 8.1.0 deploys clean points to a client/proof alignment issue on preprod, not “spec 22000 forbids 8.0.3.” Indexer lag and stale DUST state can also trigger 170 on preprod, but the 8.1.0 fix suggests pinning the whole fee stack (ledger + proof server + wallet/facade per the support matrix) matters more than which RPC hostname you use.

For mainnet vs preprod: pin versions per environment. If preprod needs 8.1.x + a matching proof server, use that for preprod testing even if mainnet still works on 8.0.3 via foundation RPC today.
Also if you are trying to deploy on mainnet you shiuld check this out also
Mainnnet Deployment Guide

Before retrying: proof server matches ledger line, wallet fully synced, fresh DUST, indexer caught up (preprod status).

you can also use this community led effort tool to debug errors like this(not official): midnight-cast using cli commands like mn decode 170, mn tip preprod, mn versions preprod