mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Revert round-advance on TendermintMachine::new if local clock is ahead of block start
It was improperly implemented, as it assumed rounds had a constant time interval, which they do not. It also is against the spec and was meant to absolve us of issues with poor performance when post-starting blockchains. The new, and much more proper, workaround for the latter is a 120-second delay between the Substrate time and the Tributary start time.
This commit is contained in:
@@ -77,7 +77,8 @@ async fn handle_new_set<
|
||||
// Since this block is in the past, and Tendermint doesn't play nice with starting chains after
|
||||
// their start time (though it does eventually work), delay the start time by 120 seconds
|
||||
// This is meant to handle ~20 blocks of lack of finalization for this first block
|
||||
let time = time + 120;
|
||||
const SUBSTRATE_TO_TRIBUTARY_TIME_DELAY: u64 = 120;
|
||||
let time = time + SUBSTRATE_TO_TRIBUTARY_TIME_DELAY;
|
||||
|
||||
let spec = TributarySpec::new(block.hash(), time, set, set_data);
|
||||
create_new_tributary(db, spec.clone()).await;
|
||||
|
||||
Reference in New Issue
Block a user