Enhance role granting with logging and waiting to get confirmation#605
Enhance role granting with logging and waiting to get confirmation#605md-tosif wants to merge 1 commit intoagglayer:developfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d005bf16ce
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if ((await rollupManagerContract.hasRole(CREATE_ROLLUP_ROLE, deployer.address)) === false) { | ||
| logger.info(`Granting CREATE_ROLLUP_ROLE to deployer ${deployer.address}...`); | ||
| const grantTx = await rollupManagerContract.grantRole(CREATE_ROLLUP_ROLE, deployer.address); | ||
| await grantTx.wait(); |
There was a problem hiding this comment.
Avoid waiting before precomputing the rollup address
When the deployer does not already hold CREATE_ROLLUP_ROLE, await grantTx.wait() delays the later getTransactionCount(rollupManagerContract.target) until a subsequent block. In shared deployments where another account can call attachAggchainToAL during that confirmation window, the manager's creation nonce advances because attachAggchainToAL deploys the proxy with new PolygonTransparentProxy(...) (contracts/AgglayerManager.sol:628-637). That makes outputJson.rollupAddress, the log filter, and the ERC1967 assertions in this script point at the wrong address even though the rollup creation itself succeeded.
Useful? React with 👍 / 👎.
No description provided.