Skip to content

Commit

Permalink
fix: remove parallel deployments temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-goldman committed Nov 15, 2022
1 parent 8555405 commit b653177
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 67 deletions.
7 changes: 7 additions & 0 deletions .changeset/grumpy-icons-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@chugsplash/demo': patch
'@chugsplash/executor': patch
'@chugsplash/plugins': patch
---

Remove parallel deployments due to bug on live networks
13 changes: 0 additions & 13 deletions packages/demo/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,6 @@ const config: HardhatUserConfig = {
},
},
networks: {
hardhat: {
mining: {
auto: false,
interval: 1000,
},
},
localhost: {
url: 'http://localhost:8545',
mining: {
auto: false,
interval: 1000,
},
},
goerli: {
chainId: 5,
url: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
Expand Down
6 changes: 0 additions & 6 deletions packages/executor/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ const config: HardhatUserConfig = {
version: '0.8.15',
},
networks: {
hardhat: {
mining: {
auto: false,
interval: 1000,
},
},
'optimism-goerli': {
chainId: 420,
url: `https://optimism-goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
Expand Down
10 changes: 0 additions & 10 deletions packages/plugins/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,8 @@ const config: HardhatUserConfig = {
},
},
networks: {
hardhat: {
mining: {
auto: false,
interval: 1000,
},
},
localhost: {
url: 'http://localhost:8545',
mining: {
auto: false,
interval: 1000,
},
},
goerli: {
chainId: 5,
Expand Down
47 changes: 9 additions & 38 deletions packages/plugins/src/hardhat/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,49 +439,20 @@ subtask(TASK_CHUGSPLASH_EXECUTE)
isSetImplementationAction(fromRawChugSplashAction(action.action))
)

// Execute in parallel if and only if not on automining hardhat network
if (
(await getChainId(hre.ethers.provider)) === 31337 &&
(await hre.network.provider.request({
method: 'hardhat_getAutomine',
params: [],
}))
// execute actions in series
for (
let i = bundleState.actionsExecuted;
i < firstSetImplementationActionIndex;
i++
) {
// execute actions in series
for (
let i = bundleState.actionsExecuted;
i < firstSetImplementationActionIndex;
i++
) {
const action = bundle.actions[i]
const tx = await chugSplashManager.executeChugSplashAction(
const action = bundle.actions[i]
await (
await chugSplashManager.executeChugSplashAction(
action.action,
action.proof.actionIndex,
action.proof.siblings
)
await tx.wait()
}
} else {
// execute in parallel
let nonce = await chugSplashManager.signer.getTransactionCount()
const actions = bundle.actions.slice(
bundleState.actionsExecuted,
firstSetImplementationActionIndex
)
await Promise.all(
actions.map((action) => {
const tx = chugSplashManager.executeChugSplashAction(
action.action,
action.proof.actionIndex,
action.proof.siblings,
{
nonce,
}
)
nonce += 1
return tx
})
)
).wait()
}

// If the bundle hasn't already been completed in an earlier call, complete the bundle by
Expand Down

0 comments on commit b653177

Please sign in to comment.