ceramicnetwork / CIPs

The Ceramic Improvement Proposal repository
https://cips.ceramic.network/
MIT License
82 stars 22 forks source link

Recon #124

Closed AaronGoldman closed 1 year ago

AaronGoldman commented 1 year ago

A proposal synchronization of ranges of EventIDs from streams.

oed commented 1 year ago

Please use cip-124

oed commented 1 year ago

📚 Preview

oed commented 1 year ago

It might be nice to be able to reference a range as a ceramic://... uri

qbig commented 1 year ago

@AaronGoldman @oed would using a bloom filter in addition to a hash during set recon make it more efficient (less round trips)? https://www.youtube.com/watch?v=xuddEiu-t-8&ab_channel=HeidiHoward

you:  [ your initial keys ]
they: [ their initial keys ]
    -> ( request ) [ their keys after processing request]
    <- ( response ) [ your keys after processing response]

Current

you:  [ape,eel,fox,gnu]
they: [bee,cat,doe,eel,fox,hog]
    -> (ape, h(eel,fox), gnu) [ape,bee,cat,doe,eel,fox,gnu,hog]
    <- (ape, h(bee,cat), doe, h(eel,fox), gnu, 0, hog) [ape,doe,eel,fox,gnu,hog]
    -> (ape, 0, doe, h(eel,fox,gnu), hog) [ape,bee,cat,doe,eel,fox,gnu,hog]
    <- (ape, 0, bee, 0, cat, h(doe,eel,fox,gnu), hog) [ape,bee,cat,doe,eel,fox,gnu,hog]
    -> (ape, h(bee,cat,doe,eel,fox,gnu), hog) [ape,bee,cat,doe,eel,fox,gnu,hog]
    <- (ape, h(bee,cat,doe,eel,fox,gnu), hog) [ape,bee,cat,doe,eel,fox,gnu,hog]

After using a bloom filter

you:  [ape,eel,fox,gnu]
they: [bee,cat,doe,eel,fox,hog]
    -> ([ape, h(eel,fox), gnu] + bloom(eel,fox)) [ape,bee,cat,doe,eel,fox,gnu,hog]
    <- ([bee,cat,doe,hog] + [ape, h(bee,cat), doe, h(eel,fox), gnu, 0, hog] + bloom(ape..hog)) [ape,bee,cat,doe,eel,fox,gnu,hog]
AaronGoldman commented 1 year ago

fission's car-mirror work a little like that. https://talk.fission.codes/t/notes-through-the-multiverse-ipfs-car-pool-car-mirror/3647

Certainly the split range function could avoid sending keys in the bloom filter as the splits. This would reduce the likelihood of sending duplicate data at the cost of the bloom filter bandwidth. Particularly as you get close to the leaves where there are not huge numbers of keys in the ranges it is likely to save the last few rounds.

Screenshot 2023-05-23 at 3 13 43 PM

https://hur.st/bloomfilter/?n=&p=.001&m=2KiB&k=

e.g. If we through in a 2KiB filter we could probably send all remaining key when we got to about 1,000 keys in a range. Speeding up the last few rounds.

oed commented 1 year ago

@qbig @AaronGoldman interesting discussion. Can we continue in the discussion thread for this CIP? https://forum.ceramic.network/t/cip-124-recon-tip-synchronization-protocol/1144