-
Notifications
You must be signed in to change notification settings - Fork 219
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: timestamp validation #4887
feat: timestamp validation #4887
Conversation
Related to #4870 |
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.
NACK. I don't think this is what @SWvheerden had in mind when logging the issue
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.
utACK
I had an easier fix in mind with just not running this with the header validation. And only running this when we actually add the block, but this is fine.
I do however want to test run this for a day to see if it works as intended.
I did manage to sync one and tan through the night without any issues so far. |
I'm going through the code. And I don't see any validation of the median timestamp outside of the orphan tree construction. In the whole code we validate the median timestamp at two location, header sync and orphan tree construction. I can add the timestamp validation if the block added is not an orphan. But once we add anything from the stored orphan block there is no validation. Currently there is some validation that is not consistent across nodes. |
I would just add the check here:
This should be the last validator that's gets called right before a block is added to the database. |
cc81ea6
to
eae7b18
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.
utACK
This is only done for block propagation and not syncing.
But I think this should be fine as header sync will add and validate blocks in order.
But perhaps just in terms of keeping header/block sync and block propagation validation in sync, we should make the the same changes there?
Added. But IMHO I would not go this way. The sync has the validation in the headersync where it belongs. Now we do it double. |
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.
utACK
Yeah, agree with @Cifko, the async block validator does not need to validate headers, and that is efficiently done in the header sync by knowing that it will receive sequential headers. That said, the perf hit is minor so this could go in as is |
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.
Can be merged once CI passes
df78bdd
to
80d7562
Compare
utACK |
* development: fix: add hidden types and seed words to key manager (tari-project#4925) feat: timestamp validation (tari-project#4887) fix: deleted_txo_mmr_position_to_height_index already exists error (tari-project#4924) feat: add default grpc for localnet (tari-project#4937) first commit (tari-project#4926) v0.40.2 fix(dht): use limited ban period for invalid peer (tari-project#4933) feat: upgrade tari_crypto sign api (tari-project#4932) v0.40.1 chore: fix depreciated timestamp clippy (tari-project#4929) chore: fix naming of ffi functions and comments (tari-project#4930) fix: set wallet start scan height to birthday and not 0 (see issue tari-project#4807) (tari-project#4911) v0.40.0 chore: remove unused methods (tari-project#4922) fix: updates for SafePassword API change (tari-project#4927)
Description
Disable timestamp validation for orphan.
Enable during orphan new tips creation. It should be checked during the new tips creation so we don't select invalid tip in favor of lower difficulty but valid tip.