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

modify (simplify) state_history plugin's thread logic; add get_status_request_v1 #96

Closed
wants to merge 15 commits into from

Conversation

spoonincode
Copy link
Member

@spoonincode spoonincode commented Apr 30, 2024

User Facing Changes

Add get_status_request_v1 and get_status_result_v1 for completeness and consistency. It's a minor thing, this just provides access to the range of blocks with finality data available.

Some state_history log messages have been removed, most notably the log that occurs on every block. That seemed rather unnecessary (and was not present in 2.0/3.1) but this change can certainly be revisited.

Internal Changes

The entirety of the connection code has been reworked to simplify the threading logic. This new design makes all decisions about what blocks to send on the main thread, and then conveys that information (while holding appropriate handles) to the ship thread which does the log reading, decompression, and websocket operations. This rework is expected to fix #275 because the prior implementation would sometimes not send forks properly due to thread timing.

Blocking Issues

Unfortunately with the way the log implementation relies on mutexes the new approach is currently subject to deadlocks. Log implementation will need to be refactored to be free of mutexes next.

@ericpassmore
Copy link
Contributor

Note:start
group: STABILITY
category: INTERNALS
summary: Significant improvement of thread logic for state history plugin.
Note:end

arhag
arhag previously requested changes Jun 3, 2024
Copy link
Member

@arhag arhag left a comment

Choose a reason for hiding this comment

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

Please ship_streamer_if_test and ship_streamer_test and make sure they pass. Hopefully this resolves #20.

Also, besides that change, is this PR ready for review? Or is there more work still required?

@arhag arhag dismissed their stale review June 4, 2024 17:31

Will be addressed in another PR (refactoring log code) that must be merged as a pair with this one.

@spoonincode spoonincode marked this pull request as ready for review June 4, 2024 17:57
@spoonincode
Copy link
Member Author

really sorry for the force push at the end; pushed the log changes here that I wanted to keep as a separate PR

@spoonincode
Copy link
Member Author

actually, since review hasn't started, I'm just going to reopen a PR without the force pushes... sorry about that...

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.

Test Failure: ship_streamer_if_test
3 participants