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

refactor(multisig)!: move from triggers to custom instructions #5217

Merged

Conversation

s8sato
Copy link
Contributor

@s8sato s8sato commented Nov 2, 2024

Context

  1. Calling a trigger with args as a multisig operation was not a clear interface
  2. The multisig implementation as triggers introduced validation exceptions for registering and executing triggers to bridge the authority gap between the caller and the executor: feat: improve multisig utility and usability #5027

Solution

  1. Assign dedicated custom instructions to the multisig operations
  2. Switch to the executor context and package validation and execution logics as the custom instructions
  • As a side benefit of removing triggers i.e. no event pools, recursive approvals immediately propagate without ticking time

Migration Guide

  • Introduces MultisigRegister MultisigPropose MultisigApprove custom instructions that replace MultisigAccountArgs MultisigTransactionsArgs
  • Removes CanRegisterAnyTrigger CanUnregisterAnyTrigger permissions that become useless and are unlikely to be used
  • Though it becomes useless for multisig, retains the capability to register wasm triggers in genesis

Future Work


Checklist

  • I've read CONTRIBUTING.md.
  • All review comments have been resolved.
  • All CI checks pass.

@github-actions github-actions bot added api-changes Changes in the API for client libraries config-changes Changes in configuration and start up of the Iroha labels Nov 2, 2024
Copy link

github-actions bot commented Nov 2, 2024

@BAStos525

@s8sato s8sato force-pushed the refactor/4930/custom_instructions branch from e8e1316 to a6b0dce Compare November 2, 2024 21:39
wasm/libs/default_executor/src/lib.rs Outdated Show resolved Hide resolved
wasm/libs/default_executor/src/multisig/account.rs Outdated Show resolved Hide resolved
@s8sato s8sato self-assigned this Nov 2, 2024
@s8sato s8sato marked this pull request as ready for review November 2, 2024 22:11
@s8sato s8sato enabled auto-merge (squash) November 2, 2024 22:13
Copy link
Contributor

@mversic mversic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing stuff, so much better

crates/iroha_executor/src/default.rs Outdated Show resolved Hide resolved
crates/iroha_executor/src/lib.rs Outdated Show resolved Hide resolved
crates/iroha_multisig_data_model/src/lib.rs Outdated Show resolved Hide resolved
crates/iroha_multisig_data_model/src/lib.rs Outdated Show resolved Hide resolved
crates/iroha_multisig_data_model/src/lib.rs Outdated Show resolved Hide resolved
crates/iroha_telemetry_derive/Cargo.toml Outdated Show resolved Hide resolved
defaults/genesis.json Outdated Show resolved Hide resolved
crates/iroha_multisig_data_model/src/lib.rs Outdated Show resolved Hide resolved
crates/iroha/tests/multisig.rs Outdated Show resolved Hide resolved
crates/iroha_multisig_data_model/src/lib.rs Outdated Show resolved Hide resolved
@s8sato s8sato force-pushed the refactor/4930/custom_instructions branch from 5b0dbeb to 4e4a6b9 Compare November 4, 2024 07:14
@s8sato
Copy link
Contributor Author

s8sato commented Nov 4, 2024

Self-reviewed and made fixes 4e4a6b9 0e4fc3a for now. I'm going to address your comments tomorrow @mversic

@s8sato s8sato force-pushed the refactor/4930/custom_instructions branch 2 times, most recently from 48753cb to 0e4fc3a Compare November 4, 2024 10:42
BREAKING CHANGES:

- (api-changes) `MultisigRegister` `MultisigPropose` `MultisigApprove` custom instructions

Signed-off-by: Shunkichi Sato <[email protected]>
Signed-off-by: Shunkichi Sato <[email protected]>
Signed-off-by: Shunkichi Sato <[email protected]>
@s8sato s8sato force-pushed the refactor/4930/custom_instructions branch from f3eae2c to bd20861 Compare November 8, 2024 14:49
@s8sato
Copy link
Contributor Author

s8sato commented Nov 11, 2024

Updates:

  • (partially) dedup and delegate MultisigApprove validation to execution

Left to next PR: #4930 (comment)

@s8sato s8sato force-pushed the refactor/4930/custom_instructions branch from 8ff9018 to 35b3865 Compare November 11, 2024 17:57
@DCNick3 DCNick3 self-assigned this Nov 12, 2024
@s8sato s8sato mentioned this pull request Nov 13, 2024
mversic
mversic previously approved these changes Nov 14, 2024
@s8sato
Copy link
Contributor Author

s8sato commented Nov 15, 2024

@s8sato s8sato force-pushed the refactor/4930/custom_instructions branch from 0306c05 to 6eac0f6 Compare November 15, 2024 04:24
@mversic mversic self-requested a review November 15, 2024 07:17
Copy link
Contributor

@DCNick3 DCNick3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only minor comments, otherwise LGTM

crates/iroha/tests/multisig.rs Show resolved Hide resolved
crates/iroha_executor/src/default/mod.rs Show resolved Hide resolved
@s8sato s8sato merged commit 8c80c83 into hyperledger-iroha:main Nov 18, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-changes Changes in the API for client libraries config-changes Changes in configuration and start up of the Iroha
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants