serai/substrate
Luke Parker 6a172825aa
Reattempts (#483)
* Schedule re-attempts and add a (not filled out) match statement to actually execute them

A comment explains the methodology. To copy it here:

"""
This is because we *always* re-attempt any protocol which had participation. That doesn't
mean we *should* re-attempt this protocol.

The alternatives were:
1) Note on-chain we completed a protocol, halting re-attempts upon 34%.
2) Vote on-chain to re-attempt a protocol.

This schema doesn't have any additional messages upon the success case (whereas
alternative #1 does) and doesn't have overhead (as alternative #2 does, sending votes and
then preprocesses. This only sends preprocesses).
"""

Any signing protocol which reaches sufficient participation will be
re-attempted until it no longer does.

* Have the Substrate scanner track DKG removals/completions for the Tributary code

* Don't keep trying to publish a participant removal if we've already set keys

* Pad out the re-attempt match a bit more

* Have CosignEvaluator reload from the DB

* Correctly schedule cosign re-attempts

* Actuall spawn new DKG removal attempts

* Use u32 for Batch ID in SubstrateSignableId, finish Batch re-attempt routing

The batch ID was an opaque [u8; 5] which also included the network, yet that's
redundant and unhelpful.

* Clarify a pair of TODOs in the coordinator

* Remove old TODO

* Final comment cleanup

* Correct usage of TARGET_BLOCK_TIME in reattempt scheduler

It's in ms and I assumed it was in s.

* Have coordinator tests drop BatchReattempts which aren't relevant yet may exist

* Bug fix and pointless oddity removal

We scheduled a re-attempt upon receiving 2/3rds of preprocesses and upon
receiving 2/3rds of shares, so any signing protocol could cause two re-attempts
(not one more).

The coordinator tests randomly generated the Batch ID since it was prior an
opaque byte array. While that didn't break the test, it was pointless and did
make the already-succeeded check before re-attempting impossible to hit.

* Add log statements, correct dead-lock in coordinator tests

* Increase pessimistic timeout on recv_message to compensate for tighter best-case timeouts

* Further bump timeout by a minute

AFAICT, GH failed by just a few seconds.

This also is worst-case in a single instance, making it fine to be decently long.

* Further further bump timeout due to lack of distinct error
2023-12-12 12:28:53 -05:00
..
abi Remove redundant fields from dex-pallet, add cargo machete ignores 2023-12-11 07:47:23 -05:00
client Reattempts (#483) 2023-12-12 12:28:53 -05:00
coins Remove redundant fields from dex-pallet, add cargo machete ignores 2023-12-11 07:47:23 -05:00
dex/pallet Remove redundant fields from dex-pallet, add cargo machete ignores 2023-12-11 07:47:23 -05:00
in-instructions Remove redundant fields from dex-pallet, add cargo machete ignores 2023-12-11 07:47:23 -05:00
node signals-primitives, plus various minor tweaks 2023-12-06 09:53:06 -05:00
primitives Move serai-client off serai-runtime, MIT licensing it 2023-12-07 02:30:09 -05:00
runtime Remove redundant fields from dex-pallet, add cargo machete ignores 2023-12-11 07:47:23 -05:00
signals Remove redundant fields from dex-pallet, add cargo machete ignores 2023-12-11 07:47:23 -05:00
validator-sets Remove redundant fields from dex-pallet, add cargo machete ignores 2023-12-11 07:47:23 -05:00