use-ink / contracts-ui

Web application for deploying wasm smart contracts on Substrate chains that include the FRAME contracts pallet
https://contracts-ui.substrate.io/
GNU General Public License v3.0
62 stars 48 forks source link

Unnecessary repeating of upload a `CodeRejected` contract over and over again #377

Closed agryaznov closed 1 year ago

agryaznov commented 1 year ago

Describe the bug Seems that Contracts-UI keeps trying to upload the same contract which was rejected with CodeRejected again and again, until we leave the /instantiate view.

To Reproduce Steps to reproduce the behavior:

  1. Launch a local contracts-node with substrate-contracts-node -linfo,runtime::contracts=debug
  2. Go to https://weightv1--contracts-ui.netlify.app/instantiate
  3. Upload some contract which leads to CodeRejected e.g the greeter.contract from this issue description.
  4. See CodeRejected error appeared in the Contract-UI, which is right.
  5. Open to the node's debug log and see the error continues to be raised again and again and again untill you move away from the instantiate view of the Contracts-UI or just close the browser tab. Screenshot from 2022-11-22 16-06-49

Expected behavior The error should have been raised only once on the node side.

Additional context With the same steps repeated in the PolkadotJS, the node raises the error just once, as expected.

athei commented 1 year ago
  1. Launch a local contracts-node with substrate-contracts-node -linfo,runtime::contracts=debug

Those logging parameters are the defaults since a few versions ago btw.

statictype commented 1 year ago

Thanks for reporting this @agryaznov I tried to reproduce it and it only happens with the old Contracts UI and nodes and only in the case of a CodeRejected error so i don't think it's really worth fixing since it such an edge case. Will close this for now but if you think it's important, please reopen!