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
[feature] #4285: Verifiable Random Function in Sumeragi #4368
base: main
Are you sure you want to change the base?
Conversation
)); | ||
|
||
let mut topology = { | ||
let mut shuffle_peers: Vec<PeerId> = block.commit_topology().clone().into(); |
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.
is it really a necessity that we store commit_topology
in the block? Can't we just use the current topology of sumeragi? Because this field can blow the chain size up significantly
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.
It is. We could imagine some scheme where we store only a delta and can infer the current topology. But I think it's probably fine since the block headers don't stay in memory. Once 2 blocks have passed this data should only be on disk. I say the chance of bugs or mistakes is a lot higher if we try to be smart here. Does not seem worth it.
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.
But I think it's probably fine since the block headers don't stay in memory
that's true
We could imagine some scheme where we store only a delta and can infer the current topology
can't we replay topology while doing block replay? I'm saying it will be computed anyhow, so why store it in the block?
I say the chance of bugs or mistakes is a lot higher if we try to be smart here. Does not seem worth it
I need a better argument why it's necessary to store it in the block header
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.
It isn't necessary, you are right that we could replay the topology with the block replay. It didn't seem worth it to me since the topology is quite small. But if you think we should replay it then I could work on that.
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.
@mversic I misspoke in our call. We would need to sort after we make this change and keep track of Peers without storing it in the block header. Right now we use the commit topology and that will be the same for all peers since it is on the block header. Once we remove the topology from the header we would need track the peers with a UniqueVec for consistent shuffling on different peers. But as of now there is no thing I needed to force push to the PR.
0b78e0a
to
f30d277
Compare
@@ -169,7 +176,7 @@ impl Topology { | |||
} | |||
|
|||
/// Perform sequence of actions after block committed. | |||
pub fn update_topology(&mut self, block_signees: &[PublicKey], new_peers: UniqueVec<PeerId>) { | |||
fn update_topology(&mut self, block_signees: &[PublicKey], new_peers: UniqueVec<PeerId>) { |
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.
We still rely on order of signatures, which was highlighted as undesirable in the original issue.
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.
We don't rely on the order of the signatures, we only use them to form the A set.
I'm not sure that i fully understand the purpose of this change. Since VRFState looks predetermined from the beginning, so peer that submit genesis could manipulate it. Because it's computed as |
Can you provide any sources you used while implementing this approach? |
The topology for the next round is known only when a peer receives the block candidate. And nobody is able |
Also the seed value that the genesis peers submits is completely unimportant. It just needs to be some value. I've thought about @mversic 's suggestion that we should replay topology from the start and not store it on each block. I think it is a good idea and I will make the change in this PR. |
Afaik for the single pair of payload and private key there is more than one valid signature. EDIT: there is some signature schemas like BLS which has unique signature property. |
Good point. I will have to investigate that. It might be that I can encrypt the hash with the private key, that way creating a signing scheme that only has one correct answer. This is the behavior I assumed from our signature primitives. Good that you spotted this. |
@SamHSmith don't remove |
4eaa302
to
ff1b502
Compare
faeed55
to
168e538
Compare
Pull Request Test Coverage Report for Build 8622562946Details
💛 - Coveralls |
7981b39
to
7235d94
Compare
Signed-off-by: Sam H. Smith <sam.henning.smith@protonmail.com>
Something is wrong with the CI here. |
Description
Adds a crypto primitive and randomization of the topology on block commits.
Linked issue
Closes #4285
Benefits
Checklist
CONTRIBUTING.md