-
Notifications
You must be signed in to change notification settings - Fork 220
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!: revalidate all outputs #3471
feat!: revalidate all outputs #3471
Conversation
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.
So you also have to do the same process for transactions. This PR only addresses outputs. This PR also just marks them to validated but doesn't trigger a validation.
@@ -93,6 +94,7 @@ impl fmt::Display for OutputManagerRequest { | |||
GetInvalidOutputs => write!(f, "GetInvalidOutputs"), | |||
GetSeedWords => write!(f, "GetSeedWords"), | |||
ValidateUtxos => write!(f, "ValidateUtxos"), | |||
ReValidateUtxos => write!(f, "ReValidateUtxos"), |
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.
ReValidateUtxos => write!(f, "ReValidateUtxos"), | |
RevalidateTxos => write!(f, "RevalidateTxos"), |
@@ -274,6 +274,10 @@ where | |||
OutputManagerRequest::ValidateUtxos => { | |||
self.validate_outputs().map(OutputManagerResponse::TxoValidationStarted) | |||
}, | |||
OutputManagerRequest::ReValidateUtxos => self |
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.
OutputManagerRequest::ReValidateUtxos => self | |
OutputManagerRequest::RevalidateTxos => self |
@@ -127,6 +129,7 @@ pub enum OutputManagerResponse { | |||
SeedWords(Vec<String>), | |||
BaseNodePublicKeySet, | |||
TxoValidationStarted(u64), | |||
TransactionsMarkedToBeRevalidated, |
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.
TransactionsMarkedToBeRevalidated, | |
TxoRevalidationStarted, |
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.
These are not transactions but outputs being validated
@@ -385,6 +389,11 @@ where | |||
Ok(id) | |||
} | |||
|
|||
async fn revalidate_outputs(&mut self) -> Result<(), OutputManagerError> { | |||
self.resources.db.set_outputs_to_be_revalidated().await?; | |||
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.
Trigger a validation as well.
5ee20d6
to
f074a23
Compare
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.
This looks good. I would just like a rust test for both these validations please. The tooling should make it fairly easy to put together.
f074a23
to
08e0201
Compare
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.
LGTM
|
||
rpc_service_state.set_utxo_query_response(utxo_query_responses.clone()); | ||
|
||
// This response sets output1 as spent |
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.
This comment seems wrong? Below it look like both outputs are unspent?
Clippy says no |
08e0201
to
a75ffca
Compare
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.
LGTM
Co-authored-by: Philip Robinson <[email protected]>
049d83b
to
c770b48
Compare
* development: (31 commits) feat!: revalidate all outputs (tari-project#3471) fix: check SAF message inflight and check stored_at is in past (tari-project#3444) feat!: apps should not depend on other app configs (tari-project#3469) fix: fix recovery test reporting message (tari-project#3479) chore: improve cucumber tests to wait for broadcast (tari-project#3461) test: use TCP node for daily sync test (tari-project#3464) fix: remove unbounded vec allocations from base node grpc/p2p messaging (tari-project#3467) fix: upgrade rustyline dependencies (tari-project#3476) fix(dht): discard encrypted message with no destination (tari-project#3472) fix: remove consensus breaking change in transaction input (tari-project#3474) feat: tx weight takes tariscript and output features into account [igor] (tari-project#3411) fix: validate dht header before dedup cache (tari-project#3468) fix: sha256sum isn't available on all *nix platforms (tari-project#3466) fix: typo in console wallet (tari-project#3465) fix: ensure that accumulated orphan chain data is committed before header validation (tari-project#3462) fix: remove is_synced check for transaction validation (tari-project#3459) feat: improve logging for tari_mining_node (tari-project#3449) fix: remove unnecessary wallet dependency (tari-project#3438) test: simplify cucumber tests (tari-project#3457) ci: create script to update DNS records from hashes.txt (tari-project#3458) ...
Description
This PR marks all outputs to be invalidated by the validation tasks by removing the:
Motivation and Context
This will allow a user to revalidate all utxos in the current database.
How Has This Been Tested?
Manual testing that after this has been triggered that all utxo's are invalidated again.