Open lklimek opened 1 week ago
The changes in this pull request focus on enhancing the executor.rs
, broadcast.rs
, and various related files within the DAPI client and SDK. Key modifications include the introduction of new conversion methods for the ExecutionResult
type, a new trait for wrapping results, and improved error handling and response management across multiple components. Additionally, several methods within the PutContract
, PutDocument
, and Transfer
traits have been streamlined to simplify broadcasting and response handling, while documentation updates clarify the functionality of specific fields and methods.
File Path | Change Summary |
---|---|
packages/rs-dapi-client/src/executor.rs | - Added From trait implementations for ExecutionResponse<R> and ExecutionError<E> to ExecutionResult<R, E> . - Introduced Wrap<R, RE, W> trait with wrap method for converting Result<T, TE> into ExecutionResult<R, RE> . |
packages/rs-dapi-client/src/lib.rs | - Exported Wrap in the executor module. - Marked is_node_failure method in CanRetry trait as deprecated. |
packages/rs-sdk/src/platform/transition/broadcast.rs | - Refactored broadcast method in BroadcastStateTransition trait to include settings parameter. - Added wait_for_response method to encapsulate waiting logic with retry and timeout handling. - Updated broadcast_and_wait method to call broadcast and wait_for_response . |
packages/rs-dapi-client/src/request_settings.rs | - Updated documentation for timeout field in RequestSettings struct for clarity. |
packages/rs-dpp/Cargo.toml | - Updated dashcore dependency to include "eddsa" feature and modified derive_more to include "try_into" feature. |
packages/rs-dpp/src/state_transition/proof_result.rs | - Added strum::Display and derive_more::TryInto traits to StateTransitionProofResult enum. |
packages/rs-sdk/src/core/transaction.rs | - Enhanced error handling in start_instant_send_lock_stream method. |
packages/rs-sdk/src/error.rs | - Introduced new error variant AlreadyExists in Error enum for better error reporting. |
packages/rs-sdk/src/platform/transition.rs | - Removed context module from public exports. |
packages/rs-sdk/src/platform/transition/context.rs | - Deleted context.rs file containing TransitionContext enum. |
packages/rs-sdk/src/platform/transition/purchase_document.rs | - Simplified broadcasting and response handling in PurchaseDocument trait. |
packages/rs-sdk/src/platform/transition/put_contract.rs | - Streamlined broadcasting and response handling in PutContract trait. |
packages/rs-sdk/src/platform/transition/put_document.rs | - Simplified broadcasting and response handling in PutDocument trait. |
packages/rs-sdk/src/platform/transition/put_settings.rs | - Added wait_timeout field to PutSettings struct and implemented From trait for conversion to RequestSettings . |
packages/rs-sdk/src/platform/transition/transfer.rs | - Updated transfer_credits method to utilize settings in broadcasting. |
packages/rs-sdk/src/platform/transition/withdraw_from_identity.rs | - Updated withdraw method to utilize settings in broadcasting. |
packages/rs-dapi-client/src/transport/grpc.rs | - Introduced impl_transport_request_grpc! macro for generating implementations of the TransportRequest trait. |
packages/rs-sdk/tests/fetch/contested_resource.rs | - Updated error messages in test cases for consistency and commented out a test case due to an existing bug. |
packages/rs-sdk/tests/fetch/contested_resource_vote_state.rs | - Updated error messages in test cases to reflect new error handling format. |
packages/rs-dapi-client/src/dapi_client.rs | - Enhanced error handling logging in the execute method of DapiRequestExecutor . |
ExecutionResult
type and its interaction with ExecutionResponse
and ExecutionError
, which relates to the error handling and response management improvements in the DapiClient
and BroadcastStateTransition
implementations in this PR.dapi-endpoint
, cleanup
🐰 "In the fields where we hop and play,
New changes come to brighten the day.
With results wrapped snug and tight,
Error handling’s now a delight!
So let’s cheer for the code we write,
For every bug that takes flight!" 🐇
[!WARNING]
Rate limit exceeded
@lklimek has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 47 seconds before requesting another review.
⌛ How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.🚦 How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://docs.coderabbit.ai/faq) for further information.📥 Commits
Reviewing files that changed from the base of the PR and between 79ed045790f242af4cafc5e4de4eb1df5ef7856c and ff5406128dc24bf489d74da5cdb02c3cb8891e9b.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@coderabbitai review
@coderabbitai review all
@lklimek: Understood, I will review all the changes again.
Issue being fixed or feature implemented
Modification operations, like create identity etc., don't support retries even if DAPI returns retryable error.
What was done?
How Has This Been Tested?
Breaking Changes
Option<PutSettings>
Option<PutSettings>
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
Release Notes
New Features
PutSettings
for better handling of state transition response waits.BroadcastStateTransition
with configurable retry settings and new methods for handling responses.transfer_credits
andwithdraw
methods to clarify their behavior.StateTransitionProofResult
with additional capabilities for formatted output and conversion.DapiClient
to improve logging around banned addresses.Bug Fixes
AlreadyExists
for more informative error reporting.Documentation
CanRetry
trait, encouraging best practices in error handling.timeout
field inRequestSettings
.