#orly #devstr #progressreport
took me a while because i didn't realise i wasn't setting the damn correct environment variables, but now the replicas add a chain of pubkeys of replicas that sent, so first one to send to a replica adds its key, and then the second one decodes that and then adds its own when it sends it to another replica, and it skips the relay that has the keys that it received in the header.
much simpler to do than if i had been building this with the websockets.
anyway, that's why i wrote that test message, i didn't spot the error in the environment config and was wondering why it wasn't authing. yeah, because the replica wasn't registered as authorized as a replica so not being on the follow list it was rejecting the event.
now fixed.
by having the replicas chain the keys of each replica that forwarded the event in a chain, it reduces the number of messages to N*2-1 where N is the number of replicas. so for 3, A sends to B and C, and both B and C know not to send it back to A, but B sends to C, and C sends to B. so, this results in 4 messages. if they didn't track the path of replication, B and C would both also send to A.
this gets worse with 4, with 4, A sends to B, C and D, then without this path, all of them send 4 messages, with this, they send, and then another two, and then one.
the usual solution in epidemic propagation is the source only replicates to two points, and this with a chain of senders would make it so there is even less, but it's less reliable, it's better to send too many than not cover every one.
but probably i should be just doing epidemic pattern so what it does is if it fails a send, it tries another one, and then if that other one was still connected by other replicas it will get through.
gonna think it through a bit more. probably can just have it go through and stop when it gets one, and let the chain do its magic, but arranging the tests will be a bit of work. have to spin up 4 replicas to test 4, and 6 to test 6, etc. but for now at least it's fine for maybe up to 5 to not do absurd amounts of resends, each subsequent cycle has one less so ...
haha. damn, i probably better fix this now. if the send fails it registers an error, i think, so i think i can depend on that and just have try until it gets one and then stop, and let the others handle the forwarding. then it should theoretically follow a snaky path through the replicas to reach everyone even if paths in the mesh are broken.