hyperledger / besu

An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
https://www.hyperledger.org/projects/besu
Apache License 2.0
1.47k stars 798 forks source link

Importing PoS chain merged from clique fails with error #6111

Open fjl opened 10 months ago

fjl commented 10 months ago

It seems there is an issue importing post-merge blocks when the chain being merged from uses clique consensus. I found this issue while trying to create a hive test involving besu.

Steps to Reproduce (Bug)

  1. Download genesis.json and chain.rlp. They are contained in clique-bug.zip

  2. Run besu like this: besu --logging=INFO --data-storage-format=BONSAI --genesis-file=genesis.json --min-gas-price=1 --tx-pool-price-bump=0 --network-id=3503995874084926 --host-allowlist=* --rpc-http-enabled --rpc-http-api=DEBUG,ETH,NET,WEB3,ADMIN --rpc-http-host=0.0.0.0 --rpc-ws-enabled --rpc-ws-api=DEBUG,ETH,NET,WEB3,ADMIN --rpc-ws-host=0.0.0.0 --engine-host-allowlist=* blocks import --run --skip-pow-validation-enabled --from=chain.rlp

Expected behavior: chain.rlp should be imported successfully up to block 2000.

Actual behavior:

2023-11-01 15:00:09.565+00:00 | main | INFO  | BlocksSubCommand | Importing from /chain.rlp
2023-11-01 15:00:10.673+00:00 | pool-10-thread-1 | WARN  | CliqueExtraData | Expected a CliqueExtraData instance but got null. Reparsing required.
java.lang.RuntimeException: Error importing block 64

Versions

besu/v23.10.2-dev-236779d3/linux-x86_64/openjdk-java-17

non-fungible-nelson commented 9 months ago

@jframe any insight into this? I am not sure if any of the clique tweaks made it back into Besu main that may have caused issue here.

non-fungible-nelson commented 9 months ago

Reference #6164

jflo commented 9 months ago

Investigated and unrelated to #6164, parsing error is unrelated to protocol schedule.

jframe commented 9 months ago

@jframe any insight into this? I am not sure if any of the clique tweaks made it back into Besu main that may have caused issue here.

It doesn't look like this is related to the clique non-empty block mining changes I made. I quickly tested this on 23.10.1 before my change and it's failing there too.

Think the cause is that are running the clique block miner when we do block import and it's failing to parse the extra data after we import the pos blocks. So we should just not run the block miner. More complex than it sounds though as clique ignores the miner-enabled flag.

fjl commented 8 months ago

Any news here? Can this be resolved at all?

non-fungible-nelson commented 6 months ago

@jframe bumping this back up. Let's discuss.