3

I was trying to understand the stellar code base and was looking for a place where 5 sec slot timing is hardcoded (if I am not wrong). But unable to find that, instead in ovalayManagerImpl.cpp file I found that timer elapsed at every 2 sec.

mTimer.expires_from_now(std::chrono::seconds(2));

Am I looking at incorrect file? Also, my second question is what is the rational behind the 5 sec slot timing ?

  • If I recall correctly from keybase, you found that this is the correct place. Right? – Synesso Jul 20 at 23:30
  • @Synesso this is not the correct file it seems. The ledger closing time is set from config.cpp file. look at my answer below. now I have to understand why mTimer is set to 2 sec then in OverlayManagerImpl.cpp file. – Vishwas Bhushan Jul 23 at 5:34
2

I found method which returns the expected ledger closing time,

std::chrono::seconds
Config::getExpectedLedgerCloseTime() const
{
    if (ARTIFICIALLY_SET_CLOSE_TIME_FOR_TESTING)
    {
        return std::chrono::seconds{ARTIFICIALLY_SET_CLOSE_TIME_FOR_TESTING};
    }
    if (ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING)
    {
        return std::chrono::seconds{1};
    }
    return Herder::EXP_LEDGER_TIMESPAN_SECONDS;
}

and the value for EXP_LEDGER_TIMESPAN_SECONDS is set to 5 sec - std::chrono::seconds const Herder::EXP_LEDGER_TIMESPAN_SECONDS(5);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.