feat(mpc-contract): cancel_node_migration() function in contract - #3886
feat(mpc-contract): cancel_node_migration() function in contract#3886metalurgical wants to merge 10 commits into
Conversation
e35f9ab to
b604303
Compare
Implement cancel_node_migration() function in contract, which clears the ongoing migration record. Add tests. Update migration-service documentation.
9fd348c to
d702b6d
Compare
kevindeforth
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
Please avoid LLM-generated code-comments.
The unit-test in the contract can be improved by using existing test-helpers.
|
Hmm, see refactors have merged ahead of this one, will update it in a short while. |
|
@gilcu3 Updated |
|
@claude review |
Pull request overviewAdds a Changes:
Reviewed changesPer-file summary
FindingsBlocking (must fix before merge):
Non-blocking (nits, follow-ups, suggestions):
|
|
@metalurgical could you check the blocking points by Claude above? Once those are fixed I am ready to approve |
| .await | ||
| } | ||
|
|
||
| pub async fn cancel_node_migration( |
There was a problem hiding this comment.
oh yeah, claude might have pointed it out already, but this should be added to the mpc_contract_handle__should_match_the_wire_format_catalog test
|
|
||
| Note that starting a migration workflow does not require a signing quorum. Instead, each participant can migrate their node at their own discretion. However, to avoid making the migration process a DoS attack vector, protocol state changes must have priority over any ongoing migrations. | ||
| If the protocol state changes into a `Resharing` or `Initializing` state, any ongoing migration processes will simply be cancelled. | ||
| If the protocol state changes into a `Resharing` or `Initializing` state, the pending `OngoingNodeMigration` record itself is **not** cleared by the transition and remains unless the operator explicitly withdraws it with `cancel_node_migration` or starts a new migration which will replace it. |
There was a problem hiding this comment.
It wold be good to add a sentence that explains why this is ok:
a node concluding the migration sends its keyset to the contract, which includes the epoch id and all public keys. The contract compares that against the current epoch and keyset. The transaction will fail in case there is a discrepancy.
Implement cancel_node_migration() function in contract, which clears the ongoing migration record.
Add tests.
Update migration-service documentation.
Related to #3774