The Stellar Consensus Protocol orders block candidates (via ballots) by the maximum timestamp and union of their transactions. It says that "values [transactions/ballots] with invalid timestamps will not receive enough nominations".

What makes a timestamp invalid? Is there a range relative to a node's own clock it must be in?

Do nodes sync their clocks with each other, or do they sync through other means (like NTP)?


1 Answer 1


If you look at the stellar-core codebase, under the HerderSCPDriver's validateValueHelper function, there is this code snippet:

    // Check closeTime (not too old)
    if (b.closeTime <= lastCloseTime)
        return SCPDriver::kInvalidValue;

    // Check closeTime (not too far in future)
    uint64_t timeNow = mApp.timeNow();
    if (b.closeTime > timeNow + Herder::MAX_TIME_SLIP_SECONDS.count())
        return SCPDriver::kInvalidValue;

And in herder, I see that:

std::chrono::seconds const Herder::MAX_TIME_SLIP_SECONDS(60);

So I believe if a timestamp is less than the previous close time, or the timestamp is a minute ahead (a hard coded value) then the timestamp is deemed invalid.

And to answer your second question, there is a NTP sync check. The role of this is, according to the this file:

[To] periodically check if local time is synchronized with NTP server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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