Closed mycognosist closed 3 years ago
Yes, remove previous from validateOOOBatch
that is just confusing. Great work on this PR! Very excited about this and that it has been tested to work for our specific needs.
Thanks @arj03 , really happy that it's starting to be useful. I've removed previous
from validateOOOBatch()
(much better).
This now looks good to me from an application developers perspective. I'm confortable enough with rust to review that. I'll say lets merge this.
Great, thanks arj. I imagine I'll get some feedback from Piet on the OOO Rust side of things when I open the issue on ssb-validate
(rs).
Summary:
validateOOOBatch(msgs)
validateOOOBatch(msgs)
validateOOOBatch(msgs)
Note: I'm using a fork of ssb-validate (rs) to provide the underlying OOO validation functionality.
Question(s):
validateOOOBatch()
currently takesprevious
as a second, optional argument. This is a carry-over fromvalidateBatch()
. I think maybe we should remove support forprevious
invalidateOOOBatch()
, since it seems unnecessary? Another option is to run strict validation onprevious
when it is provided, such thatmsgs[1]
must havesequence
ofmsgs[0].sequence
+ 1 and the hash ofmsgs[0]
must matchmsgs[1].previous
. I suspect this might introduce unnecessary complexity for our use-case.What do you think @arj03 ? Maybe just a simple 'validate this out-of-order batch' is good enough?
test/perf.js
I'm not entirely certain why
validateOOOBatch()
is ever-so-slightly slower.