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

Eventstream API light client events spec compatibility #6197

Closed
nflaig opened this issue Dec 15, 2023 · 1 comment · Fixed by #6309
Closed

Eventstream API light client events spec compatibility #6197

nflaig opened this issue Dec 15, 2023 · 1 comment · Fixed by #6309
Labels
meta-bug Issues that identify a bug and require a fix. scope-interop Issues that fix interop issues between Lodestar and CL, EL or tooling. scope-light-clients All issues regarding light client development.

Comments

@nflaig
Copy link
Member

nflaig commented Dec 15, 2023

Describe the bug

Currently Lodestar does not return light client events as defined in spec examples beacon-APIs/#/Events/eventstream.

The spec example has an additional version field and wrapps the actual light client updates into data layer (similar to REST API)

            light_client_finality_update:
              description: The node's latest known `LightClientFinalityUpdate` has been updated
              value: |
                event: light_client_finality_update
                data: {"version":"phase0", "data": {"attested_header": {"beacon": { ... }}

This incompatibility causes issues as Lodestar and Nimbus beacon node return different data formats.

This was brought up by @rdvorkin at the Light Client Summit at Devconnect in Building a trustless light-client assistant in your browser around 11:30

image

Other issues that @jeluard brought up about the light client event examples

  • version is phase0 whereas light client was introduced in altair (fails our spec tests)
  • sync_committee_bits too short

We should clarify if the current format as outlined in the spec should be the standard or we want to omit version and data layer. Other events do not use a data layer in the serialized json which makes the light client events a bit of an outlier.

Additional context

We currently just calculate the fork version based on slot in attested header

compute_fork_version(compute_epoch_at_slot(data.attested_header.beacon.slot))

getLightClientTypeFromHeader((data as unknown as allForks.LightClientOptimisticUpdate).attestedHeader)[

Related

Testing Lodestar events API against the spec examples causes issues as well and we have to ignore those topics during testing

Beacon-API spec PR (there was no discussion around events format)

@nflaig nflaig added meta-investigate Issues found that require further investigation and may not have a specific resolution/fix meta-bug Issues that identify a bug and require a fix. scope-interop Issues that fix interop issues between Lodestar and CL, EL or tooling. and removed meta-investigate Issues found that require further investigation and may not have a specific resolution/fix labels Dec 15, 2023
@philknows philknows added the scope-light-clients All issues regarding light client development. label Dec 19, 2023
@philknows
Copy link
Member

We should aim to follow the spec here unless there's a reason for why we don't, so we can follow up with a potential spec change with some additional context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta-bug Issues that identify a bug and require a fix. scope-interop Issues that fix interop issues between Lodestar and CL, EL or tooling. scope-light-clients All issues regarding light client development.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants