Commit Graph

26 Commits

Author SHA1 Message Date
Luke Parker
b7502a7f67 Have verify_precommit_signature return if it verified the signature
Also fixes a bug where invalid precommit signatures were left standing 
and therefore contributing to commits.
2022-11-13 18:11:58 -05:00
Luke Parker
c13e0c75ae Move more code into block.rs
Introduces type-aliases to obtain Data/Message/SignedMessage solely from 
a Network object.

Fixes a bug regarding stepping when you're not an active validator.
2022-11-13 18:11:09 -05:00
Luke Parker
4ba469e653 BlockData::new 2022-11-12 11:52:55 -05:00
Luke Parker
2de4ab8c9d Clear the Queue instead of draining and filtering
There shouldn't ever be a message which passes the filter under the 
current design.
2022-11-12 11:46:32 -05:00
Luke Parker
850878330e Move Round to an Option due to the pseudo-uninitialized state we create
Before the addition of RoundData, we always created the round, and on 
.round(0), simply created it again. With RoundData, and the changes to 
the time code, we used round 0, time 0, the latter being incorrect yet 
not an issue due to lack of misuse.

Now, if we do misuse it, it'll panic.
2022-11-12 11:45:09 -05:00
Luke Parker
b7b57ee6dc Move BlockData to a new file 2022-11-12 11:42:40 -05:00
Luke Parker
2f3bb88744 Rename Round to RoundNumber 2022-11-12 10:52:39 -05:00
Luke Parker
9e72f8737e BlockData and RoundData structs 2022-11-12 10:41:09 -05:00
Luke Parker
e2e7a70f1e Clean up time code in tendermint-machine 2022-11-12 07:12:05 -05:00
Luke Parker
b53759c6ec Have the machine respond to advances made by an external sync loop 2022-11-12 05:35:41 -05:00
Luke Parker
ca3a29f616 Correct time-adjustment code on round skip 2022-11-12 05:12:20 -05:00
Luke Parker
43b43bdbd9 Support running TendermintMachine when not a validator
This supports validators who leave the current set, without crashing 
their nodes, along with nodes trying to become validators (who will now 
seamlessly transition in).
2022-11-11 06:04:37 -05:00
Luke Parker
dbcddb2fb0 Don't spam slash
Also adds a slash condition of failing to propose.
2022-11-11 05:53:20 -05:00
Luke Parker
fffb7a6914 Separate the block processing time from the latency 2022-11-11 05:42:13 -05:00
Luke Parker
7d46daa36e Use futures pin instead of tokio 2022-11-08 22:56:46 -05:00
Luke Parker
f7b1ff9f3b Update Substrate to the new TendermintHandle 2022-11-08 22:51:31 -05:00
Luke Parker
1c8192218a Move from a yielding loop to select in tendermint-machine 2022-11-08 22:37:06 -05:00
Luke Parker
2cb1d35d89 Timeout futures 2022-11-08 21:14:57 -05:00
Luke Parker
56a21ca6a6 Use futures mpsc instead of tokio 2022-11-08 21:14:03 -05:00
Luke Parker
f3e177109d Reduce Arcs in TendermintMachine, split Signer from SignatureScheme 2022-11-02 21:04:26 -04:00
Luke Parker
2947ef08e3 Make sign asynchronous
Some relation to https://github.com/serai-dex/serai/issues/95.
2022-11-01 15:10:50 -04:00
Luke Parker
aee0bde45d Connect broadcast 2022-10-30 05:37:23 -04:00
Luke Parker
1af6117155 Move TendermintMachine from start_num, time to last_num, time
Provides an explicitly clear API clearer to program around.

Also adds additional time code to handle an edge case.
2022-10-30 04:27:15 -04:00
Luke Parker
8d3efd6259 Correct Substrate Tendermint start block
The Tendermint machine uses the passed in number as the block's being 
worked on number. Substrate passed in the already finalized block's 
number.

Also updates misc comments.
2022-10-30 01:22:11 -04:00
Luke Parker
9a54317743 Basic Gossip Validator 2022-10-30 01:21:10 -04:00
Luke Parker
66f7663cb2 Redo Tendermint folder structure 2022-10-27 06:33:58 -04:00