MinaProtocol / mina

Mina is a cryptocurrency protocol with a constant size blockchain, improving scaling while maintaining decentralization and security.
https://minaprotocol.com
Apache License 2.0
1.99k stars 529 forks source link

Snark pool not checking snarks #589

Closed imeckler closed 5 years ago

imeckler commented 6 years ago

I may be wrong but it looks like we don't check snarks when putting them into the snark pool/rebroadcasting them. This is of course wrong. However, it is still a big DDOS channel (since someone can flood us with correct proofs of useless statements) so we need to figure out something there.

nholland94 commented 6 years ago

To fix this, we will make it so that we only rebroadcast statements when they could be relevant to any other node in the network. More formally, we only rebroadcast a statement iff at least one tip the the ledger builder controller contains a ledger builder which includes the statement.

nholland94 commented 6 years ago

https://github.com/o1-labs/nanobit/pull/800

deepthiskumar commented 6 years ago

I think we also have to look at the case when someone floods us with incorrect proofs of useful statements

nholland94 commented 6 years ago

Maybe we should always verify the proofs of statements that we believe to be relevant before adding them to the snark pool and rebroadcasting? The only worry there is that it may incure a decent cpu cost. Though, I don't think there is any way around it. We need to be sure that something is valid before rebroadcasting it, otherwise we are responsible for that bad info and could be punished for it as if we generated it.

imeckler commented 6 years ago

We'll blacklist them right? @deepthiskumar

emberian commented 5 years ago

Ongoing refactor work by @enolan will help with this.