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

fix(comms): ensure signature challenge is constructed consistently #3725

Merged

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Jan 20, 2022

Description

  • Ensure timestamp is timezone independent
  • Ensure multiple addresses are lexicographically ordered for the signature challenge
  • Add extra info in peer validation errors
  • migration that clears out all signatures (allowing new ones to take their place if provided)

Motivation and Context

Some base nodes are being banned for propagating invalid peer signatures - it is still not clear how this happens but
since peer signatures are checked before being committed it must be an inconsistency between base nodes in how the challenge is being constructed. Two possible but unconfirmed issues are that the integer timestamp from the naive date-time is effected by timezones (this PR replaces with DateTime<Utc>) and/or the addresses were not ordered consistently (doubtful because all peers currently only ever advertise one address, this PR sorts them lexicographically)

How Has This Been Tested?

Manually: ban still occurs, but it seems as if only the same few nodes somehow accepted an invalid signature, this PR will clear the invalid signatures and we can monitor from there.

@sdbondi sdbondi force-pushed the comms-signature-timezone-fix branch from 275ceee to 6bec552 Compare January 20, 2022 12:18
Copy link
Contributor

@delta1 delta1 left a comment

Choose a reason for hiding this comment

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

lgtm, untested

@aviator-app aviator-app bot merged commit e5173b7 into tari-project:development Jan 20, 2022
@sdbondi sdbondi deleted the comms-signature-timezone-fix branch January 20, 2022 15:41
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.

2 participants