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

Add msg tag to the DHT header to enable traces across nodes. #1881

Merged
merged 1 commit into from
May 22, 2020

Conversation

hansieodendaal
Copy link
Contributor

@hansieodendaal hansieodendaal commented May 18, 2020

Description

Enabling tracking of messages across nodes during testnet.

Example trace across nodes:
Sender stage 1

2020-05-20 10:51:38.181692300 [wallet::transaction_service::protocols::send_protocol] DEBUG Transaction (TxId: 17864096577764166221) Direct Send to 34ff4b3d9b20b76237becba4a839616a0b12441bb7a02152efdb08276e60e21e queued with Message Tag: MessageTag(9987700374622772089)
Header: Network: TestNet, Flags: NONE, Destination: Unknown, Trace: Tag#9987700374622772089
Tag#9987700374622772089
2020-05-20 10:51:38.181692300 [comms::dht::serialize] DEBUG Serializing outbound message MessageTag(9987700374622772089)
2020-05-20 10:51:45.683754200 [comms::protocol::messaging::outbound] TRACE Sending message (161 bytes) (MessageTag(9987700374622772089)) on outbound messaging substream
2020-05-20 10:51:45.684755600 [comms::protocol::messaging] TRACE Internal messaging event 'MessageSent(Tag#9987700374622772089)'

Receiver stage 1

2020-05-20 10:51:46.201902100 [comms::dht::deserialize] DEBUG Deserialization succeeded. Passing message Tag#8017475515622449727 onto next service (Trace: Tag#9987700374622772089)
Header: DhtMessageHeader (Dest:Unknown, Type:None, Network:TestNet, Flags:NONE, Trace:Tag#9987700374622772089)
2020-05-20 10:51:46.255901200 [wallet::transaction_service::service] TRACE Handling Transaction Message, Trace: Tag#9987700374622772089
2020-05-20 10:51:46.255901200 [wallet::transaction_service::service] TRACE Transaction (TxId: 17864096577764166221) received from 2609540b35ae89562ac985a7d5ba38e94ada5fd9dea3aa9781dd3c75eeb0cd5a, Trace: Tag#9987700374622772089
BUG Transaction Reply (TxId: 17864096577764166221) Direct Send to 2609540b35ae89562ac985a7d5ba38e94ada5fd9dea3aa9781dd3c75eeb0cd5a queued with Message Tag: MessageTag(9469085710403154976), Trace: Tag#9987700374622772089
2020-05-20 10:51:46.297899400 [wallet::transaction_service::service] INFO  Direct Send of Transaction Reply message for TX_ID: 17864096577764166221 was successful, Trace: Tag#9987700374622772089
2020-05-20 10:51:46.304898100 [wallet::transaction_service::service] INFO  Transaction with TX_ID = 17864096577764166221 received from 2609540b35ae89562ac985a7d5ba38e94ada5fd9dea3aa9781dd3c75eeb0cd5a, Trace: Tag#9987700374622772089. Reply Sent
2020-05-20 10:51:46.304898100 [wallet::transaction_service::service] INFO  Transaction (TX_ID: 17864096577764166221) - Amount: 9000 µT - Message: #Test direct Tx send 20200520_1050, Trace: Tag#9987700374622772089

Receiver stage 2

Header: Network: TestNet, Flags: NONE, Destination: Unknown, Trace: Tag#9469085710403154976
Tag#9469085710403154976
2020-05-20 10:51:46.296898000 [comms::dht::serialize] DEBUG Serializing outbound message MessageTag(9469085710403154976)
2020-05-20 10:51:46.297899400 [wallet::transaction_service::service] DEBUG Transaction Reply (TxId: 17864096577764166221) Direct Send to 2609540b35ae89562ac985a7d5ba38e94ada5fd9dea3aa9781dd3c75eeb0cd5a queued with Message Tag: MessageTag(9469085710403154976), Trace: Tag#9987700374622772089
2020-05-20 10:51:46.297899400 [comms::protocol::messaging::outbound] TRACE Sending message (869 bytes) (MessageTag5710403154976)) on outbound messaging substream
2020-05-20 10:51:46.297899400 [comms::protocol::messaging] TRACE Internal messaging event 'MessageSent(Tag#9469085710403154976)'

Sender stage 2

2020-05-20 10:51:46.804956900 [comms::dht::deserialize] DEBUG Deserialization succeeded. Passing message Tag#14698651695090578213 onto next service (Trace: Tag#9469085710403154976)
Header: DhtMessageHeader (Dest:Unknown, Type:None, Network:TestNet, Flags:NONE, Trace:Tag#9469085710403154976)
2020-05-20 10:51:46.805956400 [wallet::transaction_service::service] TRACE Handling Transaction Reply Message, Trace: Tag#9469085710403154976

Motivation and Context

Sometimes messages disappear between nodes; this change to enable tracking messages across nodes during testnet by inserting the originating message tag into the DHT header.

How Has This Been Tested?

Tested between 2x Windows and 1x Linux nodes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Feature refactor (No new feature or functional changes, but performance or technical debt improvements)
  • New Tests
  • Documentation

Checklist:

  • I'm merging against the development branch.
  • I ran cargo-fmt --all before pushing.
  • I have squashed my commits into a single commit.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@hansieodendaal hansieodendaal changed the title WIP: Add msg tag to the DHT header to enable traces across nodes. Add msg tag to the DHT header to enable traces across nodes. May 19, 2020
@hansieodendaal hansieodendaal requested a review from philipr-za May 20, 2020 07:20
@hansieodendaal hansieodendaal changed the title Add msg tag to the DHT header to enable traces across nodes. WIP: Add msg tag to the DHT header to enable traces across nodes. May 20, 2020
@hansieodendaal hansieodendaal force-pushed the ho_trace_msg_tag branch 2 times, most recently from 7f84db9 to f555048 Compare May 20, 2020 08:49
@hansieodendaal hansieodendaal changed the title WIP: Add msg tag to the DHT header to enable traces across nodes. Add msg tag to the DHT header to enable traces across nodes. May 20, 2020
Copy link
Contributor

@philipr-za philipr-za left a comment

Choose a reason for hiding this comment

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

Main comment is that I think you should be consistent and change Message Trace to MessageTag both in the type and the log labels to make it clear what it is and to conform to how it is used and referred to in the rest of the code.

…inating `msg tag` as the transaction protocol is executed.
Copy link
Contributor

@philipr-za philipr-za left a comment

Choose a reason for hiding this comment

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

LGTM

@CjS77 CjS77 merged commit b8ad396 into development May 22, 2020
@sdbondi sdbondi deleted the ho_trace_msg_tag branch May 22, 2020 11:47
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.

3 participants