Skip to content

Commit

Permalink
fix: improve verification instructions (#414)
Browse files Browse the repository at this point in the history
* Cleanup

* cleanup

* Cleanup pip

* Improve

* Improve verification steps

* Update
  • Loading branch information
guibescos authored Mar 13, 2024
1 parent 809b213 commit 1c7632a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
18 changes: 10 additions & 8 deletions docs/pips/operational/op-pip-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ Branch: [`chore/evm/blast-claim-gas`](https://github.com/pyth-network/pyth-cros

* Verify the implementation following the guide below:

1. Make sure you node-js and forge installed.
2. node-js: install `nvm` from [here](https://github.com/nvm-sh/nvm)
3. forge: install it from [here](https://getfoundry.sh/)
4. Clone the `pyth-crosschain` repo (`git clone https://github.com/pyth-network/pyth-crosschain.git`) and run the following command: `npm ci && npx lerna run build`
5. Go to the proposal code branch (`git checkout <branch name>`)
6. Get the on-chain implementation code digest by going to the `contract_manager` directory and running `npx ts-node scripts/check_proposal.ts --cluster mainnet-beta --proposal <proposal id>`
7. Get the source code digest by going to the `target_chains/ethereum/contracts` directory and running `npx truffle compile --all && cat build/contracts/PythUpgradable.json | jq -r .deployedBytecode | tr -d '\n' | cast keccak`
8. Check the hash digest from the on-chain implementation (from step 6) matches the hash digest from the source code (from step 7).
1. Make sure you have node-js, forge and jq installed.
1. node-js: install `nvm` from [here](https://github.com/nvm-sh/nvm). Install node-js 18 (`nvm install 18; nvm use 18`).
2. forge: install it from [here](https://getfoundry.sh/)
3. jq: install it from [here](https://jqlang.github.io/jq/)
2. Clone the `pyth-crosschain` repo (`git clone https://github.com/pyth-network/pyth-crosschain.git`). Go to the `pyth-crosschain` directory and run the following command: `npm ci && npx lerna run build`
3. Go to the proposal code branch (`git checkout <branch name>`)
4. Get the on-chain implementation code digest by going to the `contract_manager` directory and running `npx ts-node scripts/check_proposal.ts --cluster mainnet-beta --proposal <proposal id>`
5. Get the source code digest by going to the `target_chains/ethereum/contracts` directory and running `npx truffle compile --all && cat build/contracts/PythUpgradable.json | jq -r .deployedBytecode | tr -d '\r\n' | cast keccak`
6. Check the hash digest from the on-chain implementation (from step 4) matches the hash digest from the source code (from step 5).


p.s: the codes above are not merged in our contract because these are one-off and cannot be in our generic smart-contract. We will store the diff in the repo like [this](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/contracts/canto-deployment-patch.diff) one.
18 changes: 10 additions & 8 deletions docs/pips/operational/op-pip-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ Branch: [`chore/evm/mode-claim-gas`](https://github.com/pyth-network/pyth-cross

* Verify the implementation following the guide below:

1. Make sure you node-js and forge installed.
2. node-js: install `nvm` from [here](https://github.com/nvm-sh/nvm)
3. forge: install it from [here](https://getfoundry.sh/)
4. Clone the `pyth-crosschain` repo (`git clone https://github.com/pyth-network/pyth-crosschain.git`) and run the following command: `npm ci && npx lerna run build`
5. Go to the proposal code branch (`git checkout <branch name>`)
6. Get the on-chain implementation code digest by going to the `contract_manager` directory and running `npx ts-node scripts/check_proposal.ts --cluster mainnet-beta --proposal <proposal id>`
7. Get the source code digest by going to the `target_chains/ethereum/contracts` directory and running `npx truffle compile --all && cat build/contracts/PythUpgradable.json | jq -r .deployedBytecode | tr -d '\n' | cast keccak`
8. Check the hash digest from the on-chain implementation (from step 6) matches the hash digest from the source code (from step 7).
1. Make sure you have node-js, forge and jq installed.
1. node-js: install `nvm` from [here](https://github.com/nvm-sh/nvm). Install node-js 18 (`nvm install 18; nvm use 18`).
2. forge: install it from [here](https://getfoundry.sh/)
3. jq: install it from [here](https://jqlang.github.io/jq/)
2. Clone the `pyth-crosschain` repo (`git clone https://github.com/pyth-network/pyth-crosschain.git`). Go to the `pyth-crosschain` directory and run the following command: `npm ci && npx lerna run build`
3. Go to the proposal code branch (`git checkout <branch name>`)
4. Get the on-chain implementation code digest by going to the `contract_manager` directory and running `npx ts-node scripts/check_proposal.ts --cluster mainnet-beta --proposal <proposal id>`
5. Get the source code digest by going to the `target_chains/ethereum/contracts` directory and running `npx truffle compile --all && cat build/contracts/PythUpgradable.json | jq -r .deployedBytecode | tr -d '\r\n' | cast keccak`
6. Check the hash digest from the on-chain implementation (from step 4) matches the hash digest from the source code (from step 5).


p.s: the codes above are not merged in our contract because these are one-off and cannot be in our generic smart-contract. We will store the diff in the repo like [this](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/contracts/canto-deployment-patch.diff) one.

0 comments on commit 1c7632a

Please sign in to comment.