polkadot-js / api

Promise and RxJS APIs around Polkadot and Substrate based chains via RPC calls. It is dynamically generated based on what the Substrate runtime provides in terms of metadata.
Apache License 2.0
1.06k stars 343 forks source link

api.at warn Unable to map [u8; 32] to a lookup index #5871

Open jiqiang90 opened 2 months ago

jiqiang90 commented 2 months ago

We are recently update to v11, and we found decorated method api.at will throw warning, this flood so all other logs within our app, it also lead other logs monitoring app crashes.

To reproduce this:

const { ApiPromise, WsProvider } = require(`@polkadot/api`)
const provider = new WsProvider('wss://rpc-polkadot.luckyfriday.io');

async function main(){
    const api = await ApiPromise.create({provider});
    // block height 38565
    const apiAt = await api.at('0xad17bc48645d34fb7e7109f047d027d7db21cfda17e4bade2007a247e47f7c79');
}

main().catch(e=>process.exit(1));

this should warn

Unable to map [u8; 32] to a lookup index

Improved logging

TarikGul commented 2 months ago

rel: https://github.com/polkadot-js/api/pull/5764

I will have this on the project board queue, but I don't see much that can be done to resolve this. At best we can switch the type of logging so that it can be turned off and or reduced.