带时间戳的领导者选举过程

发布于 2025-02-03 07:23:56 字数 656 浏览 2 评论 0原文

试图使用我的规格创建领导者选举协议,但我失败了。让我描述更多细节。

让我们想象我们有5个节点A,B,C,D,E,我们还假设所有这些节点都竞争解决一个像POW之类的难题,但对于我们的情况是无关紧要的。我们还假设C,D,D同时求解了难题,并发送证明其他节点中的验证。

  1. A [C2,D3]

  2. B [C4,D2]

  3. E [C3,D6]

节点A,B,E接收来自C,d的消息。例如,节点A在时间戳2处从C中接收C的消息,并在时间戳3处接收到D,它还验证了C,D成功地解决拼图的证据。

我现在正在搜索的是从获奖者C,D中选择最快的节点,并将他视为协议的领导者。结果,他们都交换了他们的消息,平均时间以最小的时间找到获胜者节点。如果随机选择节点B,它将计算C [4+2+3]/3 = 3,d [3+2+6]/3 = 3,6的时间。

因此,每个节点都会计算C和时间3,6 d的时间3,最后,他们选择了最低时间戳作为领导者的C。

到目前为止,我是否正确?这个过程有逻辑吗?

我的大问题现在是如果B节点是恶意的,并尝试欺骗协议并将不同的值发送给A,E这会使所有节点感到困惑,以使它们无法达成共识。我们如何解决此问题并通过此步骤?

谁能给我任何想法?

trying to create a leader election protocol with my specifications but i fail. Let me describe more detail.

Let's imagine we have 5 nodes A,B,C,D,E and let's also assume that all of them compete to solve a puzzle something like PoW but for our scenario is irrelevant. Let's also assume that both C,D solve simultaneously the puzzle and send the proofs for verifications in the other nodes.

  1. A[C2,D3]

  2. B[C4,D2]

  3. E[C3,D6]

Nodes A,B,E receives messages from C,D. For example node A receives a message from C at timestamp 2 and from D at timestamp 3 it also verifies proofs that C,D solves the puzzle successfully.

What i am searching for now is to pick the fastest node from the winners C,D and recognize him as the leader of the protocol. As a result, they all exchange their messages and they average the times to find the winner node with the smallest time. if randomly pick node B it will calculate the time for C [4+2+3]/3=3, D[3+2+6]/3=3,6.

Hence every node will calculate time 3 for C and time 3,6 D and finally, they choose C with the lowest timestamp as a leader.

Am i correct until now does this process has logic?

My big problem now is what happened if B node is malicious and try to trick the protocol and send different values to A,E this will confuse all node so they cannot reach a consensus. How can we fix this and pass this step?

Can anyone give me any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别忘他 2025-02-10 07:23:56

“ nofollow noreferrer”> falsemhoods程序员相信时间适用时间。特别是关于信任系统时钟的位。

领导者选举的第一个好算法是 paxos 。此后出现了许多其他人。参见在这里 partial列表。

正确获取分布式编程很难。在过去的十年中, jepsen 已经分析了许多系统。在绝大多数情况下,作者认为他们可以有效地介绍其系统失败是错误的保证。您不应该期望打败平均水平。因此,我强烈建议您将领导者选举委托为经过验证的软件,例如 zookeeper 而不是试图滚动自己的实施。

Falsehoods programmers believe about time applies. Particularly the bits about trusting the system clock.

The first good algorithm for leader election was Paxos. A number of others have emerged since. See here for a partial list.

Getting distributed programming right is hard. In the past decade, Jepsen has analyzed a lot of systems. In the overwhelming majority of cases the guarantees that the authors thought they could validly give about how their systems would fail were wrong. You shouldn't expect to beat that average. Therefore I strongly recommend that you delegate leader election to proven software such as Zookeeper rather than trying to roll your own implementation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文