Commit graph

482 commits

Author SHA1 Message Date
Luke Parker
edb2e00db7
Remove the Future triggering the machine for an async fn
Enables passing data in, such as the network.
2022-10-30 04:08:33 -04:00
Luke Parker
6838d5c922
Clean generics in Tendermint with a monolith with associated types 2022-10-30 03:26:31 -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
f31c457c2c
Merge branch 'develop' into tendermint 2022-10-29 06:02:00 -04:00
Luke Parker
aa4b5e2ca3
Update Cargo.lock 2022-10-29 06:01:32 -04:00
Luke Parker
a0c892dfc3
Use the validators list from the session pallet 2022-10-29 06:00:58 -04:00
Luke Parker
c4c3dcd8f2
Merge branch 'develop' into tendermint 2022-10-29 05:53:40 -04:00
Luke Parker
6ef624ab7e
Correct monero's dev dependencies 2022-10-29 05:52:56 -04:00
Luke Parker
b17aac46ed
Merge branch 'develop' into tendermint 2022-10-29 05:29:52 -04:00
Luke Parker
e67e406d95
Correct ed448 versioning 2022-10-29 05:25:58 -04:00
Luke Parker
43e38e463f
Update FROST version 2022-10-29 05:14:29 -04:00
Luke Parker
1464eefbe3
Correct dleq's zeroize dependency 2022-10-29 05:13:20 -04:00
Luke Parker
aec36377c0
Merge branch 'develop' into tendermint 2022-10-29 05:10:21 -04:00
Luke Parker
6eaed17952
Inline FROST processing functions into the machines' impls
This was done for the DKG and this similarly cleans up here.
2022-10-29 05:10:07 -04:00
Luke Parker
2379855b31
Create a dedicated crate for the DKG (#141)
* Add dkg crate

* Remove F_len and G_len

They're generally no longer used.

* Replace hash_to_vec with a provided method around associated type H: Digest

Part of trying to minimize this trait so it can be moved elsewhere. Vec, 
which isn't std, may have been a blocker.

* Encrypt secret shares within the FROST library

Reduces requirements on callers in order to be correct.

* Update usage of Zeroize within FROST

* Inline functions in key_gen

There was no reason to have them separated as they were. sign probably 
has the same statement available, yet that isn't the focus right now.

* Add a ciphersuite package which provides hash_to_F

* Set the Ciphersuite version to something valid

* Have ed448 export Scalar/FieldElement/Point at the top level

* Move FROST over to Ciphersuite

* Correct usage of ff in ciphersuite

* Correct documentation handling

* Move Schnorr signatures to their own crate

* Remove unused feature from schnorr

* Fix Schnorr tests

* Split DKG into a separate crate

* Add serialize to Commitments and SecretShare

Helper for buf = vec![]; .write(buf).unwrap(); buf

* Move FROST over to the new dkg crate

* Update Monero lib to latest FROST

* Correct ethereum's usage of features

* Add serialize to GeneratorProof

* Add serialize helper function to FROST

* Rename AddendumSerialize to WriteAddendum

* Update processor

* Slight fix to processor
2022-10-29 03:54:42 -05:00
Luke Parker
f91c081f30
Fix the stub round robin
At some point, the modulus was removed causing it to exceed the 
validators list and stop proposing.
2022-10-27 08:49:36 -04:00
Luke Parker
5c08fa9701
TendermintApi, compilation fixes 2022-10-27 08:44:53 -04:00
Luke Parker
66f7663cb2
Redo Tendermint folder structure 2022-10-27 06:33:58 -04:00
Luke Parker
4c2dd9b306
Partial work on correcting pallet calls 2022-10-27 06:29:56 -04:00
Luke Parker
eb418448eb
Update support URL 2022-10-27 05:45:55 -04:00
Luke Parker
fa7a03bf60
Update node to use pallet sessions 2022-10-27 05:23:53 -04:00
Luke Parker
49ab26209d
Add pallet sessions to runtime, create pallet-tendermint 2022-10-27 05:05:41 -04:00
Luke Parker
cbceaff678
Create dedicated message structures for FROST messages (#140)
* Create message types for FROST key gen

Taking in reader borrows absolutely wasn't feasible. Now, proper types
which can be read (and then passed directly, without a mutable borrow)
exist for key_gen. sign coming next.

* Move FROST signing to messages, not Readers/Writers/Vec<u8>

Also takes the nonce handling code and makes a dedicated file for it, 
aiming to resolve complex types and make the code more legible by 
replacing its previously inlined state.

* clippy

* Update FROST tests

* read_signature_share

* Update the Monero library to the new FROST packages

* Update processor to latest FROST

* Tweaks to terminology and documentation
2022-10-25 23:17:25 -05:00
Luke Parker
285152b6e2
Merge weights and signing scheme into validators, documenting needed changes 2022-10-25 02:51:33 -04:00
Luke Parker
5839f44290
Clean up lock acquisition 2022-10-25 02:45:20 -04:00
TheArchitect108
ccdb834e6e
fixes caching issues (#139)
* fixes caching issues

* update comment
2022-10-24 23:48:11 -05:00
Luke Parker
9b8f2f4487
More misc bug fixes 2022-10-24 06:18:16 -04:00
Luke Parker
05be5c14c3
Misc bug fixes 2022-10-24 05:52:40 -04:00
Luke Parker
b5cb8a9be2
Add a TODO on Tendermint 2022-10-24 05:37:43 -04:00
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
b9c091c5d0
When resetting, use the end time of the round which was committed to
The machine reset to the end time of the current round. For a delayed 
network connection, a machine may move ahead in rounds and only later 
realize a prior round succeeded. Despite acknowledging that round's 
success, it would maintain its delay when moving to the next block, 
bricking it.

Done by tracking the end time for each round as they occur.
2022-10-24 04:48:17 -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
4859e8c27e
Merge branch 'develop' into tendermint 2022-10-23 21:01:39 -04:00
Luke Parker
42a711ee51
Replace the Serai scripts volume for directly copying the files
This should probably be done for the other images as well.
2022-10-23 21:01:11 -04:00
Luke Parker
7ecf8b22cf
Mark all sh files as executable 2022-10-23 20:39:37 -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
Luke Parker
193281e387
Get the result of block importing 2022-10-22 01:43:07 -04:00
Luke Parker
8ed0f1f1cf
Trigger block importing
Doesn't wait for the response yet, which it needs to.
2022-10-22 00:48:09 -04:00
Luke Parker
5e52817dcd
Modularize to get_proposal 2022-10-22 00:47:38 -04:00
Luke Parker
bf5bdb89c2
Implement block proposal logic 2022-10-21 23:36:24 -04:00
Luke Parker
adfc9a5d1d
Merge branch 'develop' into tendermint 2022-10-21 22:33:41 -04:00
GitHub Actions
595b2da433 Update nightly 2022-10-21 21:26:27 -05:00
Luke Parker
a03a04bcc6
Simplify monthly nightly update workflow 2022-10-21 22:25:32 -04:00