erigontech / erigon

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io
GNU Lesser General Public License v3.0
3.16k stars 1.14k forks source link

Gas mismatch when syncing erigon:3.0.0-alpha3 on block 61907281 #12038

Open Aracki opened 2 months ago

Aracki commented 2 months ago

I've started erigon to sync from scratch:

            "--chain=bor-mainnet",
            "--bor.heimdall=http://localhost:1317",
            "--datadir=/root/erigon",
            "--db.pagesize=16kb",
            "--db.size.limit=12TB",
            "--private.api.addr=0.0.0.0:9090",
            "--txpool.api.addr=0.0.0.0:9090",
            "--http.addr=0.0.0.0",
            "--http.port=8545",
            "--http.vhosts=*",
            "--http.corsdomain=*",
            "--http.api=eth,erigon,web3,net,debug,trace,txpool",
            "--ws",
            "--port=30303",
            "--metrics",
            "--metrics.addr=0.0.0.0",
            "--metrics.port=6060",
            "--torrent.download.rate=1gb",
            "--maxpeers=200",
            "--staticpeers=enode://64862bb2030a145d5fb5e7ed916710ac8ae6044defb20b2b8e2a4fdcd1ef67640c356db21b122f8141d13273f6754dd07fb779516e1e22e6b1dbb8cd795c1064@198.244.228.171:30303,enode://09d2b80bb0a77cf4cdba9173d4dbfcb23794658db222f579c7486282d4fc25245b306eccbb250adfd10d906949e918354a0c7b99a8a441528596883bc77dd304@65.21.137.228:30625,enode://e86779dd349b2d17186b893327448ca707f8026b0602f9d8c0db6b0335f297c8ef4eb652e5da046d7f50d9ceefaac96f4a2c22cf057c8da0dceabea0359c5c8f@65.21.137.228:30664,enode://20b0ea306ed98b895b959fd3d2135c5d306855c2e05177233c306cb445ac7bc29728ec62357e5280bd51cd5cc66d462eae01cf2e150c19df5a5f474f494da5f4@65.21.137.228:30527,enode://3d31c3be68d1ed871f18bc3aead140cadaeeb0b555eb378e26cddd66785987d8343ed605ec0dce1500c67b695ab6e058c80e9f85b304aa4950ed06fe0f90a35b@65.21.137.228:30471,enode://f214289c9e156edce45ff79331a7e2ca8449ebe4e0e8e0b0fe7c7740a6d925aa8fcc592e6ae4d7f64d216553185ad6904c60dcc6c498de9222ce4cd30743475a@65.21.229.175:38323,enode://b5fca7649d060aa008dd9310a575ece1aa11819409ddc9d20825512b5a609696bc550bf5b074a7bb1ec1f12e2686565a2d9c181a72ebbe682823606c0e431192@5.161.57.89:30307,enode://366012310f9bc5e37f67f5f6f2e0d185a74c93f0eefc1d4ec5b36c0530de42fea5f5be5b3415a9efcaec62b1e2318838507ac1a504ab2ac27273ab10b54e4e54@162.55.0.250:30345,enode://5ea9b10b8aa28154a865604d5b5eea9a9b803428506c8892921a75522b5aca99b6140fb5098466f5ef03c2617832bd304b49de551ef43fdb0097b4709c39e7ae@167.235.34.105:30788,enode://f11b3c44b6d85975529f8e1eccbcc0fd9b66deb7af1a40c90f0cd9c56b1868ceba431c1d71bd42e2ca8b45d9a785aafd253f29c7ff397a3fbb23b9249cc2db4f@143.244.63.70:30010,enode://219c3848da97335817a1944dbb50877927cdf77262e201c3fa453b3257f33682e90bae04207ecfd79a1e33e94171aa099b9a921cd9156960f6259fb024ab3c78@137.220.50.231:30304,enode://086c9857533c05148f98fabc8a94e159512073cf730c0abe16db17a9a85d293f64b4423a2b5b0f3121e37c6833b7d58b28eba25f26726ec05e60108ee023aec9@94.130.88.243:30303,enode://9db42fb233cd066a0a4a9f3362534d3b6c2331309127fe335b71d91724dde1c056ba3c4d7aeec4ac5d68270694129d1c01ae0bb4fca718e30f98eeddc64d7286@51.195.62.133:30303,enode://501430e7e186333649e0fb924a11a2323317a109f8aadeffdd750e1d896af570bf9ea78e81ca3f385f723f9f5f166b91cd1867f0ce5175703d0c0f814174cf47@65.108.71.81:20303,enode://c080b8ebcf43fd25de8314e504b98a2f7043c195f1982474c67673d464cac88777157292a12814f8e243f0f605a564f5f4940105f225e8f83958dec843644021@65.109.84.26:30303?discport=60239,enode://68d773418fc49c4bbfd13415b55bd2972bcfee2d754f4a1dac77f04a92d0b4d9044472a5381c3ffe59c01f2dc4e54bf9e0a60a66b7545864c49f45113ba9c5de@136.243.32.189:30303,enode://37b590dea78a77214cfc64a153a0a5aa3950ee35952e4dba10b5b601c950ced22527f0792a820c2bd654bbd043381d847aa04d381932b60e97e1b5871949bf8c@10.2.22.149:51683,enode://2fc99f2b92f1dc9dafde3224a63b9019861f24158fa67fecd80103f6aaa8265590d60c4907786357e5830d78136c5be8163d5fd32634b975e110dffded69aaaa@127.0.0.1:30303",

Heimdall has been syncing the latest head, but on erigon side we are getting:

[INFO] [09-19|10:28:55.794] [2/9 Headers] Waiting for headers...     from=61927999 hash=0xe3c7d1ad9beabd7c0ce827561e94a3e5697d43faec78a93dc9033b1618d904c4
[INFO] [09-19|10:28:55.794] [2/9 Headers] Processed                  highest=0 age=55y6mo5d headers=18446744073647623617 in=0.001 blk/sec=9223372036854775808
[INFO] [09-19|10:28:55.799] [7/9 Execution] starting                 from=61907280 to=61927999 fromTxNum=4557812485 offsetFromBlockBeginning=14 initialCycle=true useExternalTx=false
[WARN] [09-19|10:28:55.871] [7/9 Execution] Execution failed         block=61907281 txNum=4557812661 hash=0x6c214d7739454b7458c8e44745d833b90f964c14b21c6c8bd4145755b8dd18de err="invalid block, txnIdx=125, gas used by execution: 23535161, in header: 22583688, headerNum=61907281, 6c214d7739454b7458c8e44745d833b90f964c14b21c6c8bd4145755b8dd18de"
[INFO] [09-19|10:28:55.871] [7/9 Execution] Done                     blk=61907280 blks=1 blk/s=13.8 txs=162 tx/s=2.23k gas/s=385.18M buf=236.0KB/512.0MB stepsInDB=0.00 step=2917.0 alloc=30.9GB sys=39.1GB
[EROR] [09-19|10:28:55.901] Staged Sync                              err="bad block unwinding"

For some reason execution gas used and expected are not the same.

I've tried to sync from scratch two times, and both times it was the same problematic block to execute. 61,907,281

Zorato commented 2 months ago

I have the same issue on different block

[INFO] [09-23|14:11:23.040] [7/9 Execution] starting                 from=61798394 to=61832372 fromTxNum=4549999892 offsetFromBlockBeginning=107 initialCycle=true useExternalTx=false
[WARN] [09-23|14:11:23.115] [7/9 Execution] Execution failed         block=61798395 txNum=4550000336 hash=0xcef48cbc6d524c3a2c3fa4717484952156351f90a0859d3dcb7f4488dbd3cbef err="invalid block, txnIdx=253, gas used by execution: 46110321, in header: 29995552, headerNum=61798395, cef48cbc6d524c3a2c3fa4717484952156351f90a0859d3dcb7f4488dbd3cbef"
[INFO] [09-23|14:11:23.116] [7/9 Execution] Done                     blk=61798394 blks=1 blk/s=13.2 txs=337 tx/s=4.46k gas/s=991.29M buf=95.9KB/2.0GB stepsInDB=0.00 step=2912.0 alloc=28.6GB sys=43.6GB
[EROR] [09-23|14:11:23.162] Staged Sync                              err="bad block unwinding"
RedstonedLife commented 2 weeks ago

Got the same issue on a different chain (Ethereum mainnet)

Nov 15 05:06:48 enode-01 erigon[53116]: [WARN] [11-15|05:06:48.775] [4/6 Execution] Execution failed         block=21142398 txNum=2614062978 hash=0x9bec0c568bcfaacedc58911c58525617eca40c1d1baa008a15f2e89cbf301ba5 err="invalid block, txnIdx=282, gas used by execution: 17153539, in header: 17684565, headerNum=21142398, 9bec0c568bcfaacedc58911c58525617eca40c1d1baa008a15f2e89cbf301ba5"
Nov 15 05:06:48 enode-01 erigon[53116]: [INFO] [11-15|05:06:48.782] [4/6 Execution] Done                     blk=21142397 blks=1 blk/s=0.3 txs=479 tx/s=123 gas/s=8.16M buf=338.0KB/3.0GB stepsInDB=0.00 step=1673.0 alloc=13.5GB sys=33.1GB
Nov 15 05:06:48 enode-01 erigon[53116]: [EROR] [11-15|05:06:48.785] Could not start execution service        err="bad block unwinding"

The issue seems to exist in 3.0.0-alpha5 too