Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Parity.js cannot deploy contracts from an unlocked node #6540

Closed
travs opened this issue Sep 18, 2017 · 2 comments
Closed

Parity.js cannot deploy contracts from an unlocked node #6540

travs opened this issue Sep 18, 2017 · 2 comments
Labels
F2-bug 🐞 The client fails to follow expected behavior. M8-dapp 💎 Decentralized applications. P5-sometimesoon 🌲 Issue is worth doing soon.

Comments

@travs
Copy link
Contributor

travs commented Sep 18, 2017

Moved from #6536


I'm running:

  • Parity version: Parity/v1.8.0-unstable-b731ccea1-20170903/x86_64-linux-gnu/rustc1.19.0
  • Operating system: Linux
  • And installed: via pacman -S parity-git
  • parity.js installed via npm i @parity/parity.js

What I tried:

// adapted from the README.md
const Api = require('@parity/parity.js').Api;
const transport = new Api.Transport.Http('http://localhost:8545');
const api = new Api(transport);
const abi = [{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}] // from a small contract
const bcode = '6060604 ... a0029' // large bytecode string
const contract = new api.newContract(abi);
contract.deploy({data: bcode});

Expected result: Contract deployed on Kovan network.

Actual result:

The promise is rejected with "request not found", but the transaction appears to have succeeded:

parity_checkRequest(["0x76161b35c213a8ce6d9073f6ece2be7fc5ce31ad9cf910670788811df4925a46"]): -32042: Request not found.                     
pollMethod { e: parity_checkRequest: -32042: Request not found.                                
    at /home/travis/prg/protocol/node_modules/@parity/parity.js/library.js:1:161621            
    at <anonymous>     
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)                       
  code: -32042,        
  type: 'REQUEST_NOT_FOUND',                   
  method: 'parity_checkRequest',               
  text: 'Request not found.' }                 
(node:15338) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 7): e: parity_checkRequest: -32042: Request not found.

I am running parity as an unlocked node with the following options:

ACCOUNT_LIQPROV='0x00360d2b7D240Ec0643B6D819ba81A09e40E5bCd'

parity \
  --chain kovan \
  --author $ACCOUNT_LIQPROV \
  --unlock $ACCOUNT_LIQPROV \
  --password ~/prg/keys/kovan/account_liqprov \
  --rpcport 8545 \
  --force-ui

Update:

Can confirm this also occurs on version Parity/v1.7.0-beta-5f2cabd6e-20170727/x86_64-linux-gnu/rustc1.19.0

@travs
Copy link
Contributor Author

travs commented Sep 19, 2017

This may be because I am running on an unlocked node.
Looking at this block of code, if postTransaction returns a hash, as it does in the unlocked node case then maybe this confuses the next function in the block, which expects an id.

Update:

Confirmed, this is due to postTransaction returning a hash. Works fine when using a locked node.

Updated the issue name to reflect the state. Would make a quick PR but not quite sure how you guys would like to resolve this. Perhaps unlocked nodes are not even meant to be supported here.

My intuition would be to skip the checkRequest altogether if we get a tx hash back from the postTransaction call, but maybe there is a scenario I'm not considering

@travs travs changed the title Deploying contract to Kovan results in "Request not found" error, though the tx succeeds Parity.js cannot deploy contracts from an unlocked node Sep 19, 2017
@5chdn 5chdn added F2-bug 🐞 The client fails to follow expected behavior. M7-ui M8-dapp 💎 Decentralized applications. P5-sometimesoon 🌲 Issue is worth doing soon. labels Sep 19, 2017
@travs
Copy link
Contributor Author

travs commented Sep 19, 2017

With @tomusdrw : Moved here ; PR there shortly

@travs travs closed this as completed Sep 19, 2017
@travs travs reopened this Sep 19, 2017
travs pushed a commit to travs/parity that referenced this issue Sep 19, 2017
- just skip the checkRequest call if result of postTransaction is a tx ID
travs pushed a commit to travs/parity that referenced this issue Sep 20, 2017
- just skip the checkRequest call if result of postTransaction is a tx ID
travs pushed a commit to travs/parity that referenced this issue Sep 20, 2017
- just skip the checkRequest call if result of postTransaction is a tx ID
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F2-bug 🐞 The client fails to follow expected behavior. M8-dapp 💎 Decentralized applications. P5-sometimesoon 🌲 Issue is worth doing soon.
Projects
None yet
Development

No branches or pull requests

2 participants