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

Faster block detection using WebSocket notifications #142

Merged
merged 2 commits into from
Jun 14, 2024
Merged

Conversation

peterbroadhurst
Copy link
Contributor

Add an option to use a WebSocket JSON/RPC connection only for the block listener, and as well as using eth_newBlockFilter with polling, to do an eth_subscribe to get shoulder taps as soon as new heads are available.

This reduces latency of detection of mining of transactions.

@peterbroadhurst peterbroadhurst requested a review from a team as a code owner June 12, 2024 01:09
"github.com/hyperledger/firefly-transaction-manager/pkg/ffcapi"
)

// blockInfoJSONRPC are the info fields we parse from the JSON/RPC response, and cache
type blockInfoJSONRPC struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved all this code to the blockListener as it needs to use the same pipe to the same node as the notifications when WebSockets are used.

Copy link
Contributor

@Chengxuan Chengxuan left a comment

Choose a reason for hiding this comment

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

LGTM

@peterbroadhurst peterbroadhurst merged commit 3f1f078 into main Jun 14, 2024
3 checks passed
@peterbroadhurst peterbroadhurst deleted the ws-blocks branch June 14, 2024 12:33
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.

2 participants