mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 04:09:23 +00:00
Only emit SignTranaction once
Due to the ordered message-queue, there's no benefit to multiple emissions as there's no risk a completion will be missed. If it has yet to be read, sending another which only be read after isn't helpful. Simplifies code a decent bit.
This commit is contained in:
@@ -79,12 +79,18 @@ When the `t` validators who first published `SignPreprocess` transactions have
|
||||
published `SignShare` transactions, a `sign::ProcessorMessage::Shares` with the
|
||||
relevant shares is sent to the processor.
|
||||
|
||||
### Sign Completed
|
||||
|
||||
`SignCompleted` is created when a processor sends the coordinator
|
||||
`sign::ProcessorMessage::Completed`. As soon as 34% of validators send
|
||||
`Completed`, the signing protocol is no longer further attempted.
|
||||
|
||||
## Re-attempts
|
||||
|
||||
The key generation and signing protocols, whether batch or transaction, may
|
||||
fail if a validator goes offline or takes too long to respond. Accordingly,
|
||||
the tributary will schedule re-attempts. These are communicated with
|
||||
`key_gen::CoordinatorMessage::GenerateKey`,
|
||||
Key generation protocols may fail if a validator is malicious. Signing
|
||||
protocols, whether batch or transaction, may fail if a validator goes offline or
|
||||
takes too long to respond. Accordingly, the tributary will schedule re-attempts.
|
||||
These are communicated with `key_gen::CoordinatorMessage::GenerateKey`,
|
||||
`coordinator::CoordinatorMessage::BatchReattempt`, and
|
||||
`sign::CoordinatorMessage::Reattempt`.
|
||||
|
||||
|
||||
@@ -101,18 +101,20 @@ On `sign::CoordinatorMessage::Shares`, the processor completes the specified
|
||||
transaction signing protocol. If successful, the processor stops signing for
|
||||
this transaction and publishes the signed transaction. Then,
|
||||
`sign::ProcessorMessage::Completed` is sent to the coordinator, to be
|
||||
broadcasted to all validators so everyone can observe the transaction was
|
||||
signed and stop locally attempting to do so.
|
||||
broadcasted to all validators so everyone can observe the attempt completed,
|
||||
producing a signed and published transaction.
|
||||
|
||||
## Sign Re-attempt
|
||||
|
||||
On `sign::CoordinatorMessage::Reattempt`, the processor will create a new
|
||||
a new instance of the transaction signing protocol. The new protocol's
|
||||
preprocess is sent to the coordinator in a `sign::ProcessorMessage::Preprocess`.
|
||||
a new instance of the transaction signing protocol if it hasn't already
|
||||
completed/observed completion of an instance of the signing protocol. The new
|
||||
protocol's preprocess is sent to the coordinator in a
|
||||
`sign::ProcessorMessage::Preprocess`.
|
||||
|
||||
## Sign Completed
|
||||
|
||||
On `sign::CoordinatorMessage::Completed`, the processor verifies the included
|
||||
transaction hash actually refers to an accepted transaction which completes the
|
||||
plan it was supposed to. If so, the processor stops locally signing for the
|
||||
transaction, and emits `sign::ProcessorMessage::Completed`.
|
||||
transaction, and emits `sign::ProcessorMessage::Completed` if it hasn't prior.
|
||||
|
||||
Reference in New Issue
Block a user