-
Notifications
You must be signed in to change notification settings - Fork 1
New Handlers wiith new tproxy #40
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
base: new-tproxy
Are you sure you want to change the base?
Conversation
7bc040b
to
401e5b3
Compare
msg.error_code, msg.flags | ||
); | ||
|
||
Ok(()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we return an error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking more on lines liek the user can now report this directly to status handler, respawn the service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's also kind of what I was thinking about.. would this be done directly here in the handler, right?
Or are we missing anything needed by the status handler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be done.
roles/translator/src/lib/sv2/channel_manager/message_handler.rs
Outdated
Show resolved
Hide resolved
Previously, `HandlerError` only supported a fixed set of internal error types. This made it difficult for downstream users implementing library traits to propagate their own custom error types. This commit introduces a new `External(Box<dyn Error + Send + Sync>)` variant to allow wrapping arbitrary error values. This enables implementors to return non-library errors without requiring changes to the core `HandlerError` enum.
- Added downstream_id to Downstream struct for better identification. - Updated message handling in Downstream to include response handling. - Enhanced ChannelManager with methods for processing upstream messages and creating channels. - Refactored SV1Server to manage downstream connections and messages more effectively. - Improved logging for better traceability of downstream operations.
…ome of the unused methods
… values in the handlers
- Renamed and reorganized modules for clarity, including the introduction of `sv1` and `sv2` directories. - Added new `Downstream` and `ChannelManager` implementations to enhance message handling and processing. - Introduced new message handler logic for upstream and downstream communication. - Implemented share validation and extended mining channel management. - Improved logging throughout the modules for better traceability and debugging.
- Updated Downstream struct to use a tuple for channel_id and message in the sender/receiver. - Improved spawn methods to utilize Arc<Mutex<Self>> for better concurrency handling. - Refactored SV1Server to accommodate changes in Downstream, ensuring proper message broadcasting and handling. - Enhanced logging for downstream operations to improve traceability.
- Added configuration parameter to SV1Server and TranslatorSv2 for improved flexibility. - Updated hashrate calculation to utilize configuration settings for downstream difficulty. - Introduced initial target calculation based on configured hashrate and shares per minute. - Improved message handling in SV1Server to accommodate new configuration features.
…ove target handling - Added min_extranonce_size configuration to SV1Server for enhanced flexibility. - Updated OpenExtendedMiningChannel message to utilize the configured min_extranonce_size. - Improved target handling by ensuring initial_target is cloned when setting difficulty.
e6e5898
to
328bc6a
Compare
e77d1ef
to
f0a69aa
Compare
This PR migrates the new TProxy to the updated handlers. We're no longer using the SendTo and awkward Arc ergonomics, and things feel much cleaner now. Have a look!