This is a minimal reproducible example of an issue with starknet-rs library when sending transactions via execute_v3().
Error: JSON-RPC error: code=-32602, message="Invalid params",
data={"reason":"missing field: \"l1_data_gas\""}
cargo new starknet_rpc_issue
cd starknet_rpc_issue- Copy
minimal_repro.rs→src/main.rs - Copy
minimal_repro_Cargo.toml→Cargo.toml
export STARKNET_RPC_URL="https://starknet-sepolia.public.blastapi.io/rpc/v0_7"
export STARKNET_ACCOUNT_ADDRESS="0x34f8a494958da4baf6cb3dece3bcb6b634792311cde25e94fc4b8a3b0cddbbb"
export STARKNET_PRIVATE_KEY="0x65ec6ec925b60110f4b2bffccd6782102faa51676088f71dd3633771e3ee489"
export BRIDGE_CONTRACT="0x02d2d7992105dad299bd0877595e7172fb5f7ca527dcf69d92a6c98640c7522c"cargo runThe program will fail with:
❌ Error occurred:
JSON-RPC error: code=-32602, message="Invalid params", data={"reason":"missing field: \"l1_data_gas\""}
- Library: starknet-rs @
171b0c65cac407ee33972e0ab2c3f8744c083753 - RPC Endpoint: Blast API (Sepolia)
- Network: Starknet Sepolia
- Transaction Version: v3 with
ExecutionEncoding::New
| Attempt | Result |
|---|---|
Using ExecutionEncoding::New |
✅ Correct setup but still fails |
| RPC endpoint v0_7 | ❌ Same error |
| RPC endpoint v0_9 | ❌ Same error |
Using execute_v1() |
❌ "UnsupportedTxVersion" |
Using execute() (v2) |
❌ "UnsupportedTxVersion" |
CLI tools work fine:
sncast --account=sepolia invoke \
--contract-address=0x02d2d7992105dad299bd0877595e7172fb5f7ca527dcf69d92a6c98640c7522c \
--function=claim_deposit \
--arguments <ARGS> \
--network=sepolia- Is this a known compatibility issue with this library version?
- Should we use a different RPC endpoint (Infura, Alchemy)?
- Do we need to manually set resource bounds?
- Is there a newer stable version that fixes this?
- Does the library version match what's expected by the RPC endpoint?
Upload these 3 files to GitHub Gist:
minimal_repro.rs(rename tomain.rsin gist)minimal_repro_Cargo.toml(rename toCargo.tomlin gist)- This README (rename to
README.mdin gist)