HTTP Outcalls to Infura Goerli test nets using Rust [Error : RejectionCode: SysTransient ]

Here is my code

let final_tx = format!("{}{}","0x",tx_sign);
    let rpc_request = RpcRequest{
        id:"1".into(),
        jsonrpc:"2.0".into(),
        method:"eth_gasPrice".into(),
        params:vec![]
    };
    let json_rpc = serde_json::to_vec(
        &rpc_request
    ).map_err(|e| format!("hex::decode failed: {}", e))?;
    let request = CanisterHttpRequestArgument{
        url:"https://goerli.infura.io/v3/blabla".to_string(),
        max_response_bytes: Some(400000),
        method:HttpMethod::POST,
        headers:vec![
            HttpHeader{
                name:"Content-Type".to_string(),
                value:"application/json".to_string()
            }
        ],
        body: Some(
            json_rpc
        ),
        transform:Some(TransformContext::new(transform, vec![]))
        
    };
    
    match http_request(request).await {
        Ok((result,))=>{
            
            Ok(SignOutput{
                tx_sign:format!("{:?}",result.body)
            })
        }
        Err((r, m)) => {
            let message =
                format!("The http_request resulted into error. RejectionCode: {r:?}, Error: {m}");
            Err(message)
        }
    }

and here is my transformer

#[query]
fn transform(raw: TransformArgs) -> HttpResponse {
    let mut res = HttpResponse {
        status: raw.response.status.clone(),
        ..Default::default()
    };
    if res.status == 200 {
        res.body = raw.response.body;
    } else {
        ic_cdk::api::print(format!("Received an error from jsonropc: err = {:?}", raw));
    }
    res
}

The full error is looking like this

The http_request resulted into error. RejectionCode: SysTransient, Error: Failed to connect: error trying to connect: tcp connect error: deadline has elapsed

Is the URL available over IPv6? AFAIK this is the most common source of problems with outcalls

I don’t know if Infura Node providers support IPV6 , i think it should do because a ic-web3 library used the same infura provider

How do i even check if the Node Providers supports IPV6 , i can’t find anything in there docs …

Looks like it does not

:smiling_face_with_tear: is there any node provider that is IpV6

yep, @dieter.sommer prepared a list here

2 Likes

Infura is an IPv4-only provider, but we have ~7 IPv6-capable providers in the list mentioned by @domwoe above.

1 Like

We are happy to announce that gateway.fm now supports IPv6 as well for the Ethereum mainnet API offering! Many thanks to the gateway.fm team for making this happen for the IC community! :tada: :rocket: :partying_face:

Gateway.fm are worth a recommendation as an API provider for HTTPS outcalls!

4 Likes