Hi, I am trying to get fee history from supported L2s, using the EVM_RPC canister and am seeing very mixed results.
Some times⦠ok
2024-07-15 12:25:25.454614 UTC: [Canister 7hfb6-caaaa-aaaar-qadga-cai] DEBUG .../mod.rs:185 [parallel_call]: will call provider: Ankr
2024-07-15 12:25:25.454614 UTC: [Canister 7hfb6-caaaa-aaaar-qadga-cai] TRACE_HTTP .../eth_rpc.rs:816 Calling url: https://rpc.ankr.com/base, with payload: {"jsonrpc":"2.0","method":"eth_feeHistory","id":37,"params":["0x4","latest",[]]}
2024-07-15 12:25:28.766707 UTC: [Canister bkyz2-fmaaa-aaaaa-qaaaq-cai] Fee history result: Ok((Consistent(Ok(Some(FeeHistory { reward: [], gasUsedRatio: [0.13932819487179487, 0.15907986666666668, 0.2015082769230769, 0.15850429743589745], oldestBlock: Nat(17128486), baseFeePerGas: [Nat(8342279), Nat(8336806), Nat(8335289), Nat(8342258), Nat(8340624)] }))),))
Next time, same code, InvalidHttpJsonRpcResponse
:
2024-07-15 12:26:25.594063 UTC: [Canister 7hfb6-caaaa-aaaar-qadga-cai] DEBUG .../mod.rs:185 [parallel_call]: will call provider: Ankr
2024-07-15 12:26:25.594063 UTC: [Canister 7hfb6-caaaa-aaaar-qadga-cai] TRACE_HTTP .../eth_rpc.rs:816 Calling url: https://rpc.ankr.com/base, with payload: {"jsonrpc":"2.0","method":"eth_feeHistory","id":38,"params":["0x4","latest",[]]}
2024-07-15 12:26:28.193404 UTC: [Canister bkyz2-fmaaa-aaaaa-qaaaq-cai] Fee history result: Ok((Consistent(Err(HttpOutcallError(InvalidHttpJsonRpcResponse { status: 200, body: "{\"jsonrpc\":\"2.0\",\"error\":{\"code\":0,\"message\":\"we can't execute this request\"},\"id\":null}", parsingError: Some("invalid type: null, expected u64 at line 1 column 87") }))),))
Same call, but to mainnet instead of an L2 seems to be reliably working.
...
let rpc_providers = RpcServices::EthMainnet(Some(vec![EthMainnetService::Ankr]));
// let rpc_providers = RpcServices::Optimism(Some(vec![L2MainnetService::Ankr]));
// let rpc_providers = RpcServices::BaseMainnet(Some(vec![L2MainnetService::Ankr]));
// let rpc_providers = RpcServices::ArbitrumOne(Some(vec![L2MainnetService::Ankr]));
let result = EVM_RPC
.eth_fee_history(
rpc_providers,
None,
FeeHistoryArgs {
blockCount: ETH_AVG_FEE_HISTORY_BLOCK_COUNT.into(),
newestBlock: BlockTag::Latest,
rewardPercentiles: None,
},
ETH_DEFAULT_CALL_CYCLES_128,
)
.await;
...
What is the current status of the L2 support in the EVM_RPC canister @rvanasa @gregory-demay? Should optimism/base/arbitrum be working as stably as mainnet and sepolia?