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

feat: block wallets from sending if BN connection stale #5949

Merged
merged 2 commits into from Nov 16, 2023

Conversation

SWvheerden
Copy link
Collaborator

Description

block wallet from sending if metadata from base node is stale and older than 15 mins
The console wallet will print out a warning if the connection is stale.

Motivation and Context

Sending via old metadata can cause issues with wallets using old data. The transactions might not be valid anymore

Fixes: #5855

Copy link

github-actions bot commented Nov 13, 2023

Test Results (CI)

1 263 tests   1 263 ✔️  10m 34s ⏱️
     39 suites         0 💤
       1 files           0

Results for commit 5330f96.

♻️ This comment has been updated with latest results.

@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels Nov 13, 2023
Copy link

github-actions bot commented Nov 13, 2023

Test Results (Integration tests)

31 tests   31 ✔️  14m 32s ⏱️
11 suites    0 💤
  2 files      0

Results for commit 5330f96.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@brianp brianp left a comment

Choose a reason for hiding this comment

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

LGTM. Ack

One suggestion, but not vital.

.updated
.ok_or(BaseNodeServiceError::NoChainMetadata)?;
if Utc::now().naive_utc().timestamp() - last_updated.timestamp() > 15 * 60 {
return Err(BaseNodeServiceError::NoChainMetadata);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this error be more specific than NoChainMetadata. Assumedly we have some metadata it's just that we consider it stale.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

maybe.. I thought about it, but still not sure.

@SWvheerden SWvheerden merged commit 18d5f57 into tari-project:development Nov 16, 2023
14 checks passed
@SWvheerden SWvheerden deleted the sw_old_metadata branch November 16, 2023 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wallet has no warning for stale balance
3 participants