Skip to content

0x7365746265726E/stark-v3-contract-call

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starknet RPC execute_v3 Issue - Minimal Reproduction

This is a minimal reproducible example of an issue with starknet-rs library when sending transactions via execute_v3().

Error

Error: JSON-RPC error: code=-32602, message="Invalid params",
data={"reason":"missing field: \"l1_data_gas\""}

Setup

1. Create new project

cargo new starknet_rpc_issue
cd starknet_rpc_issue

2. Replace files

  • Copy minimal_repro.rssrc/main.rs
  • Copy minimal_repro_Cargo.tomlCargo.toml

3. Set environment variables

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"

4. Run

cargo run

Expected Output

The program will fail with:

❌ Error occurred:
   JSON-RPC error: code=-32602, message="Invalid params", data={"reason":"missing field: \"l1_data_gas\""}

Environment

  • Library: starknet-rs @ 171b0c65cac407ee33972e0ab2c3f8744c083753
  • RPC Endpoint: Blast API (Sepolia)
  • Network: Starknet Sepolia
  • Transaction Version: v3 with ExecutionEncoding::New

Things Tried

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"

Workaround

CLI tools work fine:

sncast --account=sepolia invoke \
  --contract-address=0x02d2d7992105dad299bd0877595e7172fb5f7ca527dcf69d92a6c98640c7522c \
  --function=claim_deposit \
  --arguments <ARGS> \
  --network=sepolia

Questions

  1. Is this a known compatibility issue with this library version?
  2. Should we use a different RPC endpoint (Infura, Alchemy)?
  3. Do we need to manually set resource bounds?
  4. Is there a newer stable version that fixes this?
  5. Does the library version match what's expected by the RPC endpoint?

Files for Gist

Upload these 3 files to GitHub Gist:

  1. minimal_repro.rs (rename to main.rs in gist)
  2. minimal_repro_Cargo.toml (rename to Cargo.toml in gist)
  3. This README (rename to README.md in gist)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages