orbit-db-store icon indicating copy to clipboard operation
orbit-db-store copied to clipboard

Filter heads by invocation of "access.canAppend" during a loading

Open pashoo2 opened this issue 4 years ago • 3 comments

https://github.com/orbitdb/orbit-db-store/blob/2ebc0c2cbec70cc98e7cd0f45edc077853098f72/src/Store.js#L241

Why don't to filter the heads as it's already implemented within the "sync" method, that is called during synchronization with another peer?

https://github.com/orbitdb/orbit-db-store/blob/2ebc0c2cbec70cc98e7cd0f45edc077853098f72/src/Store.js#L295

pashoo2 avatar Apr 02 '21 22:04 pashoo2

It seems like it could be a valuable update but I would need to know the performance tradeoff, since usually a cryptographic key verification needs to take place within canAppend.

@tabcat can you help @pashoo2 with benchmarking when you get a chance?

aphelionz avatar May 06 '21 14:05 aphelionz

Trying to understand what the change is being suggested here...

@pashoo2 you are saying we could use the same code that loads entries also to sync entries?

tabcat avatar May 07 '21 01:05 tabcat

@aphelionz @tabcat sorry i've seen the mention today. I meant that there is a code that apply filters to heads when a syncronization with another peer is performing, but i suppose it should be done also when reading heads from a local presistant storage to memory. I don't remember the exact case, but it seems not neccessary to read such heads for consistency of a local statw with another peer sync logic

pashoo2 avatar May 19 '21 19:05 pashoo2