Commit Graph

9 Commits

Author SHA1 Message Date
Luke Parker
a7f4804749 Move Commit from including the round to including the round's end_time
The round was usable to build the current clock in an accumulated 
fashion, relative to the previous round. The end time is the absolute 
metric of it, which can be used to calculate the round number (with all 
previous end times).

Substrate now builds off the best block, not genesis, using the end time 
included in the justification to start its machine in a synchronized 
state.

Knowing the end time of a round, or the round in which block was 
committed to, is necessary for nodes to sync up with Tendermint. 
Encoding it in the commit ensures it's long lasting and makes it readily 
available, without the load of an entire transaction.
2022-10-24 05:28:21 -04:00
Luke Parker
78fa292230 Expand sanity checks
Substrate doesn't expect nor officially support children with less work 
than their parents. It's a trick used here. Accordingly, ensure the 
trick's validity.
2022-10-24 04:43:59 -04:00
Luke Parker
b6dddc469f Consolidate C and I generics into a TendermintClient trait alias 2022-10-24 04:43:25 -04:00
Luke Parker
e8e490de1e Add an assert to verify proposed children aren't best 2022-10-22 07:57:30 -04:00
Luke Parker
8a682cd25c Announce blocks
By claiming File, they're not sent ovber the P2P network before they 
have a justification, as desired. Unfortunately, they never were. This 
works around that.
2022-10-22 07:36:13 -04:00
Luke Parker
dee6993ac8 Correct justication import pipeline
Removes JustificationImport as it should never be used.
2022-10-22 06:24:39 -04:00
Luke Parker
4206ed3b18 Don't import justifications multiple times
Also don't broadcast blocks which were solely proposed.
2022-10-22 04:39:27 -04:00
Luke Parker
9b0dca06d0 Provide a way to create the machine
The BasicQueue returned obscures the TendermintImport struct. 
Accordingly, a Future scoped with access is returned upwards, which when 
awaited will create the machine. This makes creating the machine 
optional while maintaining scope boundaries.

Is sufficient to create a 1-node net which produces and finalizes 
blocks.
2022-10-22 03:41:49 -04:00
Luke Parker
39984bd07b Split import_queue into a series of files 2022-10-22 02:15:22 -04:00