AcalaNetwork / chopsticks

Create parallel reality of your Substrate network.
Apache License 2.0
133 stars 80 forks source link

Extrinsic events not fired in some cases #736

Closed Tbaut closed 5 months ago

Tbaut commented 5 months ago

I'm running tests against chopsticks, and depending on the environment, the same UI and the same node will not fire events for some reason.

This is the logs in test using Cypress, so it's also running the UI and clicking on buttons:

Transaction status: Ready
Transaction status: Broadcast
Transaction status: Finalized
Finalized block hash 0xdfd2e17fe46defa98bfc6b6e438de0530b241075593bbfa5fe8fe69b48e9a26f

And this is the same UI, the same Chopsticks node, but doing the TX manually, as in, I click manually.

17:03:38.562 Transaction status: Ready 
17:03:38.562 Transaction status: Broadcast 
17:03:39.950 Transaction status: InBlock 
17:03:39.950 Included at block hash 0xfc977e5c7639c08c76fa4729e1f9e979a2d0066b3261c0672f1b19df56e54e07 
17:03:39.950 Events: 
17:03:39.950     {"applyExtrinsic":2} : balances.Withdraw ["EM7dkh4fT7Jt2FBQgdBx5pJsgLvybVBa2RTdSLX5hXh7hkB",598147229] 
17:03:39.950     {"applyExtrinsic":2} : balances.Unreserved ["HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F",671733327600] 
17:03:39.951     {"applyExtrinsic":2} : balances.Reserved ["GBXkzWDr6Qe3HoJ2b163niqdyB7vTpc5u7to2Na48U3WqGP",668033331300] 
17:03:39.951     {"applyExtrinsic":2} : proxy.PureCreated ["GBJDQYJ8RmSqkCbSDGaUfVzdSQ2rTD1T2d572mfcaFmipKz","GBXkzWDr6Qe3HoJ2b163niqdyB7vTpc5u7to2Na48U3WqGP","Any",0] 
17:03:39.952     {"applyExtrinsic":2} : multisig.MultisigExecuted ["EM7dkh4fT7Jt2FBQgdBx5pJsgLvybVBa2RTdSLX5hXh7hkB",{"height":22568292,"index":2},"GBXkzWDr6Qe3HoJ2b163niqdyB7vTpc5u7to2Na48U3WqGP","0xe133e6f11af51d883e56216e9e1bbb1e2920c7c6120cbb55cd469b1f95b61601",{"ok":null}] 
17:03:39.952     {"applyExtrinsic":2} : balances.Deposit ["F3opxRbN5ZbjJNU511Kj2TLuzFcDq9BGduA9TgiECafpg29",478517783] 
17:03:39.952     {"applyExtrinsic":2} : treasury.Deposit [478517783] 
17:03:39.952     {"applyExtrinsic":2} : balances.Deposit ["CrwYWvzJzf4qqAPuaHwfQCJwSijgwuiD4YKLSYwPi5dsJsz",119629446] 
17:03:39.953     {"applyExtrinsic":2} : transactionPayment.TransactionFeePaid ["EM7dkh4fT7Jt2FBQgdBx5pJsgLvybVBa2RTdSLX5hXh7hkB",598147229,0] 
17:03:39.953     {"applyExtrinsic":2} : system.ExtrinsicSuccess [{"weight":{"refTime":554235224,"proofSize":11517},"class":"Normal","paysFee":"Yes"}] 
17:03:40.005 Transaction status: Finalized 
17:03:40.006 Finalized block hash 0xfc977e5c7639c08c76fa4729e1f9e979a2d0066b3261c0672f1b19df56e54e07

Do you have an idea why this could happen?

ermalkaleci commented 5 months ago

maybe process it terminated before logs are printed?

Tbaut commented 5 months ago

thanks for the answer and idea. There is something funky happening with the callback of signAndSend but this is definitely not related to chopstick. It must be in my code..

wischli commented 4 months ago

@Tbaut Did you figure out your issue? I am experiencing similar problems and cannot sign more than one transaction via signAndSend when connected to a Chopsticks RPC using Polkadot JS.

Tbaut commented 4 months ago

@wischli I doubt it'll help, but in my case I had an infinite loop due to some React effect dependancies :roll_eyes: it was only visible when running tests. It had really nothing to do with Chopsticks.