ethereum-optimism / docs

Optimism Developer Docs
https://docs.optimism.io
85 stars 148 forks source link

[TUTORIAL] Improve L2 Testnet Tutorial #627

Open sbvegan opened 5 months ago

sbvegan commented 5 months ago

Brief Description of the Docs Request

The, "Creating Your Own L2 Rollup Testnet" tutorial is currently pinned at an older branch so the tutorial doesn't break with the latest changes to develop. We should update it to be more recent.

Description of the Documentation You'd Like

Two approaches:

  1. Update the tutorials/chain in the monorepo, verify the tutorial works as expected
  2. Update the tutorial to be more evergreen. Explain that you need to deploy the contracts from op-contracts-vX.X.X, and run the client software from a different branch. Also check that the genesis and rollup config generation is solid.

Links to Related Pages

https://docs.optimism.io/builders/chain-operators/tutorials/create-l2-rollup

Additional Context

Feedback in this comment and thread from a chain operator: https://github.com/ethereum-optimism/superchain-registry/pull/125#issuecomment-2041415502 More feedback: https://github.com/ethereum-optimism/developers/discussions/329#discussioncomment-9016221

Chomtana commented 5 months ago

Someone also says op-contracts/v1.3.0 branch can't deploy

https://github.com/ethereum-optimism/developers/discussions/344

It still fail after switch to op-contracts/v1.3.0. cause of failure seems to be latest release of foundry. set specific version when install foundry. below is example https://github.com/gokch/optimism_builder/blob/main/init/Dockerfile#L21

https://github.com/ethereum-optimism/developers/discussions/329

Hey, I solved this problem by following their suggestions. OP has made changes in the codebase to generate the genesis and rollup. You may want to follow the discussion below to make it work. Two highlights: 1. uses https://github.com/ethereum-optimism/optimism/tree/op-contracts/v1.3.0 to deploy v1 contract 2.write your l1-deployment json file like https://github.com/ethereum-optimism/superchain-registry/blob/main/superchain/extra/addresses/sepolia/base.json

Chomtana commented 5 months ago

Branch op-contracts/v1.3.0 and beyond doesn't have sync() anymore but the document is still using sync()

opfocus commented 5 months ago

In the "Creating Your Own L2 Rollup Testnet" tutorial, two issues are currently being faced:

420516460 commented 5 months ago

When I deployed the op according to the tutorial, i ran into three new issues:

  1. executing forge script scripts/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL --slow to deploy the contract to L1, it comes up:
    
    Error: 
    Failed to send transaction

Context:

  1. Newer versions dont rely on the artifacts. So create genesis files command should be changed to:

    go run cmd/main.go genesis l2 \
    --deploy-config ../packages/contracts-bedrock/deploy-config/getting-started.json \
    --l1-deployments ../packages/contracts-bedrock/deployments/getting-started/.deploy \
    --outfile.l2 genesis.json \
    --outfile.rollup rollup.json \
    --l1-rpc $L1_RPC_URL
  2. since artifacts have been remove, so some of the artifact-dependent commands should be modified and described accordingly, for example op-proposer start command:

    ./bin/op-proposer \
    --poll-interval=12s \
    --rpc.port=8560 \
    --rollup-rpc=http://localhost:8547 \
    --l2oo-address=$(cat ../packages/contracts-bedrock/deployments/getting-started/L2OutputOracleProxy.json | jq -r .address) \
    --private-key=$GS_PROPOSER_PRIVATE_KEY \
    --l1-eth-rpc=$L1_RPC_URL
sbvegan commented 5 months ago

Another report of this tutorial being broken: https://github.com/ethereum-optimism/developers/discussions/351 Additional context: https://github.com/ethereum-optimism/developers/discussions/17#discussioncomment-9145846

richardhuaaa commented 3 months ago

The chainid.link for connecting a wallet to the rollup also does not work currently, although just using metamask seems fine. Setting the correct RPC address and chain ID is needed though