Skip to content

Commit

Permalink
fix benchmarking results (#1522)
Browse files Browse the repository at this point in the history
* manual deploy nightly

* set up test devnet

* run load test

* run ansible

* one-liner

* final run with properly premined test account

* delete the test state and do final run

* remove 1559 stuff that is not needed for nightly
  • Loading branch information
gatsbyz committed May 23, 2023
1 parent 7783770 commit 7212da4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/deploy.nightly.devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ jobs:
env:
TF_VAR_deployment_name: ${{ secrets.TF_VAR_DEPLOYMENT_NAME }}
TF_VAR_owner: ${{ secrets.TF_VAR_OWNER }}
- name: Retrieve state file from s3
run: aws s3 cp s3://polygon-edge-devnet-tf-states/state/${{ secrets.TF_VAR_DEPLOYMENT_NAME }} state.json
- name: Configure private keys
run: |
terraform output pk_ansible > ~/devnet_private.key
Expand Down Expand Up @@ -116,6 +118,7 @@ jobs:
polygon-edge polybft-secrets --data-dir {{ hostvars[item].tags["Name"] }} --json --insecure > {{ hostvars[item].tags["Name"] }}.json
{% endif %}
{% endfor %}
polygon-edge genesis \
--consensus polybft \
{% for item in hostvars %}{% if (hostvars[item].tags.Role == "fullnode" or hostvars[item].tags.Role == "validator") %} --bootnode /dns4/{{ hostvars[item].tags["Name"] }}/tcp/{{ edge_p2p_port }}/p2p/$(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].node_id') {% endif %}{% endfor %} \
Expand All @@ -125,24 +128,26 @@ jobs:
--premine 0xA39Fed214820cF843E2Bcd6cA1759257a530894B:1000000000000000000000000000 \
--premine 0x181d9fEc79EC674DD3cB30dd9dd4188E737939FE:1000000000000000000000000000 \
--premine 0x1AB8C3df809b85012a009c0264eb92dB04eD6EFa:1000000000000000000000000000 \
--block-gas-limit {{ block_gas_limit }} --block-time {{ block_time }}s \
--block-gas-limit {{ block_gas_limit }} --block-time {{ block_time }}s \
{% for item in hostvars %}{% if (hostvars[item].tags.Role == "validator") %} --validators /dns4/{{ hostvars[item].tags["Name"] }}/tcp/{{ edge_p2p_port }}/p2p/$(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].node_id'):$(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].address' | sed 's/^0x//'):$(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].bls_pubkey') {% endif %}{% endfor %} \
--chain-id {{ chain_id }} \
--epoch-size 10
--epoch-size 10 \
--native-token-config MyToken:MTK:18:true
polycli wallet create --words 12 --language english | jq '.Addresses[0]' > rootchain-wallet.json
COINBASE_ADDRESS=$(cast rpc --rpc-url {{ rootchain_json_rpc }} eth_coinbase | sed 's/"//g')
cast send --rpc-url {{ rootchain_json_rpc }} --from $COINBASE_ADDRESS --value 100ether $(cat rootchain-wallet.json | jq -r '.ETHAddress')
# Should the deployer be funded from an unlocked L1 chain or from a prefunded account on L1
{% if (not fund_rootchain_coinbase) %}# {% endif %}COINBASE_ADDRESS=$(cast rpc --rpc-url {{ rootchain_json_rpc }} eth_coinbase | sed 's/"//g')
{% if (not fund_rootchain_coinbase) %}# {% endif %}cast send --rpc-url {{ rootchain_json_rpc }} --from $COINBASE_ADDRESS --value {{ rootchain_deployer_fund_amount }} $(cat rootchain-wallet.json | jq -r '.ETHAddress') --unlocked
{% if (fund_rootchain_coinbase) %}# {% endif %}cast send --rpc-url {{ rootchain_json_rpc }} --from {{ rootchain_coinbase_address }} --value {{ rootchain_deployer_fund_amount }} $(cat rootchain-wallet.json | jq -r '.ETHAddress') --private-key {{ rootchain_coinbase_private_key }}
polygon-edge rootchain deploy \
--deployer-key $(cat rootchain-wallet.json | jq -r '.HexPrivateKey') \
--json-rpc {{ rootchain_json_rpc }}
{% for item in hostvars %}
{% if (hostvars[item].tags.Role == "validator") %}
cast send --rpc-url {{ rootchain_json_rpc }} --from $COINBASE_ADDRESS --value 100ether $(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].address')
cast send --rpc-url {{ rootchain_json_rpc }} --from $(cat rootchain-wallet.json | jq -r '.ETHAddress') --private-key $(cat rootchain-wallet.json | jq -r '.HexPrivateKey') \
--value {{ rootchain_validator_fund_amount }} $(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].address')
{% endif %}
{% endfor %}
Expand All @@ -163,7 +168,7 @@ jobs:
{% for item in hostvars %}
{% if (hostvars[item].tags.Role == "validator") %}
polygon-edge polybft stake --data-dir {{ hostvars[item].tags["Name"] }} --chain-id {{ chain_id }} \
polygon-edge polybft stake --data-dir {{ hostvars[item].tags["Name"] }} --chain-id $(cat genesis.json | jq -r '.params.chainID') \
--amount 10 \
--stake-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeManagerAddr') \
--native-root-token $(cat genesis.json | jq -r '.params.engine.polybft.bridge.nativeERC20Address') \
Expand All @@ -183,7 +188,6 @@ jobs:
main
EOF
- name: Run Ansible
working-directory: ansible
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/manual.deploy.nightly.devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

name: Nightly DevNet Workflow (Manual)
on: # yamllint disable-line rule:truthy
# push:
# branches:
# - jesse/fix-nightly-build
push:
branches:
- jesse/fix-*
workflow_call: {}
workflow_dispatch: {}

Expand Down

0 comments on commit 7212da4

Please sign in to comment.