Skip to content

Conversation

@zilm13
Copy link
Contributor

@zilm13 zilm13 commented Aug 9, 2022

I don't understand this test. I have changed it to be valid how I understand it, but maybe I'm not right, let's discuss

  • both ELs are mining. I don't understand why second EL is mining, is it for SYNCING response only?
  • first fCU call is on terminal block, before optimistic sync breaks in, currently forloop breaks on it with callback, it's too early, optimistic sync is not yet started

I've updated test to do all actions when optimistic sync is definitely started (and it's passing for me with these changes)

@marioevz
Copy link
Member

marioevz commented Aug 9, 2022

Hi @zilm13, thanks for the changes, let me clarify:

  • Yes, if both EL clients have each a different block with the same difficulty, neither of the two will re-org to the other, unless a fcU is received and points to the other. So the clients will remain on SYNCING or ACCEPTED when the newPayload is received.
  • Maybe this is a more recent change on lighthouse, but when I coded this test originally, the importer called newPayload first and upon receiving SYNCING it skipped sending the fcU.

I thought the CL would only send the fcU on the terminal block if it was meant to build a payload, and this was the behavior up until a few weeks ago. It doesn't seem obvious to me why would the CL send fcU to a proof-of-work block if this CL is not the one building the transition payload.

Also @pawanjay176 mentioned to me that all optimistic sync tests were failing due to clients banning each other, and suggested a fix of making all peers trusted peers with each other. I'm not sure if this is the same issue, but I could implement it in the following days and see if it fixes this specific test also.

@mkalinin
Copy link

May we use EL mock to artificially return SYNCING when needed? I guess Teku is always making an fcU call with terminal block as the head once the block is observed

@zilm13
Copy link
Contributor Author

zilm13 commented Aug 10, 2022

It's a legit call by the spec, we shouldn't expect that it's a sign of optimistic sync breaks in

Note: Client software MUST NOT call this function until the transition conditions are met on the PoW network, i.e. there exists a block for which is_valid_terminal_pow_block function returns True.
Note: Client software MUST call this function to initiate the payload build process to produce the merge transition block; the head_block_hash parameter MUST be set to the hash of a terminal PoW block in this case.

So once consensus client observed terminal it could send fCU with it. And it just got this terminal from the EL, and EL answers with INVALID though it provided it itself a second before

@marioevz
Copy link
Member

From that fragment I understand that the fcU should only be sent when the validator is proposing the transition block, but I understand that it is not directly prohibited in any other circumstance.

I'm currently revisiting the test and will try out the idea to force the SYNCING response by using the EL mock.

@zilm13
Copy link
Contributor Author

zilm13 commented Aug 10, 2022

It's not the MUST, but it's not prohibited, right

@marioevz
Copy link
Member

I'm almost done with the changes, but the verification approach is giving me some trouble.

The test now returns SYNCING to every newPayload/forkchoiceUpdated until after we start getting execution_optimistic==true blocks on the chain, then it starts to return INVALID, lvh=0x00...000 for every payload.

The expectation is that, when we check the head of the importer's beacon chain, the head must be the block where the first execution payload was included minus one (the last beacon block without an execution payload).

However this is what I'm getting:

  • First execution beacon block: Slot 64
  • Builder's Head: Slot 84
  • Importer's Head: Slot 72

I'm not really sure what to make out of these values, the importer node does wait SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY before importing these blocks, but the outcome seems weird.

More info to consider:

  • Bellatrix happens on slot 64
  • Importer's Head returns execution_optimistic==true
  • Test waits 1 slot before querying the head of the importer, but the result is exactly the same if we wait 10 slots

cc @zilm13 @mkalinin

@marioevz
Copy link
Member

Branch https://github.com/marioevz/hive/tree/fix-opt-sync-test has this test updated now:

hive --client go-ethereum,lighthouse-bn,lighthouse-vc --sim eth2/engine --sim.limit "/syncing-with-chain-having-invalid-transition-block"

@mkalinin
Copy link

Do we have any logs from what is happening on CL side? The result is weird, indeed.

@zilm13
Copy link
Contributor Author

zilm13 commented Aug 12, 2022

What I see with Teku:
[SYNCING] answer till Epoch 6
next you are sending [INVALID], Teku crashes, because Epoch 4 is optimistically finalized
Looks like test is not working like it should, but Teku is ok :)
Btw why don't you want to override Teku's SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY_CLIENT_OVERRIDE?

@marioevz
Copy link
Member

Teku seems to now be passing the test (yay! 🥳), this behavior is only seen in Lighthouse, so I am now more inclined to think this is a client specific behavior rather than a test verification issue.

Hi @paulhauner, the behavior described above is still happening for Lighthouse, and it is only happening when the whole post-transition beacon chain is invalidated (INVALID + lvh==0x00...000).

We are currently spoofing newPayloadV1 and forkchoiceUpdatedV1, first with SYNCING until optimistic sync, then with INVALID, and I was wondering if Lighthouse forkchoice relies on any other call either to the engine_ or the eth_ namespaces that we need to intercept and switch. Thanks!

@marioevz
Copy link
Member

What I see with Teku: [SYNCING] answer till Epoch 6 next you are sending [INVALID], Teku crashes, because Epoch 4 is optimistically finalized Looks like test is not working like it should, but Teku is ok :) Btw why don't you want to override Teku's SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY_CLIENT_OVERRIDE?

I reduced SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY_CLIENT_OVERRIDE in all clients to 8, and all optimistic sync tests are passing without issues for teku it seems.

@zilm13
Copy link
Contributor Author

zilm13 commented Aug 12, 2022

Yeah, it works for me correctly with "8" override too

@fjl
Copy link
Collaborator

fjl commented Jan 23, 2023

Closing because this test was fixed in another way.

racytech pushed a commit to racytech/hive that referenced this pull request Apr 4, 2025
racytech pushed a commit to racytech/hive that referenced this pull request Apr 4, 2025
🤖 I have created a release *beep* *boop*
---


##
[3.1.0](ethpandaops/ethereum-package@3.0.0...3.1.0)
(2024-06-07)


### Features

* add http url to el context
([ethereum#656](ethpandaops/ethereum-package#656))
([4e69a4c](ethpandaops/ethereum-package@4e69a4c))
* add prefunded accounts to output
([ethereum#657](ethpandaops/ethereum-package#657))
([bc06e2a](ethpandaops/ethereum-package@bc06e2a))
* add tracoor
([ethereum#651](ethpandaops/ethereum-package#651))
([b100cb6](ethpandaops/ethereum-package@b100cb6))
* add vc_count to increase the number of validators per participant
([ethereum#633](ethpandaops/ethereum-package#633))
([4272ff3](ethpandaops/ethereum-package@4272ff3))
* allow setting custom dora image & env variables
([ethereum#623](ethpandaops/ethereum-package#623))
([08a65c3](ethpandaops/ethereum-package@08a65c3))
* **apache:** Serve all config files
([ethereum#606](ethpandaops/ethereum-package#606))
([3f1f5e1](ethpandaops/ethereum-package@3f1f5e1))
* **config:** add peerdas vars
([ethereum#619](ethpandaops/ethereum-package#619))
([22f1498](ethpandaops/ethereum-package@22f1498))
* expose network-params
([ethereum#659](ethpandaops/ethereum-package#659))
([b0820dd](ethpandaops/ethereum-package@b0820dd))
* forky
([ethereum#625](ethpandaops/ethereum-package#625))
([ded68bd](ethpandaops/ethereum-package@ded68bd))
* Support participants_matrix
([ethereum#620](ethpandaops/ethereum-package#620))
([3a57467](ethpandaops/ethereum-package@3a57467))
* use `peer-das` image for dora when eip7594 is active
([ethereum#593](ethpandaops/ethereum-package#593))
([1b4bd3d](ethpandaops/ethereum-package@1b4bd3d))


### Bug Fixes

* add additional prefund addresses
([ethereum#655](ethpandaops/ethereum-package#655))
([6d2cdb6](ethpandaops/ethereum-package@6d2cdb6))
* add cl log level to builders
([ethereum#638](ethpandaops/ethereum-package#638))
([ad46dbd](ethpandaops/ethereum-package@ad46dbd))
* Add EIP-7002 & EIP-2935 bytecode to ethereum-genesis-generator
([ethereum#597](ethpandaops/ethereum-package#597))
([3d316ef](ethpandaops/ethereum-package@3d316ef))
* add http to teku endpoint
([ethereum#622](ethpandaops/ethereum-package#622))
([085b6e1](ethpandaops/ethereum-package@085b6e1))
* add peer_das_epoch to egg
([ethereum#603](ethpandaops/ethereum-package#603))
([91694df](ethpandaops/ethereum-package@91694df))
* add sha256 as an image label (if present)
([ethereum#637](ethpandaops/ethereum-package#637))
([3dcf888](ethpandaops/ethereum-package@3dcf888))
* add static port config for apache
([ethereum#608](ethpandaops/ethereum-package#608))
([b96e502](ethpandaops/ethereum-package@b96e502))
* **apache:** only set static port if wanted
([ethereum#610](ethpandaops/ethereum-package#610))
([2c6b7b1](ethpandaops/ethereum-package@2c6b7b1))
* blockscout fix for json variant
([ethereum#662](ethpandaops/ethereum-package#662))
([e79c510](ethpandaops/ethereum-package@e79c510))
* churn adjustments
([ethereum#614](ethpandaops/ethereum-package#614))
([12ca872](ethpandaops/ethereum-package@12ca872))
* default config
([ethereum#632](ethpandaops/ethereum-package#632))
([14be117](ethpandaops/ethereum-package@14be117))
* drop everythign after [@sha](https://github.com/sha) from image labels
([ethereum#636](ethpandaops/ethereum-package#636))
([5d35463](ethpandaops/ethereum-package@5d35463))
* erigon v3 - new default image
([ethereum#629](ethpandaops/ethereum-package#629))
([72cf150](ethpandaops/ethereum-package@72cf150))
* genesis generator bump
([ethereum#611](ethpandaops/ethereum-package#611))
([5460f6f](ethpandaops/ethereum-package@5460f6f))
* nightly tests
([ethereum#595](ethpandaops/ethereum-package#595))
([76c31e9](ethpandaops/ethereum-package@76c31e9))
* pectra example
([ethereum#605](ethpandaops/ethereum-package#605))
([67e3da0](ethpandaops/ethereum-package@67e3da0))
* prysm vc key manager ports
([ethereum#639](ethpandaops/ethereum-package#639))
([81c1ee7](ethpandaops/ethereum-package@81c1ee7))
* re-add images to labels
([ethereum#634](ethpandaops/ethereum-package#634))
([71f6e28](ethpandaops/ethereum-package@71f6e28))
* README has invalid configs
([ethereum#631](ethpandaops/ethereum-package#631))
([e33b971](ethpandaops/ethereum-package@e33b971))
* readme indentation
([ethereum#600](ethpandaops/ethereum-package#600))
([583db1b](ethpandaops/ethereum-package@583db1b))
* registration flags when using beacon node only
([ethereum#618](ethpandaops/ethereum-package#618))
([c12506b](ethpandaops/ethereum-package@c12506b))
* repair check workflow for external PRs
([ethereum#616](ethpandaops/ethereum-package#616))
([a584682](ethpandaops/ethereum-package@a584682))
* seperate vc service names
([ethereum#654](ethpandaops/ethereum-package#654))
([a5ffe14](ethpandaops/ethereum-package@a5ffe14))
* tune Besu options to work with tx_spammer
([ethereum#612](ethpandaops/ethereum-package#612))
([b395189](ethpandaops/ethereum-package@b395189))
* update dora images
([ethereum#598](ethpandaops/ethereum-package#598))
([dd28d61](ethpandaops/ethereum-package@dd28d61))
* update prysm image
([ethereum#599](ethpandaops/ethereum-package#599))
([0a38114](ethpandaops/ethereum-package@0a38114))
* use `electra-support` image for assertoor when electra fork epoch is
set
([ethereum#607](ethpandaops/ethereum-package#607))
([cdeab93](ethpandaops/ethereum-package@cdeab93))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

4 participants