- 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
Gus/cleanup #11
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
          
     Merged
      
      
    
  
     Merged
                    Gus/cleanup #11
Changes from all commits
      Commits
    
    
            Show all changes
          
          
            3 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      
    File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [submodule "metabased-contracts/lib/forge-std"] | ||
| path = metabased-contracts/lib/forge-std | ||
| url = https://github.com/foundry-rs/forge-std | ||
| [submodule "metabased-contracts/lib/openzeppelin-contracts"] | ||
| path = metabased-contracts/lib/openzeppelin-contracts | ||
| url = https://github.com/OpenZeppelin/openzeppelin-contracts | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # This private key is common knowledge, you should not use them on any network other than this dev network. Using these private keys on mainnet, or even a testnet, will most likely result in a loss of funds. | ||
| # https://docs.optimism.io/chain/testing/dev-node#additional-info | ||
| ETH_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 | 
            File renamed without changes.
          
    
            File renamed without changes.
          
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| [submodule "contracts/lib/forge-std"] | ||
| path = contracts/lib/forge-std | ||
| [submodule "lib/forge-std"] | ||
| path = lib/forge-std | ||
| url = https://github.com/foundry-rs/forge-std | ||
| [submodule "contracts/lib/openzeppelin-contracts"] | ||
| path = contracts/lib/openzeppelin-contracts | ||
| [submodule "lib/openzeppelin-contracts"] | ||
| path = lib/openzeppelin-contracts | ||
| url = https://github.com/OpenZeppelin/openzeppelin-contracts | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,63 +1,47 @@ | ||
| # Heavily inspired by Reth's Makefile: https://github.com/paradigmxyz/reth/blob/main/Makefile | ||
| .DEFAULT_GOAL := help | ||
| # include .env file and export its env vars | ||
| # (-include to ignore error if it does not exist) | ||
| # Note that any unset variables here will wipe the variables if they are set in | ||
| # .zshrc or .bashrc. Make sure that the variables are set in .env, especially if | ||
| # you're running into issues with fork tests | ||
| -include .env | ||
|  | ||
| BIN_DIR = "dist/bin" | ||
| # deploy DeployMetabasedSequencerChain to Base Sepolia | ||
| deploy-metabased-sequencerchain :; forge script script/DeployContractsForSequencerChain.s.sol:DeployMetabasedSequencerChain --rpc-url base_sepolia --private-key ${ETH_PRIVATE_KEY} --broadcast -vv | ||
|  | ||
| BUILD_PATH = "target" | ||
| # deploy DeployMetabasedSequencerChainForTestnet to Metabased Testnet | ||
| deploy-metabased-sequencerchain-testnet :; forge script script/DeployContractsForSequencerChain.s.sol:DeployMetabasedSequencerChainForTestnet --rpc-url metabased_testnet --private-key ${ETH_PRIVATE_KEY} --broadcast -vv | ||
|  | ||
| # List of features to use when building. Can be overridden via the environment. | ||
| # No jemalloc on Windows | ||
| # ifeq ($(OS),Windows_NT) | ||
| FEATURES ?= | ||
| # else | ||
| # FEATURES ?= jemalloc asm-keccak | ||
| # endif | ||
| # run AddModuleToMetabasedSequencerChain script on Base Sepolia | ||
| add-module-to-metabased-sequencerchain :; forge script script/DeployContractsForSequencerChain.s.sol:AddModuleToMetabasedSequencerChain --rpc-url base_sepolia --private-key ${ETH_PRIVATE_KEY} --broadcast -vv | ||
|  | ||
| # Cargo profile for builds. Default is for local builds, CI uses an override. | ||
| PROFILE ?= release | ||
| # deploy DeploySealedBidAuctionSequencingModule to Base Sepolia | ||
| deploy-sealed-bid-auction-sequencing-module :; forge script script/DeployContractsForSequencerChain.s.sol:DeploySealedBidAuctionSequencingModule --rpc-url base_sepolia --private-key ${ETH_PRIVATE_KEY} --broadcast -vv | ||
|  | ||
| # Extra flags for Cargo | ||
| CARGO_INSTALL_EXTRA_FLAGS ?= | ||
| # deploy DeployTokenBalanceSequencingModule to Base Sepolia | ||
| deploy-token-balance-sequencing-module :; forge script script/DeployContractsForSequencerChain.s.sol:DeployTokenBalanceSequencingModule --rpc-url base_sepolia --private-key ${ETH_PRIVATE_KEY} --broadcast -vv | ||
|  | ||
| # Features in reth/op-reth binary crate other than "ethereum" and "optimism" | ||
| BIN_OTHER_FEATURES := asm-keccak jemalloc jemalloc-prof min-error-logs min-warn-logs min-info-logs min-debug-logs min-trace-logs | ||
| # deploy DeployAllowlistSequencingModule to Base Sepolia | ||
| deploy-allowlist-sequencing-module :; forge script script/DeployContractsForSequencerChain.s.sol:DeployAllowlistSequencingModule --rpc-url base_sepolia --private-key ${ETH_PRIVATE_KEY} --broadcast -vv | ||
|  | ||
| ##@ Help | ||
| # deploy DeployAlwaysAllowedModule to Base Sepolia | ||
| deploy-always-allowed-module :; forge script script/DeployContractsForSequencerChain.s.sol:DeployAlwaysAllowedModule --rpc-url base_sepolia --private-key ${ETH_PRIVATE_KEY} --broadcast -vv | ||
|  | ||
| .PHONY: help | ||
| help: ## Display this help. | ||
| @awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
| # run AddBatchTransactionsToMetabasedSequencerChainContract script on Base Sepolia | ||
| add-batch-transactions-to-metabased-sequencerchain :; forge script script/AddBatchTransactionsToMetabasedSequencerChainContract.s.sol:AddBatchTransactionsToMetabasedSequencerChainContract --rpc-url base_sepolia --private-key ${ETH_PRIVATE_KEY} --broadcast -vv | ||
|  | ||
| ##@ Build | ||
| # run AddBatchTransactionsToMetabasedSequencerChainContract script on localhost | ||
| add-batch-transactions-to-metabased-sequencerchain-localhost :; forge script script/AddBatchTransactionsToMetabasedSequencerChainContract.s.sol:AddBatchTransactionsToMetabasedSequencerChainContract --rpc-url localhost --private-key ${ETH_PRIVATE_KEY} --broadcast -vv | ||
|  | ||
| .PHONY: install-foundry | ||
| install-foundry: ## Install Foundry if the forge command is not found or is corrupted. | ||
| @if [ -z "$$(which forge)" ]; then \ | ||
| echo "Forge not found. Installing Foundry..."; \ | ||
| curl -L https://foundry.paradigm.xyz | bash && bash -c "source ~/.bashrc && foundryup"; \ | ||
| fi | ||
| @forge build --help > /dev/null 2>&1 || (echo "Forge is corrupted. Reinstalling Foundry..." && curl -L https://foundry.paradigm.xyz | bash && bash -c "source ~/.bashrc && foundryup") | ||
| @echo "Foundry is installed and ready to use." | ||
| # run tx limit test against OP Mainnet or Base Sepolia | ||
| # and save output to file | ||
| # need to change target network in the test file | ||
| test-tx-limit :; forge test --match-contract MetabaseSequencerChainIntegrationTest -vv > test/integration/metabase-tx-limit-data/optimism_test_output_$(date +%Y%m%d_%H%M%S).log 2>&1 | ||
|  | ||
| .PHONY: build-op-reth-syn | ||
| build-op-reth-syn: ## Build and install the op-reth binary under `~/.cargo/bin`. | ||
| cd ./reth-and-exexs && cargo install --path . --bin op-reth-syn --force --locked \ | ||
| --features "$(FEATURES)" \ | ||
| --profile "$(PROFILE)" \ | ||
| $(CARGO_INSTALL_EXTRA_FLAGS) | ||
| test-events-limit :; forge test --match-contract MetabaseSequencerChainEventLimitTest -vv > test/integration/metabase-events-limit-data/base_sepolia_test_output_$(date +%Y%m%d_%H%M%S).md 2>&1 | ||
|  | ||
| .PHONY: build-contracts | ||
| build-contracts: install-foundry ## Build contracts using forge. | ||
| cd ./contracts && forge build | ||
| @echo "Contract compilation complete" | ||
| # deploy L3BackfillData to Metabased Testnet | ||
| deploy-l3-backfill-data :; forge create --rpc-url metabased_testnet --private-key ${ETH_PRIVATE_KEY} src/backfill/L3BackfillData.sol:L3BackfillData --constructor-args ${ADMIN} ${MANAGER} | ||
|  | ||
| .PHONY: test | ||
| test: build-contracts ## Run tests after building the contracts. | ||
| cd ./reth-and-exexs && cargo test --all | ||
| @echo "Tests complete" | ||
| deploy-l3-backfill-storage :; forge create --rpc-url metabased_testnet --private-key ${ETH_PRIVATE_KEY} src/backfill/L3BackfillStorage.sol:L3BackfillStorage --constructor-args ${ADMIN} ${MANAGER} | ||
|  | ||
| ##@ Custom Build | ||
|  | ||
| .PHONY: install | ||
| install: build-contracts build-op-reth-syn ## Run build steps. | ||
| @echo "Install complete. You can now run op-reth-syn from your terminal." | ||
| deploy-l3-backfill-mapper :; forge create --rpc-url metabased_testnet --private-key ${ETH_PRIVATE_KEY} src/backfill/L3BackfillMapper.sol:L3BackfillMapper --constructor-args ${ADMIN} ${MANAGER} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,2 +1,64 @@ | ||
| # metabased-rollup | ||
| The monorepo for the Metabased rollup stack. Containers the sequencer, smart contracts, RPC node, dev environments, and more! | ||
| ## Base Sequencer Chain Contracts | ||
|  | ||
| ### install | ||
|  | ||
| Ensure Foundry is installed. | ||
|  | ||
| ```shell | ||
| $ forge install | ||
| ``` | ||
|  | ||
| ### Build | ||
|  | ||
| ```shell | ||
| $ forge build | ||
| ``` | ||
|  | ||
| ### Test | ||
|  | ||
| ```shell | ||
| $ forge test | ||
| ``` | ||
|  | ||
| ### Deploy | ||
|  | ||
| Look at Makefile for more details. | ||
|  | ||
| Example: | ||
|  | ||
| ```shell | ||
| $ make deploy-based-sequencerchain-frame | ||
| ``` | ||
|  | ||
| ### Deployed Contracts | ||
|  | ||
| #### Syndicate Frame Chain | ||
|  | ||
| | Contract Name | Address | | ||
| | ------------------------- | ------------------------------------------ | | ||
| | BasedSequencerChain | 0x8430FDed8bb66c6EA2f1f966E2abF9D481eEF418 | | ||
| | AllowlistSequencingModule | 0xA3d1304Afff72a8aD77F7c6A7B0c18d63629062d | | ||
|  | ||
| #### Base Sepolia | ||
|  | ||
| | Contract Name | Address | | ||
| | ----------------------- | ------------------------------------------ | | ||
| | MetabasedSequencerChain | 0x0E3E7d53c6451D62CE9f86201743587419Dc88Be | | ||
| | AlwaysAllowedModule | 0x33aB24E0a47A7aAe869755420950A6326e3CB9F3 | | ||
|  | ||
| #### Optimism | ||
|  | ||
| | Contract Name | Address | | ||
| | ----------------------- | ------------------------------------------ | | ||
| | MetabasedSequencerChain | 0x7DEdabB3Db89310B316bA49D96Aa6517aFC44294 | | ||
| | AlwaysAllowedModule | 0x21e1C6bE46E53693381Cef9BECD3B0A947A590e4 | | ||
|  | ||
| #### Metabased Testnet | ||
|  | ||
| | Contract Name | Address | | ||
| | ----------------------- | ------------------------------------------ | | ||
| | MetabasedSequencerChain | 0xcFc46cEBB3eAEc9b5776e3FDe5879125B8BBA05d | | ||
| | AlwaysAllowedModule | 0x471584f0B8e35faEB2a618BD58A62316D8882d63 | | ||
| | L3BackfillData | 0xA67d13E3227B68bFc96DB9f5AFe7197ca32F0033 | | ||
| | L3BackfillStorage | 0x0E15475575E06461e376a9954F4cb54fC61bC1a5 | | ||
| | L3BackfillMapper | 0x609272C1D46E652aaf095a4F7F2eCC208C61c7F5 | | 
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    This file was deleted.
      
      Oops, something went wrong.
      
    
  This file was deleted.
      
      Oops, something went wrong.
      
    
  This file was deleted.
      
      Oops, something went wrong.
      
    
  
            File renamed without changes.
          
    
  
  Submodule openzeppelin-contracts
    added at
      
        dbb610
      
    This file was deleted.
      
      Oops, something went wrong.
      
    
  This file was deleted.
      
      Oops, something went wrong.
      
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file can now be deleted? since we have the
.gitmodulesfile at project rootThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is Foundry specific submodules. It needs these for tests to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also foundry keep the run-* files as historical deployment artifacts. I will keep these in case we need to check which contracts were deployed to which chains while we are testing.