spacemeshos / pm

Project management. Meta-tasks related to research, dev, and specs for the Spacemesh protocol and infrastructure.
http://spacemesh.io/
Creative Commons Zero v1.0 Universal
2 stars 0 forks source link

sync v2 #272

Open dshulyak opened 7 months ago

dshulyak commented 7 months ago

this is a placeholder (not a spec) for all known sync improvements:

this was implemented way before project switched to libp2p and had other requirements in mind. right now this code has no benefits.

the goal is to have implementation that makes good use of hardware resources:

current implementation lacks protection against abuse. some queries are expensive and we should rate limit them in a way that allows honest nodes to get data that they need, and prevents abusers from causing harm.

additionally every sync endpoint should be fuzzed. it needs to be taken into account when writing code for it.

existing implementation may miss out of order data. this is required long term for consensus correctness. the implementation idea was to index data by received timestamp, and send such data to peers according to the timestamp.


from that list above it will be good implement 3 first items within 3 months. 4th item in 6 month or so

pigmej commented 4 months ago

We should also make it so that requests are evenly split, because right now they're not. image

I understand the need for recent layers (yellow), but all others are DDoSing nodes.

lrettig commented 4 months ago

We should also make it so that requests are evenly split, because right now they're not. image

I understand the need for recent layers (yellow), but all others are DDoSing nodes.

I don't understand any of what I'm looking at here. What does this mean? What are the colors? What are the axes?

fasmat commented 4 months ago

@lrettig: Requests for layer data comes in bursts, roughly every 5 minutes. For recent layers (yellow - recent 10 layers) this is OK, but for older layers (other colours, e.g. blue - last 2000 layers) this should be more evenly spread out to avoid spikes of requests / traffic that could be spread across a larger timeframe.

pigmej commented 4 months ago

very good summary from @fasmat that's exactly what it is. X time, Y number, colors, and legend "layers behind CurrentLayer at the time of asking.

ivan4th commented 3 weeks ago

Current code related to synvc2 effort is here: spacemeshos/go-spacemesh#5769 The generic peer-to-peer set reconciliation algorithm based on the "monoid tree" structure is already implemented. The work is being done to perform "SREP"-style" multi-peer sync that eventually can replace gossip.

There's also another proposal of a potentially simpler sync approach, but it makes an assumption that transferring e.g. a month worth of ATX IDs is and always will be cheap, and while this assumption may (or may not) hold for a while for a while after the ATX merge, it is not guaranteed to hold in the long run