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

[r2r] Tx wait for confirmation timeout fix #1446

Merged
merged 32 commits into from
Sep 13, 2022

Conversation

borngraced
Copy link
Member

fixes #1442

Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Good progress! I added some comments about what we discussed in discord :)
You will need to refactor more code other than what I mentioned in the below comments since I only highlighted the most important changes here.

mm2src/common/jsonrpc_client.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/common/jsonrpc_client.rs Outdated Show resolved Hide resolved
mm2src/common/jsonrpc_client.rs Outdated Show resolved Hide resolved
mm2src/mm2_main/src/docker_tests.rs Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Second review iteration. Next time, please revise the whole PR changes before making it ready to review :)

mm2src/coins/lp_coins.rs Outdated Show resolved Hide resolved
mm2src/coins/qrc20/history.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/slp.rs Outdated Show resolved Hide resolved
mm2src/coins/z_coin/z_coin_errors.rs Outdated Show resolved Hide resolved
mm2src/coins/z_coin/z_coin_errors.rs Outdated Show resolved Hide resolved
mm2src/common/jsonrpc_client.rs Show resolved Hide resolved
@borngraced borngraced changed the title [r2r] Tx wait for confirmation timeout fix [WIP] Tx wait for confirmation timeout fix Aug 26, 2022
@borngraced borngraced changed the title [WIP] Tx wait for confirmation timeout fix [r2r] Tx wait for confirmation timeout fix Aug 29, 2022
@borngraced
Copy link
Member Author

@shamardy this is now ready for another round of review. thanks

Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Third review iteration :)

mm2src/common/jsonrpc_client.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
@borngraced borngraced changed the title [r2r] Tx wait for confirmation timeout fix [wip] Tx wait for confirmation timeout fix Aug 30, 2022
@borngraced
Copy link
Member Author

@shamardy this is now ready for another round of review. thanks)

@borngraced borngraced changed the title [wip] Tx wait for confirmation timeout fix [r2r] Tx wait for confirmation timeout fix Aug 30, 2022
@sergeyboyko0791
Copy link

@borngraced could you please check if it's possible to compile NativeClient and everything that works with it to a #[cfg(not(target_arch = "wasm32"))]?
But please stop at the moment if you realize that this refactoring will require a lot of effort.

This could help us to avoid JsonRpcErrorType::Internal error variant.

@shamardy
Copy link
Collaborator

shamardy commented Sep 2, 2022

This could help us to avoid JsonRpcErrorType::Internal error variant.

After some discussion with @sergeyboyko0791, we decided that JsonRpcErrorType::Internal error variant should be kept because of the mapping from SlurpError::Internal.

@borngraced could you please check if it's possible to compile NativeClient and everything that works with it to a #[cfg(not(target_arch = "wasm32"))]?
But please stop at the moment if you realize that this refactoring will require a lot of effort.

Also, this can be done later on a seperate PR, it is not required now.

@borngraced borngraced changed the title [r2r] Tx wait for confirmation timeout fix [wip] Tx wait for confirmation timeout fix Sep 2, 2022
@borngraced
Copy link
Member Author

This could help us to avoid JsonRpcErrorType::Internal error variant.

After some discussion with @sergeyboyko0791, we decided that JsonRpcErrorType::Internal error variant should be kept because of the mapping from SlurpError::Internal.

@borngraced could you please check if it's possible to compile NativeClient and everything that works with it to a #[cfg(not(target_arch = "wasm32"))]?
But please stop at the moment if you realize that this refactoring will require a lot of effort.

Also, this can be done later on a seperate PR, it is not required now.

alright noted. 👍

Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Good progress! Another review round :)

mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/common/jsonrpc_client.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/mm2_net/src/transport.rs Outdated Show resolved Hide resolved
@borngraced borngraced changed the title [wip] Tx wait for confirmation timeout fix [r2r] Tx wait for confirmation timeout fix Sep 5, 2022
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Only 2 comments. Last review iteration from my side if those are resolved without issues :)

mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
@borngraced borngraced changed the title [r2r] Tx wait for confirmation timeout fix [wip] Tx wait for confirmation timeout fix Sep 6, 2022
@borngraced
Copy link
Member Author

@shamardy @sergeyboyko0791 this is ready for another round of review.

@borngraced borngraced changed the title [wip] Tx wait for confirmation timeout fix [r2r] Tx wait for confirmation timeout fix Sep 6, 2022
@borngraced borngraced changed the title [r2r] Tx wait for confirmation timeout fix [wip] Tx wait for confirmation timeout fix Sep 6, 2022
@borngraced borngraced changed the title [wip] Tx wait for confirmation timeout fix [r2r] Tx wait for confirmation timeout fix Sep 6, 2022
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Great Work! Only some minor changes left!

mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/common/executor/wasm_executor.rs Outdated Show resolved Hide resolved
mm2src/common/executor/wasm_executor.rs Outdated Show resolved Hide resolved
mm2src/common/jsonrpc_client.rs Outdated Show resolved Hide resolved
mm2src/common/jsonrpc_client.rs Outdated Show resolved Hide resolved
mm2src/common/jsonrpc_client.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/common/jsonrpc_client.rs Outdated Show resolved Hide resolved
@shamardy
Copy link
Collaborator

shamardy commented Sep 6, 2022

@borngraced please also fix test_electrum_rpc_client_error

@shamardy
Copy link
Collaborator

shamardy commented Sep 6, 2022

@borngraced please also fix test_electrum_rpc_client_error

Nevermind, it will be fixed automatically by this #1446 (comment)

shamardy
shamardy previously approved these changes Sep 7, 2022
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

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

Great refactoring! We're getting rid of the String errors step-by-step.
Please consider my change requests.

mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Show resolved Hide resolved
mm2src/coins/utxo/rpc_clients.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/utxo_common.rs Show resolved Hide resolved
mm2src/coins/utxo/utxo_tests.rs Outdated Show resolved Hide resolved
mm2src/common/jsonrpc_client.rs Show resolved Hide resolved
mm2src/common/jsonrpc_client.rs Show resolved Hide resolved
mm2src/mm2_core/src/mm_ctx.rs Outdated Show resolved Hide resolved
mm2src/mm2_core/src/mm_ctx.rs Outdated Show resolved Hide resolved
mm2src/mm2_main/src/docker_tests.rs Outdated Show resolved Hide resolved
sergeyboyko0791
sergeyboyko0791 previously approved these changes Sep 9, 2022
Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

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

Thank you for this enhancement!
Approve 🔥

Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Re-approve

Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

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

Thank you for the great enhancement!
Approve!

@sergeyboyko0791 sergeyboyko0791 merged commit 1438bf9 into dev Sep 13, 2022
@sergeyboyko0791 sergeyboyko0791 deleted the tx_wait_confirmation_error_fix branch September 13, 2022 12:23
@borngraced borngraced mentioned this pull request Feb 17, 2023
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.

3 participants