Closed blockone-syncclient closed 5 years ago
I propose something along those lines:
/v1/net/connect
or explicit config.ini
remote-peer
statements)."other_bp": latency_in_ms
. Ideally that transaction would have a different permission than active
, so you can have less important keys manage that system.This would allow a much simpler setup, would make sure the agreement doesn't need to be made off-chain and some third-party consensus algorithms implemented. It wouldn't require the latency tool to even query the blockchain, simply to push transactions. It would allow any block producer that is voted in to know the schedule directly. It wouldn't provide for schedules in advance, but we're sure we'd always have a schedule on-demand, directly on chain, perhaps starting a little stretched, but after a few minutes (with incoming latencies reports), better routes would emerge.
I would also assume that if a block producer never publishes latencies.. then it could be deemed less "capable", and potentially be downvoted.
We could monitor the published latencies, and see if one always says he's close to everyone, while everyone else says he's far.. I'd be curious to see such data.. see if one tries to trick the system.. but at the same time, if you're part of the 21, you don't really have an incentive to be first or last.. you'll be in the round in any case. Anyone sees opportunities to game such a system ?
Note that the existing P2P protocol includes time_message
that can be exchanged between any two directly connected full nodes to calculate their latency. It uses the std::chrono
timestamp format, which in all current implementations is at least 64 bits, allowing nanosecond resolution.
ok, very nice!
@jgiszczak I see that time_message
is sent .. but can it be requested ? Like in a ping/pong
fashion?
Otherwise, this would imply NTP/wall-clock to be in sync like crazy.
Has the thinking evolved on that front ? We have implemented the P2P layer in Go, so we can build a proxy that would handle pinging and signing of tx to the chain with a map of latencies.. Having a contract on-chain to handle the shuffling based on such latencies is up for grabs right now. But since it's pretty core, I'd like to let B1 decide on it..
Sending a time_message
is effectively sending a ping
. It will trigger a return time_message
any time the origin timestamp is zero.
@wanderingbort @heifner This looks like a completed or OBE issue. If I don't hear from you I will close it.
The code changed considerably from this point, so it is OBE (Overcome By Events).
Within each round the BPs need soft consensus on whose turn comes when. Solving this requires two goals be served:
The inputs to this will be the latencies between the 21 block producers with respect to each other, or, a list from each BP to the 3 - 5 other BPs that are closest, or, some other input that we find useful.
There also may need to be some 'short term memory' so we can verify that a new schedule is different from the last N recent prior schedules, where N is probably 5 to 25.
This can be implemented by a daemon separate from the 'eosiod' - it would do something like this:
Something like the above should work.