I am also getting a similar error. But mine comes when I try making a write function call to a smart contract that’s deployed on sepolia.
This is the error
Call was rejected:
Request ID: 13ce59c70a8e2f4b03cca578736374d7b942e21e5299f96217d81abc4e102536
Reject code: 5
Reject text: Error from Canister taanb-caaaa-aaaad-aaevq-cai: Canister called `ic0.trap` with message: Error: HttpOutcallError(IcError { code: SysTransient, message: "No consensus could be reached. Replicas had different responses. Details: request_id: 7106094, timeout: 1736802971612371815, hashes: [e05b4f4ddcdc6b5318197c75c4c877d019720e4416afac1ffcef43239b22a12e: 17], [9fbe9b9b8814c8707038c834bbd380e813cf0a360aa5e67e205d57f4a583b480: 7], [892ba6b28a2fe8df8440bc7a5ad9d16ed34a180cefc81b589329596dfdda9641: 6]" }).
Consider gracefully handling failures from this canister or altering the canister to handle exceptions. See documentation: http://internetcomputer.org/docs/current/references/execution-errors#trapped-explicitly
This is how my code looks like
// rest of code
let result = contract_interaction(
contract_details,
value,
get_rpc_services(),
fee_estimates.max_priority_fee_per_gas,
key_id(),
vec![],
EVM_RPC,
).await.map_err(|(code, msg)| format!("Error {:?}: {}", code, msg))?;
// rest of code
This is the get_rpc_services() function that’s returning the error
fn get_rpc_services() -> RpcServices {
RpcServices::Custom {
chainId: 11155111,
services: vec![
RpcApi {
url: "https://eth-sepolia.g.alchemy.com/v2/<my_api_key>".to_string(),
headers: None,
},
RpcApi {
url: "https://sepolia.infura.io/v3/<my_api_key>".to_string(),
headers: None,
}
]
}
}
I have tried all other methods and none of them was successful
- Using only a single RPC service
fn get_rpc_service() -> RpcApi {
RpcApi {
url: "https://eth-sepolia.g.alchemy.com/v2/<my_api_key>".to_string(),
headers: None,
}
}
// rest of my code
let result = contract_interaction(
contract_details,
value,
RpcServices::Custom {
chainId: 11155111,
services: vec![get_rpc_service()]
},
fee_estimates.max_priority_fee_per_gas,
key_id(),
vec![],
EVM_RPC,
).await.map_err(|(code, msg)| format!("Error {:?}: {}", code, msg))?;
- Using multiple RPC services from the evm_rpc_canister_services package
// rest of my code
let result = contract_interaction(
contract_details,
value,
RpcServices::EthSepolia(Some(vec![
EthSepoliaService::PublicNode,
EthSepoliaService::BlockPi,
EthSepoliaService::Ankr,
])),
fee_estimates.max_priority_fee_per_gas,
key_id(),
vec![],
EVM_RPC,
).await.map_err(|(code, msg)| format!("Error {:?}: {}", code, msg))?;
// rest of my code
All of them were returned the same error of no consensus could be reached