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

Firehose outputs blocks with very old LIBNUM when lighthouse/beacon not in sync #1

Closed
sduchesneau opened this issue Sep 7, 2022 · 5 comments

Comments

@sduchesneau
Copy link

Description

In some conditions, the geth instance is running with 'optimistic' chain head (?) and will produce blocks with a bad libnum

  • Example from Ropsten
  "libNum": "12660716",
  "headNum": "12747578",
  "headID": "b869c6f610588ed5618f24cb1e9d8beff6451d85bfec48950700f509092046e5",
  "headTime": "2022-08-08T21:45:12Z"
}````

* Logs that seem relevant
  * lighthouse
```Sep  7 00:53:54 ropsten-sfdm37 lighthouse[1950008]: Sep 07 00:53:54.002 WARN Head is optimistic                      execution_block_hash: 0x1ce8b5b3423323ec86bba8d77f591f8d17bf3cf9394a59081b4be8967ef37493, info: chain not fully verified, block and attestation production disabled until execution engine syncs, service: slot_notifier
Sep  7 00:53:54 ropsten-sfdm37 lighthouse[1950008]: Sep 07 00:53:54.002 INFO Synced                                  slot: 715769, block: 0x3019…4c78, epoch: 22367, finalized_epoch: 22365, finalized_root: 0x2185…4cd4, exec_hash: 0x1ce8…7493 (unverified), peers: 18, service: slot_notifier
Sep  7 00:53:54 ropsten-sfdm37 lighthouse[1950008]: Sep 07 00:53:54.002 WARN Syncing deposit contract block cache    est_blocks_remaining: 933, service: slot_notifier```
  * beacon
  ```7358 Sep  7 00:53:01 ropsten-sfdm37 sf[1953540]: 2022-09-07T00:53:01.293Z WARN (reader.geth) beacon chain gapped                      head=12,941,410 newHead=12,941,419```

This will cause lots of problem in firehose (merger, etc.)
especially if that new libnum is BELOW previously known libnum (we have merged files up to block 499, but then, geth with firehose produces block 550 with libnum=300 ... this breaks the merger...)





# System
Geth version:  `1.10.23-fh2`
OS & Version: Linux

@sduchesneau
Copy link
Author

@maoueh @matthewdarwin ^

@sduchesneau
Copy link
Author

sduchesneau commented Sep 7, 2022

The libnum (12660716) was the last finalized block when the mindreader was restarted:

Sep  7 00:52:42 ropsten-sfdm37 sf[1953540]: 2022-09-07T00:52:42.664Z INFO (reader.geth) loaded most recent local finalized block number=12,660,716 hash=44d789..f54956 td=50,353,550,149,371,329 age=1mo1w6d

More logs:

Sep  7 00:57:04 ropsten-sfdm37 sf[1953540]: 2022-09-07T00:57:04.080Z INFO (reader.geth) syncing beacon headers                   downloaded=251,392 left=12,690,092 eta=3h35m13.172s
Sep  7 00:57:33 ropsten-sfdm37 sf[1953540]: 2022-09-07T00:57:33.079Z WARN (reader.geth) beacon client online, but no consensus updates received in a while. Please fix your beacon client to follow the chain!

@sduchesneau
Copy link
Author

sduchesneau commented Sep 7, 2022

THIS MAY NOT WORK
we are still investigating..

Proposed Workaround when syncing a chain with firehose:

  1. stopping the merger...
  2. deleting all the one-block-files that are stuck with the old LIBNUM in their name
  3. restarting a reader (geth instance) from previous backup with --no-discover until the lighthouse/beacon are synced
  4. restarting them without the --no-discover so they sync and produce blocks again
  5. restart the merger

@sduchesneau
Copy link
Author

example one-block-files produced from a snapshot of geth ropsten:

    16274 2022-09-07 17:23:53 0012660714-77570d9dc40c727f-7ec09df70f47ee5c-12660714-id.dbin.zst
    28921 2022-09-07 17:23:53 0012660715-49cc5918ab51c71d-77570d9dc40c727f-12660715-id.dbin.zst
    18763 2022-09-07 17:23:53 0012660716-0d8edd90b5f54956-49cc5918ab51c71d-12660716-id.dbin.zst
    18865 2022-09-07 17:23:53 0012660717-802db026cba41e25-0d8edd90b5f54956-12660716-id.dbin.zst

the libnum stays 12660716 "forever" passed that block (which happens to be the last Finalized block according to that geth instance when it started)

@sduchesneau
Copy link
Author

should be fixed with last PR, relased as geth-v1.10.23-fh2.2

maoueh pushed a commit that referenced this issue Apr 10, 2023
* add ip ratelimit

* update

* update

* update explorer adddress

* updae recapcha

* remove binance

* cmd/faucet: fix conn to wrapped wsconn

* cmd/faucet: keystore updated to save and load one same addres once

* clean: remove btcd v0.20.1-beta and avoid to ambiguous import (#1)

* ci: fix truffle test (ethereum#1384)

---------

Co-authored-by: fudongbai <296179868@qq.com>
Co-authored-by: Nathan <galaxystroller@gmail.com>
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>
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