Commit Graph

19 Commits

Author SHA1 Message Date
zhiqiangxu
87465e98f9
beacon/light: remove unused CommitteeChain.signerThreshold (#30484)
This field is a duplicate of UpdateScore.SignerCount and never referenced.
2024-10-30 15:22:10 +01:00
zhiqiangxu
84a80216c6
beacon/light: optimize lock usage in HeadTracker (#30485)
minimizes the time when the lock is held
2024-10-02 16:00:36 +02:00
Felföldi Zsolt
a01e9742d9
beacon/light/api: fixed blsync update query (#30421)
This PR fixes what https://github.com/ethereum/go-ethereum/pull/30306/
broke. Escaping the `?` in the event sub query was fixed in that PR but
it was still escaped in the `updates` request. This PR adds a URL params
argument to `httpGet` and fixes `updates` query formatting.
2024-09-12 16:08:29 +02:00
Gealber Morales
eaf4285f0a
beacon/light/sync: basic tests for rangeLock (#30269)
adds simple tests for lock and firstUnlocked method from rangeLock
type

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2024-08-23 12:31:24 +02:00
Sina M
43640f12d8
beacon/light: handle endpoint URL more gracefully (#30306)
blsync was failing if the light endpoint it was provided ended with a
`/`. This change should handle the joining more gracefully.
2024-08-16 14:39:57 +02:00
Felföldi Zsolt
86150af2e5
beacon/light: fix shutdown issues (#29946)
* beacon/light/request: add server test for event after unsubscribe

* beacon/light/api: fixed double stream.Close()

* beacon/light/request: add checks for nil event callback function

* beacon/light/request: unlock server mutex while unsubscribing from parent
2024-06-12 16:38:19 +02:00
Felix Lange
1e97148249
all: fix inconsistent receiver name and add lint rule for it (#29974)
* .golangci.yml: enable check for consistent receiver name

* beacon/light/sync: fix receiver name

* core/txpool/blobpool: fix receiver name

* core/types: fix receiver name

* internal/ethapi: use consistent receiver name 'api' for handler object

* signer/core/apitypes: fix receiver name

* signer/core: use consistent receiver name 'api' for handler object

* log: fix receiver name
2024-06-12 10:45:42 +03:00
Hteev Oli
47af69c2bc
core, beacon, ethdb: fix typos (#29748)
* core, beacon, ethdb: fix typos

* revert file that can't be changed
2024-05-10 19:48:14 +02:00
Felföldi Zsolt
256d4b099c
beacon/light: request finality update explicitly when necessary (#29567)
This PR adds an extra mechanism to sync.HeadSync that tries to retrieve the latest finality update from every server each time it sends an optimistic update in a new epoch (unless we already have a validated finality update attested in the same epoch). 

Note that this is not necessary and does not happen if the new finality update is delivered before the optimistic update. The spec only mandates light_client_finality_update events when a new epoch is finalized. If the chain does not finalize for a while then we might need an explicit request that returns a finality proof that proves the same finality epoch from the latest attested epoch.
2024-04-23 13:31:32 +02:00
Felföldi Zsolt
e6689fe090
beacon/light/sync: print error log if checkpoint retrieval fails (#29532)
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-04-22 13:19:42 +02:00
persmor
0a51028819
all: fix various typos (#29542)
* core/rawdb: fix typos

* accounts/abi: fix typos

* metrics: fix typo

* beacon: fix typo

* crypto: fix typo

* rpc: fix typo

* rpc: fix typo
2024-04-16 15:44:00 +03:00
Aaron Chen
723b1e36ad
all: fix mismatched names in comments (#29348)
* all: fix mismatched names in comments

* metrics: fix mismatched name in UpdateIfGt
2024-03-26 21:01:28 +01:00
Felix Lange
eda9cb7b36
beacon/light/api: improve handling of event stream setup failures (#29308)
The StartHeadListener method will only be called once. So it can't just make one attempt
to connect to the eventsource endpoint, it has to keep trying. Note that once the stream
is established, the eventsource implementation itself will keep retrying.
2024-03-25 20:27:50 +01:00
George Ma
38eb8b3e20
all: fix docstrings (#29311) 2024-03-22 20:29:12 +08:00
Felix Lange
bca6c40709
beacon/blsync: support for deneb fork (#29180)
This adds support for the Deneb beacon chain fork, and fork handling
in general, to the beacon chain light client implementation.

Co-authored-by: Zsolt Felfoldi <zsfelfoldi@gmail.com>
2024-03-20 19:22:44 +01:00
bitcoin-lightning
6b3d4d068a
beacon/light/sync: fix typo in comment (#29256) 2024-03-19 14:05:06 +01:00
guangwu
ebf9e11af2
beacon/light/request: fix typos (#29216) 2024-03-11 11:17:16 +01:00
Felföldi Zsolt
aadcb88675
cmd/blsync, beacon/light: beacon chain light client (#28822)
Here we add a beacon chain light client for use by geth.

Geth can now be configured to run against a beacon chain API endpoint,
without pointing a CL to it. To set this up, use the `--beacon.api` flag. Information
provided by the beacon chain is verified, i.e. geth does not blindly trust the beacon
API endpoint in this mode. The root of trust are the beacon chain 'sync committees'.

The configured beacon API endpoint must provide light client data. At this time, only
Lodestar and Nimbus provide the necessary APIs.

There is also a standalone tool, cmd/blsync, which uses the beacon chain light client
to drive any EL implementation via its engine API.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-03-06 17:50:22 +01:00
Felföldi Zsolt
fff843cfaf
beacon/light: add CommitteeChain (#27766)
This change implements CommitteeChain which is a key component of the beacon light client. It is a passive data structure that can validate, hold and update a chain of beacon light sync committees and updates, starting from a checkpoint that proves the starting committee through a beacon block hash, header and corresponding state. Once synced to the current sync period, CommitteeChain can also validate signed beacon headers.
2023-12-08 13:38:00 +01:00