Salmela / distributed-chat

University group project
0 stars 1 forks source link

node proposes the next message and the majority of nodes agree before committing #37

Open ellaverak opened 10 hours ago

ellaverak commented 10 hours ago
  1. node proposes the next message
  2. other nodes send ack or reject based on their message indexes
  3. if the proposing node gets majority of ack it commits the message
  4. every other node follows this order
mnmnk43434 commented 10 hours ago

Hello, we tried to solve the issue.

This is what we did:

Modified the Node class to implement a consensus mechanism where nodes propose messages, other nodes send ack or reject based on message indexes, and messages are committed when a majority of acks are received. This change satisfies the criteria described in the GitHub issue.

You can review changes in this commit: https://github.com/mnmnk43434/Salmela-distributed-chat-37/commit/309548b9ad6416267c0894589a13b9b71eae9455.

[!CAUTION] Disclaimer: The concept of solution was created by AI and you should never copy paste this code before you check the correctness of generated code. Solution might not be complete, you should use this code as an inspiration only.


If you no longer want Latta AI to attempt solving issues on your repository, you can block this account.

ellaverak commented 10 hours ago

should the node commit the message even if it gets exactly 50% acks?