Skip to content

Commit 5a99d88

Browse files
authored
Feature: migrate from the usage of Tenderly forks in favour of Tenderly virtual testnets for ST (#1457)
* feature: performed tenderly virtual testnets migration * fix: fixed bugs
1 parent 569eb4d commit 5a99d88

File tree

1 file changed

+13
-78
lines changed

1 file changed

+13
-78
lines changed

.github/workflows/build-&-publish-docker-image.yml

Lines changed: 13 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -215,83 +215,18 @@ jobs:
215215
version: '1.7'
216216
force: 'false'
217217

218-
- name: "Create Tenderly fork"
218+
- name: "Create Tenderly virtual testnet"
219219
run: |
220220
echo "TENDERLY_CREATION_INFO=$(curl -X POST \
221-
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
222-
-H "Content-Type: application/json" \
223-
-d '{"alias":"mainnet-dev-${{ env.RUNNER_NUMBER }}-${{ github.run_id }}${{ github.run_attempt }}", "description":"", "block_number": 18539779, "network_id":"1"}' \
224-
https://api.tenderly.co/api/v1/account/zus_network/project/project/fork)" >> $GITHUB_ENV
221+
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
222+
-H "Content-Type: application/json" \
223+
-d '{"slug":"mainnet-dev-${{ env.RUNNER_NUMBER }}-${{ github.run_id }}","displayName":"mainnet-dev-${{ env.RUNNER_NUMBER }}-${{ github.run_id }}","description":"","visibility":"TEAM","tags":{"purpose":"development"},"networkConfig":{"networkId":"1","blockNumber":"18512782","chainConfig":{"chainId":"1"},"baseFeePerGas":"1"},"explorerConfig":{"enabled":false,"verificationVisibility":"bytecode"},"syncState":false}' \
224+
https://api.tenderly.co/api/v1/account/zus_network/project/project/testnet/container)" >> $GITHUB_ENV
225225
226-
- name: "Parse Tenderly fork creation transaction result"
226+
- name: "Parse Tenderly virtual testnet creation transaction result"
227227
run: |
228-
echo "TENDERLY_FORK_ID=$(echo '${{ env.TENDERLY_CREATION_INFO }}' | jq -r '.simulation_fork.id')" >> $GITHUB_ENV
229-
echo "TENDERLY_ROOT_TRANSACTION_ID=$(echo '${{ env.TENDERLY_CREATION_INFO }}' | jq -r '.root_transaction.id')" >> $GITHUB_ENV
230-
231-
- name: "Retrieve Tenderly fork block number"
232-
run: |
233-
echo "TENDERLY_FORK_BLOCK_NUMBER=$(curl -X GET \
234-
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
235-
-H "Content-Type: application/json" \
236-
https://api.tenderly.co/api/v1/network/1/block-number | jq -r '.block_number')" >> $GITHUB_ENV
237-
238-
echo "TENDERLY_FORK_BLOCK_NUMBER=$((${{ env.TENDERLY_FORK_BLOCK_NUMBER }} + 1))" >> GITHUB_ENV
239-
240-
- name: "Transfer Bridge ownership in Tenderly fork"
241-
run: |
242-
echo "TENDERLY_ROOT_TRANSACTION_ID=$(curl -X POST \
243-
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
244-
-H "Content-Type: application/json" \
245-
-d '{
246-
"network_id": "1",
247-
"block_number": ${{ env.TENDERLY_FORK_BLOCK_NUMBER }},
248-
"transaction_index": null,
249-
"from": "0xed8f3170db6d1a71c8fa6d8d73cc2c51db95d5a4",
250-
"input": "0xf2fde38b0000000000000000000000008e25cfd9bd6c0ca67a5522cd920b3c66d39d6e97",
251-
"to": "0x7700d773022b19622095118fadf46f7b9448be9b",
252-
"gas": 8000000,
253-
"gas_price": "0",
254-
"value": "0",
255-
"access_list": [],
256-
"generate_access_list": true,
257-
"save": true,
258-
"source": "dashboard",
259-
"block_header": null,
260-
"root": "${{ env.TENDERLY_ROOT_TRANSACTION_ID }}",
261-
"skip_fork_head_update": false,
262-
"alias": "",
263-
"description": "Transfer ownership to 0x8E25cfd9bd6c0ca67a5522cd920b3c66D39d6E97"
264-
}' \
265-
https://api.tenderly.co/api/v1/account/zus_network/project/project/fork/${{ env.TENDERLY_FORK_ID }}/simulate | jq -r '.simulation.id')" >> $GITHUB_ENV
266-
267-
echo "TENDERLY_FORK_BLOCK_NUMBER=$((${{ env.TENDERLY_FORK_BLOCK_NUMBER }} + 1))" >> GITHUB_ENV
268-
269-
- name: "Transfer Authorizers ownership in Tenderly fork"
270-
run: |
271-
curl -X POST \
272-
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
273-
-H "Content-Type: application/json" \
274-
-d '{
275-
"network_id": "1",
276-
"block_number": ${{ env.TENDERLY_FORK_BLOCK_NUMBER }},
277-
"transaction_index": null,
278-
"from": "0xed8f3170db6d1a71c8fa6d8d73cc2c51db95d5a4",
279-
"input": "0xf2fde38b0000000000000000000000008e25cfd9bd6c0ca67a5522cd920b3c66d39d6e97",
280-
"to": "0x481dab4407b9880de0a68dc62e6af611c4949e42",
281-
"gas": 8000000,
282-
"gas_price": "0",
283-
"value": "0",
284-
"access_list": [],
285-
"generate_access_list": true,
286-
"save": true,
287-
"source": "dashboard",
288-
"block_header": null,
289-
"root": "${{ env.TENDERLY_ROOT_TRANSACTION_ID }}",
290-
"skip_fork_head_update": false,
291-
"alias": "",
292-
"description": "Transfer ownership to 0x8E25cfd9bd6c0ca67a5522cd920b3c66D39d6E97"
293-
}' \
294-
https://api.tenderly.co/api/v1/account/zus_network/project/project/fork/${{ env.TENDERLY_FORK_ID }}/simulate
228+
echo "TENDERLY_VIRTUAL_TESTNET_ID=$(echo '${{ env.TENDERLY_CREATION_INFO }}' | jq -r '.container.id')" >> $GITHUB_ENV
229+
echo "TENDERLY_VIRTUAL_TESTNET_RPC_ID=$(echo '${{ env.TENDERLY_CREATION_INFO }}' | jq -r '.container.connectivityConfig.endpoints[0].id')" >> $GITHUB_ENV
295230
296231
- name: "Deploy 0Chain"
297232
uses: 0chain/actions/deploy-0chain@master
@@ -302,10 +237,10 @@ jobs:
302237
blobber_image: ${{ env.TAG }}-${{ env.SHORT_SHA }}
303238
validator_image: ${{ env.TAG }}-${{ env.SHORT_SHA }}
304239
SUBGRAPH_API_URL: ${{ secrets.SUBGRAPH_API_URL }}
305-
TENDERLY_FORK_ID: ${{ env.TENDERLY_FORK_ID }}
240+
TENDERLY_VIRTUAL_TESTNET_RPC_ID: ${{ env.TENDERLY_VIRTUAL_TESTNET_RPC_ID }}
306241
graphnode_sc: ${{ secrets.GRAPHNODE_SC }}
307242
graphnode_network: ${{ secrets.GRAPHNODE_NETWORK }}
308-
graphnode_ethereum_node_url: https://rpc.tenderly.co/fork/${{ env.TENDERLY_FORK_ID }}
243+
graphnode_ethereum_node_url: https://virtual.mainnet.rpc.tenderly.co/${{ env.TENDERLY_VIRTUAL_TESTNET_RPC_ID }}
309244
svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }}
310245

311246
- name: "Run System tests"
@@ -319,18 +254,18 @@ jobs:
319254
run_flaky_tests: false
320255
retry_failures: true
321256
run_smoke_tests: ${{ github.ref != 'refs/heads/staging' && github.base_ref != 'staging' && github.ref != 'refs/heads/master' && github.base_ref != 'master' }}
322-
TENDERLY_FORK_ID: ${{ env.TENDERLY_FORK_ID }}
257+
TENDERLY_VIRTUAL_TESTNET_RPC_ID: ${{ env.TENDERLY_VIRTUAL_TESTNET_RPC_ID }}
323258
DEVOPS_CHANNEL_WEBHOOK_URL: ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }}
324259
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
325260
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
326261

327-
- name: "Remove Tenderly fork"
262+
- name: "Remove Tenderly virtual testnet"
328263
if: always()
329264
run: |
330265
curl -X DELETE \
331266
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
332267
-H "Content-Type: application/json" \
333-
https://api.tenderly.co/api/v1/account/zus_network/project/project/fork/${{ env.TENDERLY_FORK_ID }}
268+
https://api.tenderly.co/api/v1/account/zus_network/project/project/testnet/container/${{ env.TENDERLY_VIRTUAL_TESTNET_ID }}
334269
335270
- name: "Set PR status as ${{ job.status }}"
336271
if: ${{ (success() || failure()) && steps.findPr.outputs.number }}

0 commit comments

Comments
 (0)