paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.77k stars 632 forks source link

Query Fee Details no longer works on Westend and Kusama #4770

Closed trevor-crypto closed 2 months ago

trevor-crypto commented 2 months ago

Is there an existing issue?

Experiencing problems? Have you tried our Stack Exchange first?

Description of bug

The RPC call - payment_queryFeeDetails and state call TransactionPaymentApi_query_fee_details are no longer working.

On Westend, it appears that the state call is no longer available, but the RPC call still remains, but ultimately calls the same code which is no longer there, but the RPC call is still present.

The error is as follows:

Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:\nerror while executing at wasm backtrace:
    0: 0x71d10 - <unknown>!rust_begin_unwind
    1: 0xc920 - <unknown>!core::panicking::panic_fmt::h7d22643b0becf577
    2: 0x2664af - <unknown>!TransactionPaymentApi_query_fee_details")

Is there another endpoint that is available but undocumented, where fees can be calculated?

Thanks

Steps to reproduce

No response

bkontur commented 2 months ago

@serban300 Just in case, isn't it the same issue we had yesterday? That extrinsic should include CheckMetadataHash extension stuff?

bkontur commented 2 months ago

@trevor-crypto How did you trigger that calls? And how did you prepare data for those calls?

trevor-crypto commented 2 months ago

@bkontur I am using my own substrate library .

It can also be replicated through polkadot.js: image

bkontur commented 2 months ago

@trevor-crypto and how or where do you construct xt_hex_prefixed: &str? Could you please point me to that code?

trevor-crypto commented 2 months ago

@bkontur Sure.

You first construct the extrinsic.

Then the extrinsic is encoded

Then you can convert it to hex

Take a look at the examples for more details.

The code was and is still working for the chains that haven't been updated, which is why I think this was a breaking change.

bkontur commented 2 months ago

I think your GenericExtra could be the problem: https://github.com/trevor-crypto/pdotc/blob/master/src/lib.rs#L123-L134 it does not count with new CheckMetadataHash extension, which was added to the Westend: https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.11.0/polkadot/runtime/westend/src/lib.rs#L797C35-L797C52

We had to fix the same for our BridgeHubKusama yesterday, our fix: https://github.com/paritytech/parity-bridges-common/pull/3011/files#diff-46585d86003b12fcb45eacb4c7b2b45aa64d497ed66dae036144e2d38f4abeb4R36-R49

trevor-crypto commented 2 months ago

@bkontur Thanks! This does seem to be the issue. I've verified using PolkadotJS for now.

Quite the misleading error message!