Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Adding casper deployment instruction to readme.md #152 #162

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

GagziW
Copy link

@GagziW GagziW commented Jun 1, 2018

No description provided.

@GagziW GagziW changed the title [WIP] Adding casper deployment instruction to readme.md [WIP] Adding casper deployment instruction to readme.md #152 Jun 1, 2018
@zaq1tomo
Copy link
Contributor

zaq1tomo commented Jun 6, 2018

According to your README, params of init() like this.

casper_args = [
  EPOCH_LENGTH,
  WARM_UP_PERIOD,
  WITHDRAWAL_DELAY,
  DYNASTY_LOGOUT_DELAY,
  msg_hasher_address,
  purity_checker_address,
  BASE_INTEREST_FACTOR,
  BASE_PENALTY_FACTOR,
  MIN_DEPOSIT_SIZE
]

But in https://github.com/ethereum/casper/blob/master/casper/contracts/simple_casper.v.py#L130
like this.

def init(
        epoch_length: int128,
        warm_up_period: int128,
        withdrawal_delay: int128,
        dynasty_logout_delay: int128,
        msg_hasher: address,
        purity_checker: address,
        null_sender: address,
        base_interest_factor: decimal,
        base_penalty_factor: decimal,
        min_deposit_size: wei_value
        ):

I do not have confidence, but I think that
your README might be lack of a parameter of null_sender.

@zaq1tomo
Copy link
Contributor

zaq1tomo commented Jun 6, 2018

e.g.

null_sender_address = base_tester.get_accounts()[-2]

casper_args = [
  EPOCH_LENGTH,
  WARM_UP_PERIOD,
  WITHDRAWAL_DELAY,
  DYNASTY_LOGOUT_DELAY,
  msg_hasher_address,
  purity_checker_address,
  null_sender_address,
  BASE_INTEREST_FACTOR,
  BASE_PENALTY_FACTOR,
  MIN_DEPOSIT_SIZE
]

Copy link
Contributor

@djrtwo djrtwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see y'all made it through the deploy!

I generally want to be less verbose in the readme. The high level details are more important than the python specific implementation.

Take a look at my notes and let me know if you ahve any questions.

README.md Outdated

### Step 1: Imports
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want this to be way less system specific. Think, high level notes and a little bit of pseudocode. So we don't need to deal with imports

README.md Outdated

### Step 2: Raise the Gas Limit

```bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just note that the contract costs a lot of gas (can give a number) and that if they are deploying via a normal CREATE tx, then they need to make sure the block gas limit is high enough

README.md Outdated

[Link to the web3.py documentation.](https://github.com/ethereum/web3.py)
```bash
base_tester = EthereumTester(PyEVMBackend()) ## instantiates the eth-test suite
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just assume a web3 object exists. People will be deploying via all sorts of framekworks so the particulars here aren't important.

README.md Outdated

### Step 4: Deploy Helper Contracts
NOTE: In addition to the two helper contracts `msg_hasher` and `purity_checker` you also need to deploy the `rlp_decoder` Contract. On a production chain, an `rlp_decoder` contract is already deployed and vyper’s standard internal library knows it’s address and gives vyper contracts access to some functionality at that address.
**When using a test chain, these helper contract must be deployed before the casper contract.**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important to note that rlp_decoder must be deployed before compiling the casper contract.

README.md Outdated
NOTE: In addition to the two helper contracts `msg_hasher` and `purity_checker` you also need to deploy the `rlp_decoder` Contract. On a production chain, an `rlp_decoder` contract is already deployed and vyper’s standard internal library knows it’s address and gives vyper contracts access to some functionality at that address.
**When using a test chain, these helper contract must be deployed before the casper contract.**

NOTE: these helper contracts are currently written in serpenat, so until they are converted to Vyper it is best to use the hardcoded transaction hex below.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"These helper contracts can be deployed via the below pre-signed txs. Instructions for compiling and deploying via other methods will soon be available."

README.md Outdated
### Step 6: Compiling and Deploying Casper
```bash

file = open(os.getcwd()+('/casper/contracts/simple_casper.v.py')) #this will change depending on where the casper contract is located relative to your current working directory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should show how casper is compiled from the command line, rather than from python. Don't worry about showing how to open files.

vyper simple_casper.v.py
vyper -f abi simple_casper.v.py

@zaq1tomo
Copy link
Contributor

zaq1tomo commented Jun 7, 2018

I am glad to receive your reply.

I understand your policy but your readme maybe incorrect.

README.md Outdated
w3.eth.sendTransaction({'to': casper_address, 'value': 10**21})

casper_contract = w3.eth.contract(address=casper_address, abi=casper_abi)
casper_contract.functions.init(*casper_args).transact()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it will not work with the latest version because casper_args is not correct.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the hint. I will double check this issue.

@zaq1tomo
Copy link
Contributor

zaq1tomo commented Jun 7, 2018

I made a pull request to fix "casper_args".

GagziW#1

If you like, please refer it. Thanks.

@GagziW
Copy link
Author

GagziW commented Jun 11, 2018

@djrtwo I tried to incorporate your comments. Please review.

@vs77bb
Copy link

vs77bb commented Jun 18, 2018

Hi @djrtwo I think this one might be with you for review, no? Hope you're doing well 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants