rippled
|
Manages various times used by the server. More...
Public Types | |
using | rep = typename NetClock ::rep |
using | period = typename NetClock ::period |
using | duration = typename NetClock ::duration |
using | time_point = typename NetClock ::time_point |
using | clock_type = NetClock |
Public Member Functions | |
virtual | ~TimeKeeper ()=default |
virtual void | run (std::vector< std::string > const &servers)=0 |
Launch the internal thread. More... | |
virtual time_point | now () const override=0 |
Returns the estimate of wall time, in network time. More... | |
virtual time_point | closeTime () const =0 |
Returns the close time, in network time. More... | |
virtual void | adjustCloseTime (std::chrono::duration< std::int32_t > amount)=0 |
Adjust the close time. More... | |
virtual std::chrono::duration< std::int32_t > | nowOffset () const =0 |
virtual std::chrono::duration< std::int32_t > | closeOffset () const =0 |
virtual time_point | now () const=0 |
Returns the current time. More... | |
Static Public Attributes | |
static const bool | is_steady |
Manages various times used by the server.
Definition at line 32 of file TimeKeeper.h.
|
inherited |
Definition at line 60 of file abstract_clock.h.
|
inherited |
Definition at line 61 of file abstract_clock.h.
|
inherited |
Definition at line 62 of file abstract_clock.h.
|
inherited |
Definition at line 63 of file abstract_clock.h.
|
inherited |
Definition at line 64 of file abstract_clock.h.
|
virtualdefault |
|
pure virtual |
Launch the internal thread.
The internal thread synchronizes local network time using the provided list of SNTP servers.
Implemented in ripple::TimeKeeperImpl, and ripple::test::ManualTimeKeeper.
|
overridepure virtual |
Returns the estimate of wall time, in network time.
The network time is wall time adjusted for the Ripple epoch, the beginning of January 1st, 2000 UTC. Each server can compute a different value for network time. Other servers value for network time is not directly observable, but good guesses can be made by looking at validators' positions on close times.
Servers compute network time by adjusting a local wall clock using SNTP and then adjusting for the epoch.
Implemented in ripple::TimeKeeperImpl, and ripple::test::ManualTimeKeeper.
|
pure virtual |
Returns the close time, in network time.
Close time is the time the network would agree that a ledger closed, if a ledger closed right now.
The close time represents the notional "center" of the network. Each server assumes its clock is correct, and tries to pull the close time towards its measure of network time.
Implemented in ripple::TimeKeeperImpl, and ripple::test::ManualTimeKeeper.
|
pure virtual |
Adjust the close time.
This is called in response to received validations.
Implemented in ripple::TimeKeeperImpl, and ripple::test::ManualTimeKeeper.
|
pure virtual |
Implemented in ripple::TimeKeeperImpl, and ripple::test::ManualTimeKeeper.
|
pure virtual |
Implemented in ripple::TimeKeeperImpl, and ripple::test::ManualTimeKeeper.
|
pure virtualinherited |
Returns the current time.
|
staticinherited |
Definition at line 66 of file abstract_clock.h.