Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coordinator Cleanup #481

Merged
merged 22 commits into from
Dec 11, 2023
Merged

Coordinator Cleanup #481

merged 22 commits into from
Dec 11, 2023

Conversation

kayabaNerve
Copy link
Member

Still a WIP, I just want to start running the CI as I work so I don't go too far in the wrong direction.

While convenient to offer an error-free implementation, it potentially caused
very long lived lock acquisitions in handle_processor_message.
Does so via adding a new file for the common code, SigningProtocol.

Modifies from_cache to return the preprocess with the machine, as there's no
reason not to. Also removes an unused Result around the type.

Clarifies the security around deterministic nonces, removing them for
saved-to-disk cached preprocesses. The cached preprocesses are encrypted as the
DB is not a proper secret store.

Moves arguments always present in the protocol from function arguments into the
struct itself.

Removes the horribly ugly code in DkgRemoval, fixing multiple issues present
with it which would cause it to fail on use.
@kayabaNerve kayabaNerve added improvement This could be better coordinator labels Dec 8, 2023
We used per-Transaction DB TXNs so on error, we don't have to rescan the entire
block yet only the rest of it. We prevented scanning multiple transactions by
tracking which we already had.

This is over-engineered and not worth it.
Fixes a bug in DkgConfirmer which would cause it to improperly handle indexes
if any validator had multiple key shares.
It didn't include the participant's own index and accordingly was offset.
This struct contains all variables prior passed to handle_block and stops them
from being passed around again and again.

This also ensures fatal_slash is only called while handling a block, as needed
as it expects to operate under perfect consensus.
Inlining accumulate makes sense due to the amount of data accumulate needed to
be passed.

Storing confirmation nonces with shares ensures that both are available or
neither. Prior, one could be yet the other may not have been (requiring an
assert in runtime to ensure we didn't bungle it somehow).
All of our transactions which use SignData end up with the same common usage
pattern for Label, justifying this.

Removes 3 transactions, explicitly de-duplicating their handlers.
This struct doesn't have any optimizations booned by the manual impl. Using
borsh reduces our scope.
serde could be used to deserialize intenrally inconsistent objects which could
lead to panics or faults.

The BorshDeserialize derives have been replaced with a manual implementation
which won't produce inconsistent objects.
@kayabaNerve
Copy link
Member Author

Will merge once CI passes.

@kayabaNerve kayabaNerve merged commit 11fdb6d into develop Dec 11, 2023
19 checks passed
@kayabaNerve kayabaNerve deleted the coordinator-cleanup branch December 11, 2023 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coordinator improvement This could be better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant