Skip to content

Addrthread finish - #1576

Merged
PeterSurda merged 1 commit into
Bitmessage:v0.6from
PeterSurda:addrthread-1
Dec 3, 2019
Merged

PeterSurda merged 1 commit into
Bitmessage:v0.6from
PeterSurda:addrthread-1

Conversation

@PeterSurda

@PeterSurda PeterSurda commented Nov 27, 2019 •

Copy link
Copy Markdown
Member
  • addrthread is supposed to spread addresses as they appear. This was never
    finished during migration to asyncore
  • conservative to prevent flood and loops
  • randomises order
  • see addrthread unfinished #1575

@PeterSurda
PeterSurda force-pushed the addrthread-1 branch 9 times, most recently from 9aa0b1d to eccdb7c Compare November 27, 2019 07:27
@PeterSurda
PeterSurda marked this pull request as ready for review November 27, 2019 07:36
@PeterSurda
PeterSurda requested a review from g1itch November 27, 2019 07:36
Comment thread src/network/constants.py Outdated
@g1itch

g1itch commented Nov 27, 2019

Copy link
Copy Markdown
Collaborator

So the AddrThread should periodically send addr messages to all connections?

@g1itch

g1itch commented Nov 27, 2019

Copy link
Copy Markdown
Collaborator

Also I don't understand Multiqueue ): for example _init() seems unused.

Comment thread src/network/addrthread.py Outdated
@PeterSurda

Copy link
Copy Markdown
Member Author

So the AddrThread should periodically send addr messages to all connections?

kind of, it relays those received from others

@PeterSurda

Copy link
Copy Markdown
Member Author

Also I don't understand Multiqueue ): for example _init() seems unused.

It's inherited from Queue.Queue and called from its own __init__: _init()

@PeterSurda

Copy link
Copy Markdown
Member Author

In other words, with respect to Multiqueue, many calls are called from super, I just reimplement the internal methods. since Queue.Queue only has one deque(), whereas Multiqueue has several of them in a list and iterates over them.

Comment thread src/network/addrthread.py Outdated
Comment thread src/network/assemble.py Outdated
Comment thread src/network/bmproto.py Outdated
@PeterSurda

Copy link
Copy Markdown
Member Author

Thank you for the review, I made the changes except I put destination the last, after seenTime, so that the list for addrQueue and assemble_addr have the first three variables in the same order (addrQueue having a fourth at the end).

Comment thread src/network/addrthread.py Outdated
- addrthread is supposed to spread addresses as they appear. This was never
  finished during migration to asyncore
- conservative to prevent flood and loops
- randomises order
- move protocol constants into a separate file
- move addr packet creation into a separate file
- see Bitmessage#1575
@g1itch

g1itch commented Nov 30, 2019

Copy link
Copy Markdown
Collaborator

I merged the branch and trying to connect to at least two nodes. It takes so long last time ):

@g1itch g1itch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Seems working as expected

@PeterSurda

Copy link
Copy Markdown
Member Author

I'm testing it on a public IP just to make sure there are no weird bandwidth spikes. I'll leave it for a couple of days.

@PeterSurda

Copy link
Copy Markdown
Member Author

Testing doesn't reveal any unusual amount of traffic.

@PeterSurda
PeterSurda merged commit a69732f into Bitmessage:v0.6 Dec 3, 2019
@g1itch g1itch mentioned this pull request Dec 4, 2019
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