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

chore(deployments): create txtx Runbook to upgrade L1/L2 deployments #441

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

MicaiahReid
Copy link

@MicaiahReid MicaiahReid commented Oct 22, 2024

Hi, I'm Micaiah! 👋

After spending some years shipping developer tools at ConsenSys, I joined @lgalabru in creating txtx.


tl;dr

We're working to improve deployments & operations of smart contracts across the web3 ecosystem. We'd love for you to be a part of it.

This PR implements a smart contract Runbooks for the farcaster contracts. A tour of the Runbooks can be found here:

Txtx


Motivation

We're working on developer tooling that aims to improve the deployments & operations lifecycle of smart contracts.
We see ourselves as the perfect companion for Hardhat and Foundry.

We've worked with teams to ease the burden of deploying contracts to the ever-growing list of L2s and to improve the security of their deployments by enabling multisig and hardware wallet signing of deployment transactions.

We're doing this through a new concept called "Smart Contract Runbooks". These Runbooks borrow heavily from Terraform; they provide a declarative way to describe your deployments & operations - allowing you to describe the "what" without having to worry about the "how". Txtx is a CLI tool that can be used to execute these Runbooks.

We're currently looking to onboard additional users. We have so many ideas for ways to continue improving the deployment & operations process, and we'd love to work with more teams like Farcaster to have feedback on the next features!

This PR creates Runbooks that replace the existing DeployL1.s.sol and DeployL2.s.sol scripts. The new Runbooks offer a few advantages over the existing scripts:

Simplicity

Txtx allows for removal of the logic that needs to be managed in the scripts.

For example, the L2 deployment script has logic to check if setup of contracts needs to occur based on if a new contract was deployed. Txtx, however, manages a state for your deployments, allowing it to automatically detect if contracts have changed since your last deployment. If no changes were made to your contracts, your deployments won't event be re-executed in the first place. If a contract is updated, only that contract and it's dependencies will be redeployed.

Security

Txtx allows you to specify a web wallet to sign all transactions, so you can stop copy/pasting your keys.

Dependency Analysis

Txtx uses your Runbook to create a graph of your contracts, so it can automatically detect what contracts need to be redeployed if an upstream contract is updated.

More to Come

We have so many ideas on improving the deployments & operations phase of development - cost analysis, wallet provisioning, alternate signer types (secure enclaves, keystores, etc), CI integrations, etc, etc.
We'd love for your team to be a part of what's next!

A tour of Txtx and your Runbooks can be found here.

Change Summary

Improve the farcaster contracts deployment process by implementing txtx runbooks.

Merge Checklist

Choose all relevant options below by adding an x now or at any time before submitting for review


PR-Codex overview

This PR focuses on enhancing the deployment runbooks for the Farcaster Protocol, adding detailed outputs and variables for contract addresses, and clarifying environment-specific configurations for devnet and mainnet.

Detailed summary

  • Added comments in network.devnet.tx and network.mainnet.tx to clarify environment-specific file usage.
  • Introduced multiple output variables in outputs.tx for contract addresses.
  • Defined a new variable immutable_factory_abi in variables.tx for the Immutable Create2 Factory.
  • Added several initial configuration variables in deploy-l2/variables.tx.
  • Updated grant-role.tx with new variable definitions and actions for granting roles.
  • Enhanced deploy-l1/main.tx and deploy-l2/main.tx with actions for deploying contracts and managing roles.
  • Updated txtx.yml with detailed environment configurations for devnet and mainnet.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

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