Skip to content

fix: replace WebSocket listener mechanism with a slower polling mechanism#773

Merged
jbern0rd merged 3 commits intomainfrom
fix/replace-web-socket-listener
Apr 28, 2026
Merged

fix: replace WebSocket listener mechanism with a slower polling mechanism#773
jbern0rd merged 3 commits intomainfrom
fix/replace-web-socket-listener

Conversation

@jbern0rd
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the WebSocket-based “new heads” listener with an HTTP polling-based listener for tracking the latest blockchain block.

Changes:

  • Remove WebSocketBlockchainListener and introduce BlockchainListener that polls the latest block via HTTP JSON-RPC.
  • Publish LatestBlockEvent and update the iexec.chain.block.latest gauge based on polled latest block data.
  • Update/rename the associated integration test to target the new listener and constant location.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/test/java/com/iexec/core/chain/BlockchainListenerTests.java Updates test naming and static import to reference the new listener/metric constant.
src/main/java/com/iexec/core/chain/WebSocketBlockchainListener.java Removes the previous WebSocket subscription-based implementation.
src/main/java/com/iexec/core/chain/BlockchainListener.java Adds an HTTP polling listener that fetches the latest block on a schedule and emits LatestBlockEvent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/com/iexec/core/chain/BlockchainListener.java
Comment thread src/main/java/com/iexec/core/chain/BlockchainListener.java Outdated
Comment thread src/main/java/com/iexec/core/chain/BlockchainListener.java
Comment thread src/main/java/com/iexec/core/chain/BlockchainListener.java Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/com/iexec/core/chain/BlockchainListener.java
Comment thread src/main/java/com/iexec/core/chain/BlockchainListener.java
@sonarqubecloud
Copy link
Copy Markdown

@jbern0rd jbern0rd merged commit 81867eb into main Apr 28, 2026
5 checks passed
@jbern0rd jbern0rd deleted the fix/replace-web-socket-listener branch April 28, 2026 09:38
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