ethereum-optimism / optimism

Optimism is Ethereum, scaled.
https://optimism.io
MIT License
5.53k stars 3.17k forks source link

Failed to start devnet #7895

Closed snail-inO closed 10 months ago

snail-inO commented 10 months ago

Describe the bug Failed to bring up devnet

To Reproduce Steps to reproduce the behavior:

  1. At project root directory
  2. run make devnet-up

Expected behavior Bringing up devnet without failure

Screenshots

hua@hserv:~/codes/optimism$ make devnet-up
make[1]: Entering directory '/home/hua/codes/optimism'
./ops/scripts/geth-version-checker.sh && \
        (echo "Geth versions match, not installing geth..."; true) || \
                (echo "Versions do not match, installing geth!"; \
                        go install -v github.com/ethereum/go-ethereum/cmd/geth@v1.13.4; \
                        echo "Installed geth!"; true)
Geth version v1.13.4-stable is correct!
Geth versions match, not installing geth...
make[1]: Leaving directory '/home/hua/codes/optimism'
./ops/scripts/newer-file.sh .devnet/allocs-l1.json ./packages/contracts-bedrock \
        || make devnet-allocs
make[1]: Entering directory '/home/hua/codes/optimism'
make[2]: Entering directory '/home/hua/codes/optimism'
./ops/scripts/geth-version-checker.sh && \
        (echo "Geth versions match, not installing geth..."; true) || \
                (echo "Versions do not match, installing geth!"; \
                        go install -v github.com/ethereum/go-ethereum/cmd/geth@v1.13.4; \
                        echo "Installed geth!"; true)
Geth version v1.13.4-stable is correct!
Geth versions match, not installing geth...
make[2]: Leaving directory '/home/hua/codes/optimism'
PYTHONPATH=./bedrock-devnet python3 ./bedrock-devnet/main.py --monorepo-dir=. --allocs
[INFO|10-27-2023 07:24:30] Generating L1 genesis state
[INFO|10-27-2023 07:24:30] Trying 127.0.0.1:8545
INFO [10-27|07:24:30.534] Starting Geth in ephemeral dev mode... 
WARN [10-27|07:24:30.534] You are running Geth in --dev mode. Please note the following:

  1. This mode is only intended for fast, iterative development without assumptions on
     security or persistence.
  2. The database is created in memory unless specified otherwise. Therefore, shutting down
     your computer or losing power will wipe your entire block data and chain state for
     your dev environment.
  3. A random, pre-allocated developer account will be available and unlocked as
     eth.coinbase, which can be used for testing. The random dev account is temporary,
     stored on a ramdisk, and will be lost if your machine is restarted.
  4. Mining is enabled by default. However, the client will only seal blocks if transactions
     are pending in the mempool. The miner's minimum accepted gas price is 1.
  5. Networking is disabled; there is no listen-address, the maximum number of peers is set
     to 0, and discovery is disabled.

INFO [10-27|07:24:30.539] Maximum peer count                       ETH=50 LES=0 total=50
INFO [10-27|07:24:30.541] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
DEBUG[10-27|07:24:30.543] FS scan times                            list="50.473µs" set="1.061µs" diff="1.967µs"
DEBUG[10-27|07:24:30.546] Sanitizing Go's GC trigger               percent=100
INFO [10-27|07:24:30.546] Enabling recording of key preimages since archive mode is used 
WARN [10-27|07:24:30.547] Disabled transaction unindexing for archive node 
INFO [10-27|07:24:30.547] Set global gas cap                       cap=50,000,000
INFO [10-27|07:24:30.833] Using developer account                  address=0xb4b731533F7DF82d1A5E5B17Fcb797514B0F80A0
INFO [10-27|07:24:30.833] Initializing the KZG library             backend=gokzg
INFO [10-27|07:24:30.871] Allocated trie memory caches             clean=307.00MiB dirty=0.00B
INFO [10-27|07:24:30.872] State schema set to default              scheme=hash
INFO [10-27|07:24:30.872] Initialising Ethereum protocol           network=1337 dbversion=<nil>
INFO [10-27|07:24:30.872] Writing custom genesis block 
INFO [10-27|07:24:30.873] Persisted trie from memory database      nodes=12 size=1.83KiB time="192.053µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=0 livesize=0.00B
INFO [10-27|07:24:30.874]  
INFO [10-27|07:24:30.874] --------------------------------------------------------------------------------------------------------------------------------------------------------- 
INFO [10-27|07:24:30.874] Chain ID:  1337 (unknown) 
INFO [10-27|07:24:30.874] Consensus: unknown 
INFO [10-27|07:24:30.874]  
INFO [10-27|07:24:30.874] Pre-Merge hard forks (block based): 
INFO [10-27|07:24:30.874]  - Homestead:                   #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/homestead.md) 
INFO [10-27|07:24:30.874]  - Tangerine Whistle (EIP 150): #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/tangerine-whistle.md) 
INFO [10-27|07:24:30.874]  - Spurious Dragon/1 (EIP 155): #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/spurious-dragon.md) 
INFO [10-27|07:24:30.874]  - Spurious Dragon/2 (EIP 158): #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/spurious-dragon.md) 
INFO [10-27|07:24:30.874]  - Byzantium:                   #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/byzantium.md) 
INFO [10-27|07:24:30.874]  - Constantinople:              #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/constantinople.md) 
INFO [10-27|07:24:30.874]  - Petersburg:                  #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/petersburg.md) 
INFO [10-27|07:24:30.874]  - Istanbul:                    #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/istanbul.md) 
INFO [10-27|07:24:30.874]  - Muir Glacier:                #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/muir-glacier.md) 
INFO [10-27|07:24:30.874]  - Berlin:                      #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/berlin.md) 
INFO [10-27|07:24:30.874]  - London:                      #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/london.md) 
INFO [10-27|07:24:30.874]  - Arrow Glacier:               #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md) 
INFO [10-27|07:24:30.874]  - Gray Glacier:                #0        (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md) 
INFO [10-27|07:24:30.874]  
INFO [10-27|07:24:30.874] Merge configured: 
INFO [10-27|07:24:30.874]  - Hard-fork specification:    https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/paris.md 
INFO [10-27|07:24:30.874]  - Network known to be merged: true 
INFO [10-27|07:24:30.874]  - Total terminal difficulty:  0 
INFO [10-27|07:24:30.874]  
INFO [10-27|07:24:30.874] Post-Merge hard forks (timestamp based): 
INFO [10-27|07:24:30.874]  - Shanghai:                    @0          (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md) 
INFO [10-27|07:24:30.874]  
INFO [10-27|07:24:30.874] --------------------------------------------------------------------------------------------------------------------------------------------------------- 
INFO [10-27|07:24:30.874]  
INFO [10-27|07:24:30.875] Loaded most recent local block           number=0 hash=e685bd..f3d357 td=0 age=54y7mo1w
WARN [10-27|07:24:30.875] Failed to load snapshot                  err="missing or corrupted snapshot"
INFO [10-27|07:24:30.875] Rebuilding state snapshot 
DEBUG[10-27|07:24:30.875] Journalled generator progress            progress=empty
DEBUG[10-27|07:24:30.875] Start snapshot generation                root=032a01..7e570a
INFO [10-27|07:24:30.875] Resuming state snapshot generation       root=032a01..7e570a accounts=0 slots=0 storage=0.00B dangling=0 elapsed="624.712µs"
INFO [10-27|07:24:30.875] Initialized transaction indexer          limit=0
DEBUG[10-27|07:24:30.876] Regenerated state range                  kind=account prefix=0x61 root=032a01..7e570a last=0x count=10 created=10 updated=0 untouched=0 deleted=0
DEBUG[10-27|07:24:30.876] Journalled generator progress            progress=done
INFO [10-27|07:24:30.876] Generated state snapshot                 accounts=10 slots=0 storage=412.00B dangling=0 elapsed="994.702µs"
DEBUG[10-27|07:24:30.896] Blobpool tip threshold updated           tip=1
INFO [10-27|07:24:30.897] Chain post-merge, sync via beacon client 
INFO [10-27|07:24:30.897] Unprotected transactions allowed 
INFO [10-27|07:24:30.897] Gasprice oracle is ignoring threshold set threshold=2
INFO [10-27|07:24:30.898] Entered PoS stage 
INFO [10-27|07:24:30.898] Starting peer-to-peer node               instance=Geth/v1.13.4-stable/linux-amd64/go1.21.3
WARN [10-27|07:24:30.898] P2P server will be useless, neither dialing nor listening 
INFO [10-27|07:24:30.904] New local node record                    seq=1,698,391,470,902 id=3f3f1a8c34b8a9bb ip=127.0.0.1 udp=0 tcp=0
INFO [10-27|07:24:30.905] Started P2P networking                   self=enode://9f00a668bd506e2add5f07a47906532d61c32fc5b5387ebc5445a58a1da25ce865ddfe058de3411ea703e8afbc0521b41a802efd4a588bfb9083abe6dc680340@127.0.0.1:0
DEBUG[10-27|07:24:30.905] IPCs registered                          namespaces=admin,debug,web3,eth,txpool,miner,net,dev
DEBUG[10-27|07:24:30.905] External IP changed                      ip="&{ch:0xc0004a6060 clock:{} timer:0xc0004aa050 deadline:4206293637586}" interface=NAT-PMP(192.168.1.1)
INFO [10-27|07:24:30.905] IPC endpoint opened                      url=/tmp/geth.ipc
INFO [10-27|07:24:30.906] HTTP server started                      endpoint=127.0.0.1:8545 auth=false prefix=     cors= vhosts=localhost
DEBUG[10-27|07:24:31.136] FS scan times                            list="95.91µs"  set="21.483µs" diff="4.588µs"
[INFO|10-27-2023 07:24:31] Trying 127.0.0.1:8545
[INFO|10-27-2023 07:24:31] Connected 127.0.0.1:8545
[INFO|10-27-2023 07:24:31] Waiting for RPC server at 127.0.0.1:8545
DEBUG[10-27|07:24:31.491] Served eth_chainId                       conn=127.0.0.1:50070 reqid=1 duration="109.277µs"
[INFO|10-27-2023 07:24:31] RPC server at 127.0.0.1:8545 ready
[INFO|10-27-2023 07:24:31] Fetch eth_accounts 127.0.0.1:8545
DEBUG[10-27|07:24:31.493] Served eth_accounts                      conn=127.0.0.1:50076 reqid=2 duration="106.277µs"
[INFO|10-27-2023 07:24:31] Deploying with 0xb4b731533f7df82d1a5e5b17fcb797514b0f80a0
DEBUG[10-27|07:24:31.511] Served eth_chainId                       conn=127.0.0.1:50082 reqid=1 duration="39.122µs"
DEBUG[10-27|07:24:31.512] Served eth_getBlockByNumber              conn=127.0.0.1:50082 reqid=2 duration="410.321µs"
DEBUG[10-27|07:24:31.513] Served eth_feeHistory                    conn=127.0.0.1:50082 reqid=3 duration="329.493µs"
DEBUG[10-27|07:24:31.515] Served eth_estimateGas                   conn=127.0.0.1:50082 reqid=4 duration=1.107076ms
INFO [10-27|07:24:31.517] Setting new local account                address=0xb4b731533F7DF82d1A5E5B17Fcb797514B0F80A0
INFO [10-27|07:24:31.517] Submitted transaction                    hash=0x85cd4f3fb2afe3e0986ef11d09ca8be31ce8bbbb092cf99d6544126652883a98 from=0xb4b731533F7DF82d1A5E5B17Fcb797514B0F80A0 nonce=0 recipient=0x3fAB184622Dc19b6109349B94811493BF2a45362 value=1,000,000,000,000,000,000
DEBUG[10-27|07:24:31.517] Served eth_sendTransaction               conn=127.0.0.1:50082 reqid=5 duration=1.399915ms
DEBUG[10-27|07:24:31.517] Distributed transactions                 plaintxs=1 blobtxs=0 largetxs=0 bcastpeers=0 bcastcount=0 annpeers=0 anncount=0
INFO [10-27|07:24:31.517] Starting work on payload                 id=0xa1d52584d4a43392
INFO [10-27|07:24:31.517] Updated payload                          id=0xa1d52584d4a43392 number=1 hash=6e0eb1..0e1d87 txs=1 withdrawals=0 gas=21000 fees=6.3e-05 root=709164..2fbcd8 elapsed="245.688µs"
DEBUG[10-27|07:24:31.518] Served eth_getTransactionReceipt         conn=127.0.0.1:50082 reqid=6 duration="94.359µs"
INFO [10-27|07:24:31.518] Stopping work on payload                 id=0xa1d52584d4a43392 reason=delivery
DEBUG[10-27|07:24:31.519] Persisted trie from memory database      nodes=9  size=1.39KiB time="75.81µs"   gcnodes=0 gcsize=0.00B gctime=0s livenodes=0 livesize=0.00B
INFO [10-27|07:24:31.519] Imported new potential chain segment     number=1 hash=6e0eb1..0e1d87 blocks=1 txs=1 mgas=0.021 elapsed=1.003ms     mgasps=20.931 snapdiffs=157.00B triedirty=0.00B
INFO [10-27|07:24:31.519] Chain head was updated                   number=1 hash=6e0eb1..0e1d87 root=709164..2fbcd8 elapsed="84.97µs"
DEBUG[10-27|07:24:31.519] Indexed transactions                     blocks=2 txs=1 tail=0 elapsed="151.356µs"
DEBUG[10-27|07:24:31.519] Reinjecting stale transactions           count=0
DEBUG[10-27|07:24:31.619] Served eth_getTransactionByHash          conn=127.0.0.1:50082 reqid=7 duration=1.115677ms
DEBUG[10-27|07:24:31.621] Served eth_getTransactionReceipt         conn=127.0.0.1:50082 reqid=8 duration="984.407µs"

blockHash               0x6e0eb12eeba515fac132a0e023da71d452cbe86fdb14dbe4d7a8cfcbf80e1d87
blockNumber             1
contractAddress         
cumulativeGasUsed       21000
effectiveGasPrice       3875000000
gasUsed                 21000
logs                    []
logsBloom               0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
root                    
status                  1
transactionHash         0x85cd4f3fb2afe3e0986ef11d09ca8be31ce8bbbb092cf99d6544126652883a98
transactionIndex        0
type                    2
INFO [10-27|07:24:31.640] Setting new local account                address=0x3fAB184622Dc19b6109349B94811493BF2a45362
INFO [10-27|07:24:31.640] Submitted contract creation              hash=0xeddf9e61fb9d8f5111840daef55e5fde0041f5702856532cdbb5a02998033d26 from=0x3fAB184622Dc19b6109349B94811493BF2a45362 nonce=0 contract=0x4e59b44847b379578588920cA78FbF26c0B4956C value=0
DEBUG[10-27|07:24:31.640] Distributed transactions                 plaintxs=1 blobtxs=0 largetxs=0 bcastpeers=0 bcastcount=0 annpeers=0 anncount=0
DEBUG[10-27|07:24:31.640] Served eth_sendRawTransaction            conn=127.0.0.1:50098 reqid=1 duration=1.172664ms
INFO [10-27|07:24:31.641] Starting work on payload                 id=0x0aee7dc28f9201b3
INFO [10-27|07:24:31.641] Updated payload                          id=0x0aee7dc28f9201b3 number=2 hash=a566d9..a3d857 txs=1 withdrawals=0 gas=68137 fees=0.006761522176 root=9c5758..a88a42 elapsed="299.923µs"
INFO [10-27|07:24:31.641] Stopping work on payload                 id=0x0aee7dc28f9201b3 reason=delivery
DEBUG[10-27|07:24:31.642] Persisted trie from memory database      nodes=9  size=1.37KiB time="90.718µs"  gcnodes=0 gcsize=0.00B gctime=0s livenodes=0 livesize=0.00B
INFO [10-27|07:24:31.642] Imported new potential chain segment     number=2 hash=a566d9..a3d857 blocks=1 txs=1 mgas=0.068 elapsed="919.511µs" mgasps=74.101 snapdiffs=315.00B triedirty=0.00B
INFO [10-27|07:24:31.642] Chain head was updated                   number=2 hash=a566d9..a3d857 root=9c5758..a88a42 elapsed="383.668µs"
DEBUG[10-27|07:24:31.643] Reinjecting stale transactions           count=0
DEBUG[10-27|07:24:31.742] Served eth_getTransactionByHash          conn=127.0.0.1:50098 reqid=2 duration="912.695µs"
DEBUG[10-27|07:24:31.744] Served eth_getTransactionReceipt         conn=127.0.0.1:50098 reqid=3 duration=1.657245ms
{"transactionHash":"0xeddf9e61fb9d8f5111840daef55e5fde0041f5702856532cdbb5a02998033d26","transactionIndex":"0x0","blockHash":"0xa566d90bd64829553d03c32f9245a2ca14f96947dd7fd08c7fd7c1e860a3d857","blockNumber":"0x2","from":"0x3fab184622dc19b6109349b94811493bf2a45362","to":null,"cumulativeGasUsed":"0x10a29","gasUsed":"0x10a29","contractAddress":"0x4e59b44847b379578588920ca78fbf26c0b4956c","logs":[],"status":"0x1","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","type":"0x0","effectiveGasPrice":"0x174876e800"}
DEBUG[10-27|07:24:31.767] Served eth_getTransactionCount           conn=127.0.0.1:50112 reqid=1 duration="166.166µs"
Error: 
Failed to resolve file: "/home/hua/codes/optimism/packages/contracts-bedrock/lib/forge-std/src/Script.sol": No such file or directory (os error 2).
 Check configured remappings..
    --> "/home/hua/codes/optimism/packages/contracts-bedrock/scripts/Deploy.s.sol"
        "forge-std/Script.sol"
INFO [10-27|07:24:31.855] Got interrupt, shutting down... 
DEBUG[10-27|07:24:31.856] RPC server shutting down 
INFO [10-27|07:24:31.856] HTTP server stopped                      endpoint=127.0.0.1:8545
DEBUG[10-27|07:24:31.856] RPC server shutting down 
INFO [10-27|07:24:31.856] IPC endpoint closed                      url=/tmp/geth.ipc
DEBUG[10-27|07:24:31.856] RPC server shutting down 
DEBUG[10-27|07:24:31.856] RPC connection read error                err="io: read/write on closed pipe"
INFO [10-27|07:24:31.856] Ethereum protocol stopped 
DEBUG[10-27|07:24:31.856] RPC connection read error                err=EOF
INFO [10-27|07:24:31.856] Transaction pool stopped 
DEBUG[10-27|07:24:31.856] Journalled generator progress            progress=done
DEBUG[10-27|07:24:31.856] Journalled disk layer                    root=032a01..7e570a
DEBUG[10-27|07:24:31.856] Journalled diff layer                    root=709164..2fbcd8 parent=032a01..7e570a
DEBUG[10-27|07:24:31.857] Journalled diff layer                    root=9c5758..a88a42 parent=709164..2fbcd8
INFO [10-27|07:24:31.857] Blockchain stopped 
Traceback (most recent call last):
  File "/home/hua/codes/optimism/./bedrock-devnet/main.py", line 9, in <module>
    main()
  File "/home/hua/codes/optimism/./bedrock-devnet/main.py", line 5, in main
    devnet.main()
  File "/home/hua/codes/optimism/bedrock-devnet/devnet/__init__.py", line 97, in main
    devnet_l1_genesis(paths)
  File "/home/hua/codes/optimism/bedrock-devnet/devnet/__init__.py", line 179, in devnet_l1_genesis
    raise Exception(f"Exception occurred in child process: {err}")
Exception: Exception occurred in child process: Command '['forge', 'script', 'scripts/Deploy.s.sol:Deploy', '--sender', '0xb4b731533f7df82d1a5e5b17fcb797514b0f80a0', '--rpc-url', 'http://127.0.0.1:8545', '--broadcast', '--unlocked']' returned non-zero exit status 1.
make[1]: *** [Makefile:140: devnet-allocs] Error 1
make[1]: Leaving directory '/home/hua/codes/optimism'
make: *** [Makefile:115: devnet-up] Error 2

System Specs:

Additional context It would be better to include prerequisites in the docs.

ajsutton commented 10 months ago

Have you checked out the submodules? git submodule update --init --recursive may help.

snail-inO commented 10 months ago

Have you checked out the submodules? git submodule update --init --recursive may help.

Thanks! It works now.