Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BNB blocks finality jumping around on reorg #6

Closed
sduchesneau opened this issue Aug 21, 2023 · 2 comments
Closed

BNB blocks finality jumping around on reorg #6

sduchesneau opened this issue Aug 21, 2023 · 2 comments

Comments

@sduchesneau
Copy link

sduchesneau commented Aug 21, 2023

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
Copy link
Author

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 sduchesneau changed the title BNB blocks finality issues BNB blocks finality jumping around on reorg Aug 21, 2023
sduchesneau added a commit that referenced this issue Sep 1, 2023
@sduchesneau
Copy link
Author

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

maoueh pushed a commit that referenced this issue Apr 29, 2024
This commit squashes the op-geth fork history into a more maintainable
diff for rebasing upon upstream geth.

reference-optimistic-geth changes (origins of op-geth in early Bedrock
development stage):
- Deposit TX Type
- Enable deposit tx in EVM/tx pool
- Change deposit nonce to not be the max nonce
- Extend PayloadAttributesV1 with a Transactions field
- Force deposits at the start of each L2 block
- Fix height check
- noTxPool flag, reproduce block in verifier mode without tx pool interference
- Fix RPC json marshalling (ref op-geth PR 4)
- Deposit txs block height check in block body validation (ref op-geth PR 5)
- core: do not try to reinject deposit txs into tx-pool (ref-op-geth PR 6)
- deposit source hash field instead of L2 block height and tx index combination
- Include invalid deposits, rewind state, but always persist mint (#10)
- Provide gas to Call/Create in deposit transactions (#12)
- Add docker builds (ref-op-geth PR 16, 17)
- Don't panic on deposit transaction signature values or chain ID (ref-op-geth PR 18)
- core: Add version to DepositTx (ref-op-geth PR 19)
- Enable Geth build/lint/test in CircleCI (ref-op-geth PR 23)
- core: Include guaranteed gas in the gas pool (ref-op-geth PR 21)
- core: handle base fee, l1 availability fee, tx fee (ref-op-geth PR 27)
- fix: deposit tx hash
- fix l1 fee cache, rpc, tracing and tx pool
- core: remove deposit-tx sub-type (a.k.a. deposit version byte)
- eth/catalyst: allow engine user to reorg own chain
- miner: restore ability to reorg deep as block builder
- params: print Optimism consensus type in banner
- core/types: remove unused protected() method, see upstream PR 23376
- core: do not mutate original balance value in tx pool l1 cost adjustment
- core: subtract deposit gas from pool, so other txs do not use the same gas. And fail tx processing if deposits reach gas limit
- core/types: deposits do not tip, avoid basefee subtraction
- Unmeter the L1 Attributes Transaction
- miner: handle force tx errors as critical, clean up diff
- ci: Switch branch
- eth,miner: return STATUS_INVALID when failing to process forced transactions in request (ref-op-geth PR 40)
- verifier: forward tx to sequencer based on flag
- txpool: add flag to disable tx gossip (ref-op-geth PR 42)
- Add op-geth version in addition to geth version (ref-op-geth PR 43)
- ci: CircleCI improvements (ref-op-geth PR 44)
- Rename to op-geth
- Build latest tag on optimism branch

op-geth changes:
- Expose cache config in simulated backend (#2)
- Add EIP-1559 parameters
- eth/catalyst: update payload id computation (#1)
- make eip1559 configurable (#4)
- post-merge network should not log warnings about missing transition information (#5)
- Make the simulator more configurable (#6)
- fix OPB-6 - IsDepositTx check instead of artificial nonce value check (#7)
- Simulated backend - enable proof of stake consensus type and fix performance issue (#8)
- accounts: simulated backend consensus engine option and immediate tx indexing
- consensus/beacon: recognize all blocks as reached TTD with 0 TTD in chain config
- Add --rollup.historicalhttp CLI flag and fix backend iface
- Flags and interfaces for historical RPC requests (#12)
- Redirect historical RPC requests (ethereum#13)
- Use the pre-existing ethereum.NotFound error (ethereum#18)
- Add historical endpoint to TraceBlockByNumber and TraceBlockByHash (ethereum#19)
- Add historical endpoint to TraceTransaction (ethereum#20)
- Add historical endpoint to TraceCall (ethereum#21)
- optimism: fee params from info txi, update l1 cost func GPO params read (ethereum#15)
- add hardcoded addresses for fee payouts (ethereum#23)
- dynamic gas limit via engine API (ethereum#22)

Co-authored-by: Matthew Slipper <me@matthewslipper.com>
Co-authored-by: Joshua Gutow <jgutow@oplabs.co>
Co-authored-by: protolambda <proto@protolambda.com>
Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
Co-authored-by: Maurelian <maurelian@protonmail.ch>
sduchesneau pushed a commit that referenced this issue Jun 14, 2024
Store User Modules in Geth's Database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant