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

Trigger Geth Sync Immediately #27

Merged
merged 2 commits into from
Feb 19, 2025
Merged

Conversation

astarinmymind
Copy link
Collaborator

@astarinmymind astarinmymind commented Feb 19, 2025

When lighthouse is started without geth, and the searcher's geth node comes online, lighthouse won't trigger sync until 40 minutes after geth is started.

The reason why is discussed at length here:
ethereum/go-ethereum#27482 (comment)

TLDR:

  • lighthouse will not even attempt sync if EL is not online

  • once EL is online, lighthouse will do "finalized sync" where it tries to catch up to the finalized checkpoint. during this time, it will not send EL newPayload

  • adding the flag makes lighthouse send newPayload during finalized sync, so it triggers geth's sync faster

This flag is officially documented here:
https://github.com/sigp/lighthouse/blob/bf955c7543dac8911a6f6c334b5b3ca4ef728d9c/book/src/help_bn.md?plain=1#L464

Testing:

  • on flashbots debug tdx machine, lighthouse logs looking good and geth begins to sync immediately

Lighthouse:

Feb 19 16:21:41.001 INFO Synced                                  slot: 11096506, block: 0xd237…d349, epoch: 346765, finalized_epoch: 346763, finalized_root: 0x700b…b789, exec_hash: 0x7734…2afc (unverified), peers: 100, service: slot_notifier
Feb 19 16:21:48.486 INFO New block received                      root: 0x07b1fa66390e532ff741c7deff166066a84c804a5dad2e53d95ee98b85745f62, slot: 11096507
Feb 19 16:21:53.000 WARN Head is optimistic                      execution_block_hash: 0xd0e300110730ac5098000cd4c211337fe1d88a04e06c6e92991d98187f03866f, info: chain not fully verified, block and attestation production disabled until execution engine syncs, service: slot_notifier
Feb 19 16:21:53.000 INFO Synced                                  slot: 11096507, block: 0x07b1…5f62, epoch: 346765, finalized_epoch: 346763, finalized_root: 0x700b…b789, exec_hash: 0xd0e3…866f (unverified), peers: 104, service: slot_notifier
Feb 19 16:22:01.077 INFO New block received                      root: 0xbb89cba80beab358b0aa09f0b71c8204f161bcbbaa45c1c5306210b259952605, slot: 11096508

Geth:

DEBUG[02-19|16:22:32.417] Fetching batch of receipts               id=6b36f791352f15eb conn=dyndial count=256
DEBUG[02-19|16:22:32.419] Fetching batch of receipts               id=3efeddda293532e3 conn=dyndial count=256
DEBUG[02-19|16:22:32.421] Fetching batch of receipts               id=a3193b31fe78c9a5 conn=dyndial count=179
DEBUG[02-19|16:22:32.423] Fetching batch of block bodies           id=ad19430bd157b1a2 conn=inbound count=128
DEBUG[02-19|16:22:32.424] Fetching batch of block bodies           id=1c4f63ab1c202681 conn=inbound count=128
DEBUG[02-19|16:22:32.425] Fetching batch of block bodies           id=6b36f791352f15eb conn=dyndial count=128

Added --disable-quic to not listen on 9001.

Flag documented here: https://github.com/sigp/lighthouse/blob/bf955c7543dac8911a6f6c334b5b3ca4ef728d9c/book/src/help_bn.md?plain=1#L475

Testing:

root@tdx:~# netstat -tunl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       
tcp        0      0 0.0.0.0:30303           0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:8090          0.0.0.0:*               LISTEN      
tcp        0      0 127.0.0.1:5001          0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:10022           0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:8551            0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:8745            0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:27017           0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      
netstat: /proc/net/tcp6: No such file or directory
netstat: /proc/net/udp6: No such file or directory

@astarinmymind astarinmymind requested a review from Ruteri February 19, 2025 14:49
@astarinmymind astarinmymind merged commit 866e9ff into time-drift-fix Feb 19, 2025
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.

1 participant