Skip to content
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

PoET proofs spam attack mitigation #173

Open
8 of 10 tasks
moshababo opened this issue Sep 18, 2022 · 1 comment
Open
8 of 10 tasks

PoET proofs spam attack mitigation #173

moshababo opened this issue Sep 18, 2022 · 1 comment

Comments

@moshababo
Copy link

moshababo commented Sep 18, 2022

The problem

Current network gossip protocol allows an easy-to-launch spam attack whereby an adversary can publish an unlimited amount of PoET proofs which are not associated by any ATX.

Creating valid PoET proofs is permissionless and cheapest-as-possible by design, in addition to not having gurantees on having a higher cost for creating multiple proofs in parallel or slightly different variations thereof. So from security perspective, the cost of creating a valid PoET proof should be thought of as zero, and cannot be considered as means to prevent such an attack.

In addition, every PoET proof contains a list of members associated with it, as an arbitrary-size byte array, which also not necessarily associated with actual ATXs.

The mitigation

Don’t allow the propagation of PoET proofs which don’t have an associated ATX costs. This means that PoET proofs cannot be gossiped prior to their associated ATXs, like they currently do.

ATX-publishing nodes would be responsible for obtaining these proofs from the PoET service (in an off-chain fashion). Assuming one proof will be associated with many ATXs, they should only contain a reference to it, like currently.
The actual proof should be retained locally and published upon demand, when a node receiving the ATX learns about it for the first time and is missing the full object in order to complete the ATX validation.

In addition, ATX-publishing nodes should obtain their distinct Merkle path from the PoET service, for proving their challenge's membership in the shared proof. The path should be included in the ATX.

Implementation

https://github.com/spacemeshos/poet

https://github.com/spacemeshos/go-spacemesh

Footnotes

  1. A future potential local optimization could be to construct a sparse tree out of the distinct Merkle proofs for a given PoET proof, in order to avoid having to store duplicated tree nodes data.

@noamnelke
Copy link
Member

LGTM 👍🏻

@selfdual-brain selfdual-brain moved this to Spec available (on-going review) in Research+Sandwich work pipeline Sep 24, 2022
@pigmej pigmej moved this to 📋 Backlog in Dev team kanban Sep 28, 2022
@pigmej pigmej removed the status in Dev team kanban Sep 28, 2022
@pigmej pigmej removed this from Dev team kanban Sep 28, 2022
@selfdual-brain selfdual-brain moved this from Spec available (on-going review) to Green light from dev in Research+Sandwich work pipeline Oct 4, 2022
@poszu poszu self-assigned this Nov 30, 2022
bors bot pushed a commit to spacemeshos/go-spacemesh that referenced this issue Dec 27, 2022
## Motivation
Part of spacemeshos/pm#173

Closes #3746 
Closes #3814 

## Changes
- removed broadcasting method from `GatewayService`
- removed p2p listeners for broadcasted poet proofs
- changed `NIPostBuilder` to query poets for proofs after the rounds end

## Test Plan
- added a system test in which nodes use different poets to verify if poet proofs are properly propagated between nodes

## TODO
- [ ] Bump poet to a released version in go.mod after spacemeshos/poet#187 is merged

## DevOps Notes
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [ ] ~This PR does not affect public APIs~ Proof broadcasting was removed
- [ ] ~This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)~ - It relies on a new Poet version
- [ ] ~This PR does not make changes to log messages (which monitoring infrastructure may rely on)~


Co-authored-by: moshababo <[email protected]>
bors bot pushed a commit to spacemeshos/go-spacemesh that referenced this issue Dec 27, 2022
## Motivation
Part of spacemeshos/pm#173

Closes #3746 
Closes #3814 

## Changes
- removed broadcasting method from `GatewayService`
- removed p2p listeners for broadcasted poet proofs
- changed `NIPostBuilder` to query poets for proofs after the rounds end

## Test Plan
- added a system test in which nodes use different poets to verify if poet proofs are properly propagated between nodes

## TODO
- [ ] Bump poet to a released version in go.mod after spacemeshos/poet#187 is merged

## DevOps Notes
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [ ] ~This PR does not affect public APIs~ Proof broadcasting was removed
- [ ] ~This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)~ - It relies on a new Poet version
- [ ] ~This PR does not make changes to log messages (which monitoring infrastructure may rely on)~


Co-authored-by: moshababo <[email protected]>
bors bot pushed a commit to spacemeshos/go-spacemesh that referenced this issue Dec 28, 2022
## Motivation
Part of spacemeshos/pm#173

Closes #3746 
Closes #3814 

## Changes
- removed broadcasting method from `GatewayService`
- removed p2p listeners for broadcasted poet proofs
- changed `NIPostBuilder` to query poets for proofs after the rounds end

## Test Plan
- added a system test in which nodes use different poets to verify if poet proofs are properly propagated between nodes

## TODO
- [ ] Bump poet to a released version in go.mod after spacemeshos/poet#187 is merged

## DevOps Notes
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [ ] ~This PR does not affect public APIs~ Proof broadcasting was removed
- [ ] ~This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)~ - It relies on a new Poet version
- [ ] ~This PR does not make changes to log messages (which monitoring infrastructure may rely on)~


Co-authored-by: moshababo <[email protected]>
bors bot pushed a commit to spacemeshos/go-spacemesh that referenced this issue Dec 28, 2022
## Motivation
Part of spacemeshos/pm#173

Closes #3746 
Closes #3814 

## Changes
- removed broadcasting method from `GatewayService`
- removed p2p listeners for broadcasted poet proofs
- changed `NIPostBuilder` to query poets for proofs after the rounds end

## Test Plan
- added a system test in which nodes use different poets to verify if poet proofs are properly propagated between nodes

## TODO
- [ ] Bump poet to a released version in go.mod after spacemeshos/poet#187 is merged

## DevOps Notes
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [ ] ~This PR does not affect public APIs~ Proof broadcasting was removed
- [ ] ~This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)~ - It relies on a new Poet version
- [ ] ~This PR does not make changes to log messages (which monitoring infrastructure may rely on)~


Co-authored-by: moshababo <[email protected]>
bors bot pushed a commit to spacemeshos/go-spacemesh that referenced this issue Dec 28, 2022
## Motivation
Part of spacemeshos/pm#173

Closes #3746 
Closes #3814 

## Changes
- removed broadcasting method from `GatewayService`
- removed p2p listeners for broadcasted poet proofs
- changed `NIPostBuilder` to query poets for proofs after the rounds end

## Test Plan
- added a system test in which nodes use different poets to verify if poet proofs are properly propagated between nodes

## TODO
- [ ] Bump poet to a released version in go.mod after spacemeshos/poet#187 is merged

## DevOps Notes
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [ ] ~This PR does not affect public APIs~ Proof broadcasting was removed
- [ ] ~This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)~ - It relies on a new Poet version
- [ ] ~This PR does not make changes to log messages (which monitoring infrastructure may rely on)~


Co-authored-by: moshababo <[email protected]>
bors bot pushed a commit to spacemeshos/go-spacemesh that referenced this issue Dec 28, 2022
## Motivation
Part of spacemeshos/pm#173

Closes #3746 
Closes #3814 

## Changes
- removed broadcasting method from `GatewayService`
- removed p2p listeners for broadcasted poet proofs
- changed `NIPostBuilder` to query poets for proofs after the rounds end

## Test Plan
- added a system test in which nodes use different poets to verify if poet proofs are properly propagated between nodes

## TODO
- [ ] Bump poet to a released version in go.mod after spacemeshos/poet#187 is merged

## DevOps Notes
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [ ] ~This PR does not affect public APIs~ Proof broadcasting was removed
- [ ] ~This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)~ - It relies on a new Poet version
- [ ] ~This PR does not make changes to log messages (which monitoring infrastructure may rely on)~


Co-authored-by: moshababo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Green light from dev
Development

No branches or pull requests

4 participants