Skip to content

Enhance role granting with logging and waiting to get confirmation#605

Open
md-tosif wants to merge 1 commit intoagglayer:developfrom
md-tosif:develop
Open

Enhance role granting with logging and waiting to get confirmation#605
md-tosif wants to merge 1 commit intoagglayer:developfrom
md-tosif:develop

Conversation

@md-tosif
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant