Commit Graph

166 Commits

Author SHA1 Message Date
Luke Parker
8c51bc011d Manually step the Tendermint machine when we synced a block over the network 2022-11-13 20:26:01 -05:00
Luke Parker
138866f64d Update to the latest tendermint-machine 2022-11-13 20:19:19 -05:00
Luke Parker
2408fd8500 Correct weird formatting 2022-11-13 20:18:47 -05:00
Luke Parker
33e52ae79a Always produce notifications for finalized blocks via origin overrides 2022-11-13 19:45:16 -05:00
Luke Parker
48b4b685ca Slight doc changes
Also flattens the message handling function by replacing an if 
containing all following code in the function with an early return for 
the else case.
2022-11-13 18:33:26 -05:00
Luke Parker
0b8181b912 Remove the precommit signature hash
It cached signatures per-block. Precommit signatures are bound to each 
round. This would lead to forming invalid commits when a commit should 
be formed. Under debug, the machine would catch that and panic. On 
release, it'd have everyone who wasn't a validator fail to continue 
syncing.
2022-11-13 18:15:19 -05:00
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
ecde185bbf Correct the Duration timing
The proposer will build it, send it, then process it (on the first 
round). Accordingly, it's / 3, not / 2, as / 2 only accounted for the 
latter events.
2022-11-12 05:03:45 -05:00
Luke Parker
32ad6de00c Properly define and pass around the block size 2022-11-11 06:38:06 -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
354bcefeb0 Add notes to the runtime 2022-11-11 05:43:36 -05:00
Luke Parker
fffb7a6914 Separate the block processing time from the latency 2022-11-11 05:42:13 -05:00
Luke Parker
2411660bd8 Update to the latest substrate 2022-11-11 03:49:02 -05:00
Luke Parker
6f74bade8b Only recheck blocks with non-fatal inherent transaction errors 2022-11-11 02:17:10 -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
16a2c9a2dc Correct protocol name handling 2022-11-08 02:14:49 -05:00
Luke Parker
5dab3352f2 Move from polling loops to a pure IO model for sc_tendermint's gossip 2022-11-08 02:14:39 -05:00
Luke Parker
ea646c8984 Add missing trait 2022-11-03 00:58:45 -04:00
Luke Parker
1ff51c1a37 Add a version to sp-runtime in tendermint-machine 2022-11-03 00:24:04 -04:00
Luke Parker
2315b3c79b Localize the LibP2P protocol to the blockchain
Follows convention by doing so. Theoretically enables running multiple 
blockchains over a single LibP2P connection.
2022-11-03 00:20:50 -04:00
Luke Parker
bd08cd3c9b Add message expiry to the Tendermint gossip 2022-11-02 23:46:21 -04:00
Luke Parker
63df908d3b Rename dev to devnet
--dev still works thanks to the |. Acheieves a personal preference of 
mine with some historical meaning.
2022-11-02 23:32:52 -04:00
Luke Parker
131355b10f Correct Dave, Eve, and Ferdie to not run as validators 2022-11-02 23:31:19 -04:00
Luke Parker
cf8bdf2126 Stop returning errors on already existing blocks entirely 2022-11-02 22:52:20 -04:00
Luke Parker
de0e6724bf Remove error case which shouldn't be an error 2022-11-02 22:39:49 -04:00
Luke Parker
f4d622a34c Restore cache 2022-11-02 22:39:39 -04:00
Luke Parker
2b503b6f42 Update sc_tendermint per previous commit 2022-11-02 21:37:06 -04:00
Luke Parker
f3e177109d Reduce Arcs in TendermintMachine, split Signer from SignatureScheme 2022-11-02 21:04:26 -04:00
Luke Parker
083198ecf2 Make the dev profile a local testnet profile
Restores a dev profile which only has one validator, locally running.
2022-11-02 19:58:37 -04:00
Luke Parker
83caa8b413 Add a _ to the validator arg in slash 2022-11-02 05:03:00 -04:00
Luke Parker
40b6cb7106 Add an already in chain check to block import
While the inner should do this for us, we call verify_order on our end 
*before* inner to ensure sequential import. Accordingly, we need to 
provide our own check.

Removes errors of "non-sequential import" when trying to re-import an 
existing block.
2022-11-02 03:35:46 -04:00
Luke Parker
16065ccd4e Remove an attempt at caching I don't believe would ever hit 2022-11-02 03:29:04 -04:00
Luke Parker
ca043f55ad Use a rounded genesis to obtain sufficient synchrony within the Docker env 2022-11-02 03:05:04 -04:00
Luke Parker
38cee041d6 Fix handling of the GossipEngine 2022-11-02 02:43:08 -04:00
Luke Parker
e3fc3f28fb Configure node for a multi-node testnet 2022-11-01 23:10:36 -04:00