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:
Luke Parker
2023-08-13 04:32:21 -04:00
parent 13a8b0afc1
commit e2901cab06
2 changed files with 12 additions and 14 deletions

View File

@@ -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;