-
Notifications
You must be signed in to change notification settings - Fork 39
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
BFT-463: Add LeaderSelectionMode::Rota #115
Conversation
please remember to make the pr backward compatible |
0e5f413
to
15621e5
Compare
I tried (for binary, mentioned the potential JSON issue). Can you highlight what you consider a breaking change? |
Are there some JSON based parsers, for config or genesis? |
I can see the config being read from JSON in node/tools/main. All other JSON-Protobuf conversions seem to be in various tests. @pompon0 so my question is: do you prefer to have a new variant next to Happy to add a new variant, just thought I'd open the PR and ask here. |
15621e5
to
dd086b7
Compare
genesis is stored in postgresdb in jsonb format |
also, Sticky is currently the only variant used in zksync-era and it will be in use for foreseeable future (main node being the only proposer). |
Thanks. Okay, now, what should I call this thing with multiple keys... 🤔 |
621c78c
to
d9db46f
Compare
plan is to make ENs non-proposer validators |
Hate to ask, but what's an "EN"? |
External node. That's old terminology though, we can start calling them full nodes. |
Thanks @brunoffranca |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I would maybe rename the mode though. Round robin and Rota are synonyms. Since we are rotating on a subset of validators, maybe call it Subset?
d9db46f
to
7f0d40d
Compare
I don't think they are synonyms... supervisors create the rota for workers to do, they aren't necessarily doing any round robin 🤔 From Google:
The problem is it's not a subset, it's a list that can be arbitrarily long and contain arbitrarily repeating elements, e.g. [Alice, Bob, Alice, Alice, Alice, Charlie]. |
So, I think Grzegorz comment was a bit confusing. Let me clear this up. |
From vocabulary.com:
@brunoffranca would you prefer |
Ok, fair enough. I thought it only meant "round or rotation of duties". Let's keep it then. |
What ❔
Adds a
LeaderSelectionMode::Rota
to allow specifying leaders in subsequent views using a list of public keys. The 1st validator on the list is going to be the leader in view 0, the 2nd in view 1, the 3rd in view 2, wrapping around to start from the beginning as the views increase. There can be repeated keys on the list, and they all have to be part of the committee.Why ❔
This is part of BFT-439 to modify the BFT tests to use the approach outlined in the Twins paper. Part of that is the ability to control who is the leader in each of the views.
With this change we should be able to generate a fixed leader schedule for the first few rounds of a protocol. The implementation wraps around so it's a total function, but in practice the tests will provide leaders for all the rounds executed in the test.
Why not modify
Sticky
?I thought about whether I should add a new variant to
LeaderSelectionMode
or modifyLeaderSelectionMode::Sticky
to allow multiple values. On the Protobuf bytecode level they should be compatible, and I thoughtSticky
is probably used mostly in tests.Based on the answers in the comments below, this is not the case, and it is in fact used in production to represent the centralised sequencer. The genesis it is part of is stored in Postgres as JSONB, so changes in the key name would not be backwards compatible. The
protobuf_conformance
workflow correctly highlighted this regression 🎉