Conversation
f8b4150 to
cf90c94
Compare
topic.go
Outdated
| } | ||
|
|
||
| msg := &Message{m, "", t.p.host.ID(), pub.validatorData, pub.local} | ||
| t.p.rt.PreValidation(t.p.host.ID(), []*Message{msg}) |
There was a problem hiding this comment.
While we're working on this area, how about we rename PreValidation() to something more accurate/obvious, e.g. DispatchIDONTWANT() or even something more generic like Preprocess() or Intercept()? The spirit of the method just isn't to validate (returns nothing), and it's confusing when juxtaposed with ValidateLocal() ("what validation happens in each?").
There was a problem hiding this comment.
names, names, names 🤣
But yes, preprocessing is what it does.
There was a problem hiding this comment.
No strong opinion. Preprocess seems fine.
There was a problem hiding this comment.
Preprocess is good for me too and no strong preference about it.
The spirit of the method just isn't to validate (returns nothing), and it's confusing when juxtaposed with
ValidateLocal()("what validation happens in each?").
PreValidation isn't supposed to validate anything. It's supposed to do something before the validation. Maybe it was because of my poor English. I checked the dictionary and it said.
"To prevalidate means to validate or verify something in advance, before it is actually used or implemented"
So you're right. Prevalidate means validate.
This release contains a couple fixes and the new Batch Publishing feature. - #607 Batch Publishing. Useful if you are publishing a group of related messages at once - #612 Send IDONTWANT before initial publish. Useful when many nodes may publish the same message at once. - #609 Avoid sending an extra "IDONTWANT" to the peer that just sent you a message. - #615 10x faster rpc splitting.
See #610
We previously send IDONTWANT only when forwarding. This has us send IDONTWANT on our initial publish as well. Helps in the case that one or more peers may also publish the same thing at around the same time (see #610 for a longer explanation) and prevents "boomerang" duplicates where a peer sends you back the message you sent before you get a chance to send it to them.
This also serves as a hint to a peer that you are about to send them a certain message.