Commit graph

75 commits

Author SHA1 Message Date
Luke Parker
c9334ee694
Merge branch 'develop' into tendermint 2022-11-11 02:18:05 -05:00
Luke Parker
3d9b9b178c
Zeroizing allocator (#154)
* Add a zeroizing allocator

* Also implement the allocator API

* Add misisng license file to zalloc

* Slight change to zalloc description
2022-11-10 23:34:40 -06:00
Luke Parker
7334ed1f43
cargo update
Updates Substrate to polkadot-v0.9.33
2022-11-10 23:59:20 -05:00
Luke Parker
84de427d72
Fix https://github.com/serai-dex/serai/issues/150 2022-11-10 22:35:09 -05:00
Luke Parker
56a21ca6a6
Use futures mpsc instead of tokio 2022-11-08 21:14:03 -05:00
Luke Parker
d714f2202d
Document multiexp
Bumps the crate version to enable publishing.
2022-11-07 18:31:20 -05:00
Luke Parker
8de465af87
Have Transcript::append_message take in AsRef<[u8]>, not &[u8]
Simplifies calling it.
2022-11-05 18:43:36 -04:00
Luke Parker
c31a55cce0
cargo update (tendermint) 2022-11-04 08:08:16 -04:00
Luke Parker
55e32e24d1
Merge branch 'develop' into tendermint 2022-11-04 08:08:00 -04:00
Luke Parker
65df18d285
cargo update 2022-11-04 08:07:37 -04:00
Luke Parker
953bece2ea
Bump Substrate dependency
Fixes #147.
2022-11-04 08:07:12 -04:00
Luke Parker
af63c3e5d2
Bump Substrate dependency
Fixes #147.
2022-11-04 07:54:18 -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
e3fc3f28fb
Configure node for a multi-node testnet 2022-11-01 23:10:36 -04:00
Luke Parker
5832007a45
Take in a Keystore and validator ID 2022-11-01 20:06:42 -04:00
Luke Parker
aa0a4cf106
Implement proper checking of inherents 2022-11-01 16:37:50 -04:00
Luke Parker
91ae2b7112
Move serai_runtime specific code from tendermint/client to node
Renames serai-consensus to sc_tendermint
2022-10-30 10:54:17 -04:00
Luke Parker
3d7c12adcd
Create a dedicated file for being a Tendermint authority 2022-10-30 10:08:35 -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
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
aec36377c0
Merge branch 'develop' into tendermint 2022-10-29 05:10:21 -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
5c08fa9701
TendermintApi, compilation fixes 2022-10-27 08:44:53 -04:00
Luke Parker
4c2dd9b306
Partial work on correcting pallet calls 2022-10-27 06:29:56 -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
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
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
bf5bdb89c2
Implement block proposal logic 2022-10-21 23:36:24 -04:00
Luke Parker
e8df74e295
Merge branch 'develop' into tendermint 2022-10-21 22:02:45 -04:00
Luke Parker
b72af5e185
cargo update
The new ink release should enable using the latest Rust nightly, without 
issue.
2022-10-21 21:40:50 -04:00
Luke Parker
976948e9d9
Update Cargo.tomls for substrate packages 2022-10-21 03:17:02 -04:00
Luke Parker
5c46edbe98
Implement tendermint_machine::Block for Substrate Blocks
Unfortunately, this immediately makes Tendermint machine capable of 
deployment as  crate since it uses a git reference. In the future, a 
Cargo.toml patch section for serai/substrate should be investigated. 
This is being done regardless as it's the quickest way forward and this 
is for Serai.
2022-10-21 02:06:48 -04:00
Luke Parker
eb59dd5a55
Initial work on an import queue 2022-10-20 03:50:06 -04:00
Luke Parker
cc8284ad40
Merge branch 'develop' into tendermint 2022-10-20 01:34:59 -04:00
Luke Parker
6c996fb3cd
Update substrate
Also removes the patch for zip since a new release was issued.

Closes https://github.com/serai-dex/serai/issues/81.

Contracts RPC purged as according to 
https://github.com/paritytech/substrate/pull/12358.
2022-10-20 01:05:36 -04:00
Luke Parker
6b56510da9
Remove async recursion
Greatly increases safety as well by ensuring only one message is 
processed at once.
2022-10-17 12:04:59 -04:00
Luke Parker
ec7d8ac67b
Remove coin crate
Effective reversion of past few commits by request.
2022-10-16 13:11:32 -04:00
Luke Parker
987aa5189a
Implement serialization via parity's scale codec
Ideally, this would be generic. Unfortunately, the generic API serde 
doesn't natively support borsh, nor SCALE, and while there is a serde 
SCALE crate, it's old. While it may be complete, it's not worth working 
with.

While we could still grab bincode, and a variety of other formats, it 
wasn't worth it to go custom and for Serai, we'll be using SCALE almost 
everywhere anyways.
2022-10-16 10:06:27 -04:00
Luke Parker
77ba1c00e2
Successfully compiling 2022-10-16 07:30:11 -04:00
Luke Parker
a5f1ddaf1b
Refactor out external parts to generics
Also creates a dedicated file for the message log.
2022-10-16 03:29:55 -04:00
Luke Parker
65664dafa4
Make coin a dedicated library
Closes https://github.com/serai-dex/serai/issues/128.
2022-10-15 23:21:56 -04:00
Luke Parker
a0a54eb0de
Update to FROST v11
Ensures random functions never return zero. This, combined with a check 
commitments aren't 0, causes no serialized elements to be 0.

Also directly reads their vectors.
2022-10-13 00:38:36 -04:00
Luke Parker
482a8ec209
Update to the latest Serai Substrate (#125)
* Update to the latest Serai Substrate

* Add Protobuf to build dependencies

Docker shouldn't need updating as this should've been added to the image 
in 
2dbace5b01.

* Get substrate to build

* Correct protoc build step

* Remove the benchmarking code

There's some macro resolution error that isn't apparent. I worked on it 
for about half an hour but...

* Remove unnecessary clone

* Correct runtime-benchmarks flag usage
2022-09-29 13:33:09 -05:00
Luke Parker
503ae02cae
Version bump monero-generators to consolidate a dependency 2022-09-29 10:36:40 -04:00
Luke Parker
695f7ec5f9
Version bump Monero for documentation purposes 2022-09-29 10:35:11 -04:00
Luke Parker
8da0743361
Use sha3 in monero-generators 2022-09-29 08:08:49 -04:00