Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new rollup script #361

Open
wants to merge 12 commits into
base: feature/audit-remediations
Choose a base branch
from

Conversation

ignasirv
Copy link
Contributor

@ignasirv ignasirv commented Nov 19, 2024

This PR implements:

  • tool to create new rollups.
    • minor fixes in other tools
  • add script to create sovereignChain genesis with hardhat

@cla-bot cla-bot bot added the cla-signed label Nov 19, 2024
@ignasirv ignasirv force-pushed the feature/create-new-rollup branch 2 times, most recently from b7f88a9 to 59ce85c Compare November 22, 2024 13:23
@krlosMata krlosMata changed the base branch from feature/ongoingPP to feature/audit-remediations November 25, 2024 15:59
Copy link
Contributor

@krlosMata krlosMata left a comment

Choose a reason for hiding this comment

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

In the addRollupType tool, we should include retrieving the bridge address from the PolygonZkEVMBridgeV2 proxy as well.
This is because new genesis will not be PolygonZkEVMBridge proxy, but either:

  • PolygonZkEVMBridgeV2 proxy
  • BridgeL2SovereignChain proxy

.gitignore Show resolved Hide resolved
contracts/v2/sovereignChains/BridgeL2SovereignChain.sol Outdated Show resolved Hide resolved
tools/createNewRollup/README.md Outdated Show resolved Hide resolved
tools/createNewRollup/README.md Outdated Show resolved Hide resolved
tools/createNewRollup/README.md Outdated Show resolved Hide resolved
tools/createNewRollup/create_new_rollup.json.example Outdated Show resolved Hide resolved
tools/createNewRollup/README.md Outdated Show resolved Hide resolved
tools/createNewRollup/createNewRollup.ts Show resolved Hide resolved
tools/createNewRollup/createNewRollup.ts Outdated Show resolved Hide resolved
tools/createNewRollup/createNewRollup.ts Outdated Show resolved Hide resolved
@krlosMata
Copy link
Contributor

Provide description in the PR comment about the changes in this PR

@ignasirv ignasirv force-pushed the feature/create-new-rollup branch 3 times, most recently from b119c8f to 9744783 Compare November 29, 2024 09:29
@krlosMata krlosMata self-requested a review November 29, 2024 14:42
hardhat.config.ts Show resolved Hide resolved
tools/addRollupType/addRollupType.ts Outdated Show resolved Hide resolved
tools/addRollupType/addRollupType.ts Outdated Show resolved Hide resolved
tools/createNewRollup/createNewRollup.ts Outdated Show resolved Hide resolved
};

// Function to recursively convert BigInts to Numbers
function convertBigIntsToNumbers(obj) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what if a bigInt is large than 2**53 - 1 (max number in JS) ?

Copy link
Contributor Author

@ignasirv ignasirv Dec 1, 2024

Choose a reason for hiding this comment

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

If it's larger than 2 ** 53 - 1 it sets the value as 2 ** 53 - 1 . It's important to know this limitation when using that util (I will add a coment)
The decoded values that are being used now with this function are "rollupTypeID", "chainID", "value". None of them should be grater than 2**53 - 1 when creating a rollup. Anyway, it's also possible to present those values as strings

@ignasirv ignasirv force-pushed the feature/create-new-rollup branch 5 times, most recently from 6d4fc97 to d5f1c8a Compare December 2, 2024 10:13
@ignasirv ignasirv requested a review from krlosMata December 2, 2024 10:15
@ignasirv ignasirv force-pushed the feature/create-new-rollup branch 2 times, most recently from cfd7476 to dff3f3e Compare December 2, 2024 12:59
@ignasirv ignasirv force-pushed the feature/create-new-rollup branch from dff3f3e to 664b0a1 Compare December 2, 2024 14:42
@ignasirv ignasirv force-pushed the feature/create-new-rollup branch from c9d10f1 to bcc4f01 Compare December 3, 2024 12:51
Copy link

sonarcloud bot commented Dec 10, 2024

Copy link
Contributor

@krlosMata krlosMata left a comment

Choose a reason for hiding this comment

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

😸

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

Successfully merging this pull request may close these issues.

2 participants