Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Network id configuration doesn't protect user from deploying to different network #1316

Closed
tcoulter opened this issue Oct 3, 2018 · 5 comments

Comments

@tcoulter
Copy link
Contributor

tcoulter commented Oct 3, 2018

As we saw during the retreat demo, if you specify a specific number in your truffle config (say, 3), if the actual network id of the chain doesn't match, Truffle won't error (and it should, to protect the user from inadvertently deploying with real Ether).

Steps to repro:

  1. Set Truffle config network id to 3.
  2. Deploy to rinkeby (which has network id of 4). Notice Truffle doesn't error, and performs the deployment.

Note: This bug report was written very quickly because we're at the retreat demo. Feel free to ask me any questions if the above is unclear.

@stale
Copy link

stale bot commented Dec 2, 2018

Thank you for raising this issue! It has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you would like to keep this issue open, please respond with information about the current state of this problem.

@stale stale bot added the stale label Dec 2, 2018
@gnidan
Copy link
Contributor

gnidan commented Dec 2, 2018

Not stale

@stale
Copy link

stale bot commented Dec 2, 2018

Thanks for your response! This issue is no longer considered stale and someone from the Truffle team will try to respond as soon as they can.

@gnidan
Copy link
Contributor

gnidan commented Dec 12, 2018

Colony's build is failing, seems to be a result of the change in the above PR.

Relevant CI output:

...
Summary
=======
> Total deployments:   13
> Final cost:          0 ETH

Error: [object Object]
    at detectNetworkId (/home/circleci/colonyNetwork/node_modules/truffle/build/webpack:/packages/truffle-core/lib/environment.js:73:1)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:182:7)
Truffle v5.0.0-next.20 (core: 5.0.0-beta.2)

Looks like the error is constructed wrong here, although I might just be blanking on whether { message: "..." } is kosher.

Hard to say if there's a real problem, we may have caught a mismatch in the test suite :)

attn @eggplantzzz
cc @elenadimitrova

@gnidan
Copy link
Contributor

gnidan commented Jan 2, 2019

This is done and released in v5.0.0. Let us know if you run into it again! Thanks!

@gnidan gnidan closed this as completed Jan 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants