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: check SAF message inflight and check stored_at is in past #3444

Merged

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Oct 11, 2021

Description

Motivation and Context

See #3412, #3410

How Has This Been Tested?

  • New/existing unit/integration tests
  • memorynet
  • Manually

- Keeps track of inflight SAF requests and only accepts responses for
  requests that are inflight
- Checks that `stored_at` is in the past
- Fixes tari-project#3412, 3410
Copy link
Collaborator

@SWvheerden SWvheerden left a comment

Choose a reason for hiding this comment

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

LGTM,

This does seem to somewhat limit the poisoning that can happen to the LastSafMessageReceived variable, it can still happen. But we are still trusting in, information received and calculated by another peer.

@sdbondi
Copy link
Member Author

sdbondi commented Oct 11, 2021

Yeah if we look at the way it previously worked (before using a timestamp sent by a remote peer), there was no stored_at field but you essentially trusted that the peer gave you the latest messages, then marked the timestamp when the node shut down so that you would request messages from that time (while online you would receive propagated messages). There was still trust involved even without a timestamp. In the end, the protocol has to have the required rules to prevent abuse.

I think that message deliverability could be improved by only updating timestamp (based on offline timestamp or stored_at) only after the appropriate peers have been queried rather than just a single peer, this would also further limit "poisoning". I tend to think that this would be easier to implement with a comms RPC interface in a similar way to block sync et al.

@aviator-app aviator-app bot merged commit fbf8eb8 into tari-project:development Oct 24, 2021
@sdbondi sdbondi deleted the dht-validate-saf-requests branch October 24, 2021 08:27
sdbondi added a commit to sdbondi/tari that referenced this pull request Oct 25, 2021
* 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)
  ...
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.

Node should verify DHT message field "stored_at"
3 participants