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

Designing nack messages #39

Open
michielbdejong opened this issue Sep 20, 2024 · 4 comments
Open

Designing nack messages #39

michielbdejong opened this issue Sep 20, 2024 · 4 comments

Comments

@michielbdejong
Copy link
Member

In the light of #37 I'm thinking of nack messages that indicate that a node knows it has no further loops.
This can be because it is a leaf, or because all its other neighbours have sent a nack message.
So I'm going to track nack messages in the FriendsEngine.
As an extra step in the meet process, a meet will either be followed by a nack, or be replied to with an ack or a nack, and the flood probe for the newly created link will only be sent if no nack was sent and an ack was received.

I'm also considering ack in response to probe but I think that will be too expensive.

@michielbdejong
Copy link
Member Author

Thanks to ack/nack on meet, the DISBURSEMENT transactions have become orders of magnitude faster. Can now run up to line 7950 (27 STANDARD and 7922 DISBURSEMENT transactions) in 29 seconds.

@michielbdejong
Copy link
Member Author

I'm feeling like I want to rewrite a node implementation from scratch.
The separation between FriendsEngine and ProbesEngine (which itself keeps track of friends), all wired through the main Badger class with events, is annoying.

Are events (reacting to incoming messages) even the right approach? Or should the design be more state-driven (incoming messages update the state, and at any point the node can decide to look at its state and trigger some action)? The latter feels like it may become cleaner, so the node has a better model of its environment and doesn't depend on replies from other nodes to continue what it was doing.

@michielbdejong
Copy link
Member Author

In any case, the Sarafu data set has 1,000,000 transactions of which 422,721 are standard, across 55,000 nodes, so we'll have to do a about 4 orders of magnitude more than what the simulation is handling right now.

@michielbdejong
Copy link
Member Author

In any case, we don't want to trigger a flood probe from every meet event, and we want to build in queuing and filtering, and in general be much more deliberate about when a probe is forwarded.

Maybe nacks coming back from probes can be very useful to identify dead-end branches.
Each node should keep state of that.
When two nodes meet, if previously both of them were on acyclic trees, they don't know if they're on the same acyclic tree or on a different one. That's what the probe checks.
Does it need to bounce back from all leaves to prove that?

Leaf nodes never have to participate in any probes
Line nodes can just pass them on transparently, unless maybe a special line probe to detect perfect circles.
Fork nodes play a role though, and should try to find one loop per trade pair.

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

No branches or pull requests

1 participant