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

Deploy Rollups contracts deterministically on devnet in Go #229

Closed
3 tasks done
marcelstanley opened this issue Jan 5, 2024 · 2 comments · Fixed by #289
Closed
3 tasks done

Deploy Rollups contracts deterministically on devnet in Go #229

marcelstanley opened this issue Jan 5, 2024 · 2 comments · Fixed by #289
Assignees
Labels
#feat:devnet Feature: devnet
Milestone

Comments

@marcelstanley
Copy link
Contributor

marcelstanley commented Jan 5, 2024

📚 Context

Rollups contracts are not begin deployed in a deterministic fashion on devnet, which forced us to change the address book used by cartesi-rollups-cli to make the relevant addresses match.

We must amend the deployment process so the whole deployment is deterministic.

✔️ Solution

Use a tool (possibly forge script) that uses the CREATE2 opcode to perform the deployment (see tutorial).

Note: Besides being used by rollups-contracts, there's also a mention about using safe-singleton-factory at foundry-rs/foundry#2638 (comment) pointing to https://github.com/bgd-labs/aave-helpers/blob/6cc788d1346e6bcaf8f02878841eb74662c87c17/src/ScriptUtils.sol#L87.

Use rollups-contracts deployment tools.

📈 Subtasks

  • Deploy contracts deterministically on devnet
  • Restore original address book used by cartesi-rollups-cli
  • Convert shell code to Go
@marcelstanley marcelstanley converted this from a draft issue Jan 5, 2024
@marcelstanley marcelstanley self-assigned this Jan 5, 2024
@marcelstanley marcelstanley changed the title Tests: Deploy Rollups contracts deterministically using foundry-rs Deploy Rollups contracts deterministically on devnet Jan 5, 2024
@marcelstanley marcelstanley moved this from 📋 Backlog to 🏗 In progress in Node Unit Jan 5, 2024
@tuler
Copy link
Member

tuler commented Jan 5, 2024

Rollups contracts use https://github.com/safe-global/safe-singleton-factory for deterministic deployment to all networks. It also works on foundry.

@gligneul gligneul added this to the 1.3.0 milestone Jan 8, 2024
@gligneul gligneul added the #feat:tests Feature: tests label Jan 8, 2024
@gligneul gligneul added #feat:devnet Feature: devnet and removed #feat:tests Feature: tests labels Jan 16, 2024
@marcelstanley
Copy link
Contributor Author

marcelstanley commented Jan 19, 2024

After some experimentation and further consideration, we have decided to backtrack on using foundry-rs and to use rollups-contracts's own deployment script instead.

There are a couple of reasons for that:

  • even though we used the same deterministic deployer as rollups-contracts and the right salt, we never got the same deployment addresses for the contracts
  • the process became cumbersome and considerably more complex than we expected

Besides all that, the scope of this task has grown to also convert all shell code to Go.

@marcelstanley marcelstanley changed the title Deploy Rollups contracts deterministically on devnet Deploy Rollups contracts deterministically on devnet in Go Jan 19, 2024
@gligneul gligneul modified the milestones: 1.3.0, 1.4.0 Feb 9, 2024
@gligneul gligneul moved this from 🏗 In progress to 👀 In review in Node Unit Feb 9, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Node Unit Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#feat:devnet Feature: devnet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants