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

Remove extra check in send_transaction_multi for chia coins split #16061

Closed
wants to merge 1 commit into from

Conversation

jack60612
Copy link
Contributor

@jack60612 jack60612 commented Aug 15, 2023

Purpose:

This removes a sync check from the wallet rpc send_transaction_multi

Current Behavior:

N/A

New Behavior:

N/A

Testing Notes:

Applicable test coverage exists, however this issue is hard to replicate and just happens, and this is the best way to fix it

@jack60612 jack60612 changed the title Draft: Remove extra check in send_transaction_multi for chia coins split Remove extra check in send_transaction_multi for chia coins split Aug 16, 2023
@jack60612 jack60612 added Wallet CLI Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog labels Aug 16, 2023
@jack60612 jack60612 requested a review from arvidn August 16, 2023 03:32
@jack60612 jack60612 marked this pull request as ready for review August 16, 2023 03:33
@jack60612 jack60612 requested a review from a team as a code owner August 16, 2023 03:33
Copy link
Contributor

@xdustinface xdustinface left a comment

Choose a reason for hiding this comment

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

This doesn't feel like the fix for the problem and it anyway will still run into the same issue in cat_spend here

transaction: Dict = (await self.cat_spend(request, hold_lock=False))["transaction"]

which does

if await self.service.wallet_state_manager.synced() is False:
raise ValueError("Wallet needs to be fully synced.")

I think we should instead make sure WalletStateManager.synced reliably knows when to return True and my guess is that the issue is related to the queue not being empty when the requests are triggered. Maybe because it in wallet only mode in those cases it uses an untrusted node which does the secondary sync always and keeps items in the queue or so.

has_pending_queue_items = self.wallet_node.new_peak_queue.has_pending_data_process_items()
if latest_timestamp > int(time.time()) - 5 * 60 and not has_pending_queue_items:
return True
It feels wrong to make the sync state also dependent on the queue which repeatedly might get filled even if we are "synced" because that probably also will lead to the sync state flipping back and forth, i guess. Maybe we just check the number of queue entries or so instead to make it at least more reliable while not flipping to synced too early but it feels like something which needs some more investigation.

@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Aug 16, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@emlowe
Copy link
Contributor

emlowe commented Aug 24, 2023

It does look like one could also remove the check from cat_spend however as well. Neither of these calls depend on anything in the wallet needing to be synced. They are simple constructing the bundle from the supplied options.

So I think removing this check is ok, but you do need to remove it from cat_spend as well

It is a much deeper question as to understanding how the wallet is synced or not

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2023

This PR has been flagged as stale due to no activity for over 60 days. It will not be automatically closed, but it has been given a stale-pr label and should be manually reviewed by the relevant parties.

@github-actions github-actions bot added the stale-pr Flagged as stale and in need of manual review label Oct 9, 2023
@jack60612 jack60612 closed this Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog merge_conflict Branch has conflicts that prevent merge to main stale-pr Flagged as stale and in need of manual review Wallet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When running Wallet only mode, unable to run Split coins command[Bug]
3 participants