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

Add block_gossip SSE event #7941

Merged

Conversation

StefanBratanov
Copy link
Contributor

@StefanBratanov StefanBratanov commented Jan 31, 2024

PR Description

  • Add new block_gossip event when block is validated.
  • Rename ImportedBlockListener to ReceivedBlockListener and add onValidated method
  • Remove redundant CLI options: --beacon-events-block-notify-when-validated-enabled and --beacon-events-block-notify-when-imported-enabled since now we have two SSE events

TODO:
I still find BlockImportNotifications and ReceivedBlockListener bit redundant.

Fixed Issue(s)

fixes #7513

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Comment on lines -126 to -147
@Option(
names = {"--beacon-events-block-notify-when-validated-enabled"},
paramLabel = "<BOOLEAN>",
showDefaultValue = Visibility.ALWAYS,
description =
"Block notification events will be sent once the block has been validated, prior to attempting to import the block. The optimistic flag will be determined based on if chain head is optimistic.",
arity = "0..1",
fallbackValue = "true")
private Boolean beaconEventsBlockNotifyWhenValidated =
BeaconRestApiConfig.DEFAULT_BEACON_EVENTS_BLOCK_NOTIFY_WHEN_VALIDATED_ENABLED;

@Option(
names = {"--beacon-events-block-notify-when-imported-enabled"},
paramLabel = "<BOOLEAN>",
showDefaultValue = Visibility.ALWAYS,
description =
"Block notification events will be sent once the block has been imported, at which point we can accurately set the optimistic flag.",
arity = "0..1",
fallbackValue = "true")
private Boolean beaconEventsBlockNotifyWhenImported =
BeaconRestApiConfig.DEFAULT_BEACON_EVENTS_BLOCK_NOTIFY_WHEN_IMPORTED_ENABLED;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

breaking change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, forgot the changelog. Added now.

Copy link
Contributor

@tbenr tbenr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@StefanBratanov StefanBratanov enabled auto-merge (squash) February 2, 2024 11:43
@StefanBratanov StefanBratanov merged commit e7c7ff5 into Consensys:master Feb 2, 2024
13 of 15 checks passed
@StefanBratanov StefanBratanov deleted the block_gossip_sse_event branch February 2, 2024 12:03
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.

[API] events for deneb
3 participants