Onion services startup time always gets revealed
Due to dead code in rend_consider_services_upload()
startup time of onion services always gets revealed.
If service descriptor is not uploaded yet we add random delay from [rendinitialpostdelay;rendinitialpostdelay+rand(2*rendpostperiod)] ( [30s;30s+2h] ):
if (!service->next_upload_time) {
service->next_upload_time =
now + rendinitialpostdelay + crypto_rand_int(2*rendpostperiod);
But this delay is useless when we're checking whether we should upload:
if (intro_points_ready &&
(service->next_upload_time < now ||
(service->desc_is_dirty &&
service->desc_is_dirty < now-rendinitialpostdelay))) {
/* Upload */
Because descriptor is dirty for never-yet-uploaded services it always gets uploaded after being stable for rendinitialpostdelay
seconds. next_upload_time
is further in future than rendinitialpostdelay
stabilization stuff.
So it goes.
I made a patch to unbork this function to work properly.
But it raised a problem. We got used to expect that descriptors are going to be uploaded pretty soon. But 'now' they will be uploaded with delay up to 2h. That's not okay. Should we make a torrc
option like RevealOnionServiceStartupTime
that defaults to 1?