streamingfast / go-ethereum

Official Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
9 stars 5 forks source link

BNB blocks finality jumping around on reorg #6

Closed sduchesneau closed 1 year ago

sduchesneau commented 1 year ago

These blocks were produced in this order:

    69638 2023-08-20 22:45:10.000000000 0031030256-867651067609f553-34518f765702442e-31030251-x209.dbin.zst
    64018 2023-08-20 22:45:12.000000000 0031030257-b86e8c8a9e9a339d-867651067609f553-31030251-x209.dbin.zst
   121023 2023-08-20 22:45:14.000000000 0031030258-60d31ce4867d9acb-b86e8c8a9e9a339d-31030255-x209.dbin.zst
   173792 2023-08-20 22:45:15.000000000 0031030259-aeda7a04494b317f-60d31ce4867d9acb-31030256-x209.dbin.zst
   116616 2023-08-20 22:45:19.000000000 0031030260-47fc03b0ad3714e1-aeda7a04494b317f-31030257-x209.dbin.zst (WRONG)

     1520 2023-08-20 22:45:21.000000000 0031030255-c17eb380f3245029-ed3b9f2e27e88b4f-31030255-x209.dbin.zst (WRONG)
     1680 2023-08-20 22:45:21.000000000 0031030256-3eedbc4d95b84cec-34518f765702442e-31030256-x209.dbin.zst (WRONG)
     1674 2023-08-20 22:45:21.000000000 0031030257-c0c62245ae7c545c-867651067609f553-31030257-x209.dbin.zst (WRONG)
     1708 2023-08-20 22:45:21.000000000 0031030258-6dd6d1fdb586e6b0-b86e8c8a9e9a339d-31030258-x209.dbin.zst (WRONG)
     1684 2023-08-20 22:45:21.000000000 0031030259-04393910a1f23e47-60d31ce4867d9acb-31030259-x209.dbin.zst (WRONG)

   130237 2023-08-20 22:45:21.000000000 0031030260-0c49080f3b325ef1-aeda7a04494b317f-31030258-x209.dbin.zst (OK)

the second "batch" of blocks 31030255-31030259 is from the wrong reorg. They shouldn't be emitted since they are above the LIB 3030257 at 22:45:19... HOWEVER, those WRONG blocks have LIB==HEAD, and they are wrong. This breaks the firehose assumptions.

sduchesneau commented 1 year ago

2023-08-20T22:44:55.884Z INFO (reader.geth) imported new chain segment               blocks=1  txs=50   mgas=6.337   elapsed=73.887ms    mgasps=85.761  number=31,030,253 hash=2b551c..deaf9c dirty=2.34GiB
2023-08-20T22:44:59.564Z INFO (reader.geth) downloader queue stats                   receiptTasks=0 blockTasks=0 itemSize=24.19KiB  throttle=8192
2023-08-20T22:44:59.730Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0x3f97d611e408fec4724b2f34e90c73096861a8dd62400943ed3b9f2e27e88b4f
2023-08-20T22:45:00.231Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0x3f97d611e408fec4724b2f34e90c73096861a8dd62400943ed3b9f2e27e88b4f
2023-08-20T22:45:00.252Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0xea689a2c0fff0c7abead5303e030a0474db0924a83d3d8374f7a4b15ac89b7f3
2023-08-20T22:45:00.732Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0x3f97d611e408fec4724b2f34e90c73096861a8dd62400943ed3b9f2e27e88b4f
2023-08-20T22:45:00.753Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0xea689a2c0fff0c7abead5303e030a0474db0924a83d3d8374f7a4b15ac89b7f3
2023-08-20T22:45:01.234Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0x3f97d611e408fec4724b2f34e90c73096861a8dd62400943ed3b9f2e27e88b4f
2023-08-20T22:45:01.253Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0xea689a2c0fff0c7abead5303e030a0474db0924a83d3d8374f7a4b15ac89b7f3
2023-08-20T22:45:01.735Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0x3f97d611e408fec4724b2f34e90c73096861a8dd62400943ed3b9f2e27e88b4f
2023-08-20T22:45:01.754Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0xea689a2c0fff0c7abead5303e030a0474db0924a83d3d8374f7a4b15ac89b7f3
2023-08-20T22:45:02.236Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0x3f97d611e408fec4724b2f34e90c73096861a8dd62400943ed3b9f2e27e88b4f
2023-08-20T22:45:02.255Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0xea689a2c0fff0c7abead5303e030a0474db0924a83d3d8374f7a4b15ac89b7f3
2023-08-20T22:45:02.737Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0x3f97d611e408fec4724b2f34e90c73096861a8dd62400943ed3b9f2e27e88b4f
2023-08-20T22:45:02.757Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0xea689a2c0fff0c7abead5303e030a0474db0924a83d3d8374f7a4b15ac89b7f3
2023-08-20T22:45:03.237Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0x3f97d611e408fec4724b2f34e90c73096861a8dd62400943ed3b9f2e27e88b4f
2023-08-20T22:45:03.258Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0xea689a2c0fff0c7abead5303e030a0474db0924a83d3d8374f7a4b15ac89b7f3
2023-08-20T22:45:03.738Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0x3f97d611e408fec4724b2f34e90c73096861a8dd62400943ed3b9f2e27e88b4f
2023-08-20T22:45:03.758Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0xea689a2c0fff0c7abead5303e030a0474db0924a83d3d8374f7a4b15ac89b7f3
2023-08-20T22:45:03.956Z INFO (reader.geth) chain reorg detected                     number=31,030,252 hash=a62609..7328d2 drop=1 dropfrom=2b551c..deaf9c add=1 addfrom=93c67d..d07388
2023-08-20T22:45:03.958Z INFO (reader.geth) imported new chain segment               blocks=1  txs=97   mgas=31.048  elapsed=7.580s      mgasps=4.096   number=31,030,253 hash=93c67d..d07388 dirty=2.34GiB
2023-08-20T22:45:03.977Z INFO (reader.geth) imported new chain segment               blocks=1  txs=97   mgas=0.000   elapsed=18.221ms    mgasps=0.000   number=31,030,254 hash=3f97d6..e88b4f dirty=2.34GiB    ignored=1
2023-08-20T22:45:04.238Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0x3f97d611e408fec4724b2f34e90c73096861a8dd62400943ed3b9f2e27e88b4f
2023-08-20T22:45:04.259Z INFO (reader.geth) re-queue blocks                          number=31,030,254 hash=0xea689a2c0fff0c7abead5303e030a0474db0924a83d3d8374f7a4b15ac89b7f3
2023-08-20T22:45:04.275Z INFO (reader) reader node statistics {"block_rate": "0.300 blocks/s (479559 total)", "trx_rate": "18.800 trxs/s (60785268 total)", "last_block": "#31030254 (3f97d611e408fec4724b2f34e90c73096861a8dd62400943ed3b9f2e27e88b4f)"}
2023-08-20T22:45:04.387Z INFO (reader.geth) imported new chain segment               blocks=1  txs=131  mgas=14.620  elapsed=163.023ms   mgasps=89.681  number=31,030,255 hash=6671cf..02442e dirty=2.34GiB
2023-08-20T22:45:04.390Z INFO (reader.geth) imported new chain segment               blocks=1  txs=1    mgas=0.109   elapsed=2.626ms     mgasps=41.438  number=31,030,254 hash=ea689a..89b7f3 dirty=2.34GiB
2023-08-20T22:45:05.738Z INFO (reader.geth) imported new chain segment               blocks=1  txs=50   mgas=5.568   elapsed=68.683ms    mgasps=81.063  number=31,030,256 hash=3cff7b..09f553 dirty=2.34GiB
2023-08-20T22:45:07.349Z INFO (reader.geth) deep froze chain segment                 blocks=19 elapsed=9.656ms     number=30,940,256 hash=9a95a7..3f6cc4
2023-08-20T22:45:08.811Z INFO (reader.geth) imported new chain segment               blocks=1  txs=46   mgas=3.663   elapsed=69.774ms    mgasps=52.492  number=31,030,257 hash=a06c6b..9a339d dirty=2.34GiB
2023-08-20T22:45:11.826Z INFO (reader.geth) imported new chain segment               blocks=1  txs=51   mgas=8.748   elapsed=86.243ms    mgasps=101.439 number=31,030,258 hash=981daa..7d9acb dirty=2.34GiB
2023-08-20T22:45:14.374Z INFO (reader.geth) imported new chain segment               blocks=1  txs=98   mgas=10.420  elapsed=127.988ms   mgasps=81.416  number=31,030,259 hash=e1c04f..4b317f dirty=2.35GiB
2023-08-20T22:45:18.178Z INFO (reader.geth) imported new chain segment               blocks=1  txs=72   mgas=6.949   elapsed=123.214ms   mgasps=56.398  number=31,030,260 hash=a26af1..3714e1 dirty=2.35GiB
2023-08-20T22:45:18.903Z INFO (reader.geth) chain reorg detected                     number=31,030,259 hash=e1c04f..4b317f drop=1 dropfrom=a26af1..3714e1 add=1 addfrom=cced7d..325ef1
2023-08-20T22:45:18.905Z INFO (reader.geth) imported new chain segment               blocks=1  txs=83   mgas=7.659   elapsed=73.915ms    mgasps=103.617 number=31,030,260 hash=cced7d..325ef1 dirty=2.35GiB
2023-08-20T22:45:19.095Z INFO (reader.geth) imported new chain segment               blocks=1  txs=1    mgas=0.109   elapsed=1.516ms     mgasps=71.751  number=31,030,255 hash=7e5ab0..245029 dirty=2.35GiB
2023-08-20T22:45:19.234Z INFO (reader.geth) imported new chain segment               blocks=1  txs=1    mgas=0.109   elapsed=2.929ms     mgasps=37.146  number=31,030,256 hash=9fd193..b84cec dirty=2.35GiB
2023-08-20T22:45:20.310Z INFO (reader.geth) imported new chain segment               blocks=1  txs=1    mgas=0.109   elapsed=2.874ms     mgasps=37.859  number=31,030,257 hash=b0c8f9..7c545c dirty=2.35GiB
2023-08-20T22:45:20.493Z INFO (reader.geth) imported new chain segment               blocks=1  txs=1    mgas=0.109   elapsed=2.445ms     mgasps=44.507  number=31,030,258 hash=8ac8d9..86e6b0 dirty=2.35GiB
2023-08-20T22:45:20.845Z INFO (reader.geth) imported new chain segment               blocks=1  txs=68   mgas=5.853   elapsed=90.377ms    mgasps=64.760  number=31,030,261 hash=5a098f..67ae54 dirty=2.35GiB
2023-08-20T22:45:21.007Z INFO (reader.geth) imported new chain segment               blocks=1  txs=1    mgas=0.109   elapsed=2.154ms     mgasps=50.508  number=31,030,259 hash=9b9152..f23e47 dirty=2.34GiB
2023-08-20T22:45:21.809Z INFO (reader.geth) imported new chain segment               blocks=1  txs=76   mgas=5.886   elapsed=57.469ms    mgasps=102.415 number=31,030,261 hash=314e40..2c9427 dirty=2.34GiB
2023-08-20T22:45:23.147Z INFO (reader.geth) imported new chain segment               blocks=1  txs=56   mgas=3.815   elapsed=68.291ms    mgasps=55.859  number=31,030,262 hash=7d3d10..d98aeb dirty=2.35GiB
2023-08-20T22:45:26.138Z INFO (reader.geth) imported new chain segment               blocks=1  txs=40   mgas=3.057   elapsed=50.446ms    mgasps=60.602  number=31,030,263 hash=04c218..df4f66 dirty=2.35GiB```
sduchesneau commented 1 year ago

The proposed fix works! releasing to bsc-v1.2.10-fh2.2-3