docs icon indicating copy to clipboard operation
docs copied to clipboard

[TUTORIAL] Improve L2 Testnet Tutorial

Open sbvegan opened this issue 1 year ago • 6 comments

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

sbvegan avatar Apr 08 '24 13:04 sbvegan

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 avatar Apr 16 '24 17:04 Chomtana

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

Chomtana avatar Apr 16 '24 17:04 Chomtana

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

  • The forge script scripts/Deploy.s.sol:Deploy --sig 'sync()' --rpc-url $L1_RPC_URL in the tutorial is no longer applicable when users create using the release branch instead of the tutorials/chains branch. https://github.com/ethereum-optimism/developers/discussions/110

  • Even when following the steps in the tutorials/chains branch, users are still encountering issues. https://github.com/ethereum-optimism/optimism/issues/10114 https://github.com/ethereum-optimism/developers/discussions/354 https://discord.com/channels/667044843901681675/1080867873997729874/1229086983486443631 https://discord.com/channels/667044843901681675/1080867873997729874/1229518752895336529 https://discord.com/channels/667044843901681675/1080867873997729874/1229248209529077880

it seems that all the issues point towards the process involving the forge script scripts/Deploy.s.sol:Deploy --sig 'sync()' --rpc-url $L1_RPC_URL.

opfocus avatar Apr 17 '24 02:04 opfocus

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:
- server returned an error response: error code -32000: max priority fee per gas higher than max fee per gas

solution: remove --slow flag and add --with-gas-price <value> flag, such as --with-gas-price 2gwei.

  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
  1. 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

420516460 avatar Apr 17 '24 06:04 420516460

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

sbvegan avatar Apr 17 '24 16:04 sbvegan

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

richardhuaaa avatar Jun 13 '24 19:06 richardhuaaa

closing in favor of https://github.com/ethereum-optimism/docs/issues/917

sbvegan avatar Sep 23 '24 21:09 sbvegan