Skip to content

Commit

Permalink
feat: improve multisig utility and usability
Browse files Browse the repository at this point in the history
BREAKING CHANGES:

- (api-changes) `CanRegisterAnyTrigger` `CanUnregisterAnyTrigger` permissions for internal operations only
- (api-changes) `GenesisWasmTrigger` under `RawGenesisTransaction` for `genesis.json` readability
- (api-changes) `Multisig*Args` attached to multi-signature operations
- (config-changes) `defaults/genesis.json` assumes `wasm_triggers[*].action.executable` is prebuilt under `wasm/target/prebuilt/libs/`

Major commits:

- feat: support multisig recursion
- feat: introduce multisig quorum and weights
- feat: add multisig subcommand to client CLI
- feat: introduce multisig transaction time-to-live
- feat: predefine multisig world-level trigger in genesis
- feat: allow accounts in domain to register multisig accounts

Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
  • Loading branch information
s8sato committed Oct 23, 2024
1 parent 34b5655 commit e7ea539
Show file tree
Hide file tree
Showing 90 changed files with 2,195 additions and 583 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ updates:
target-branch: "main"
directories:
- /
- /wasm_samples
- /wasm
schedule:
interval: "daily"
commit-message:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-custom-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
with:
ref: ${{ github.event.inputs.CHECKOUT_REF }}
- name: Build iroha executor
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm/libs/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
- name: Upload executor to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-dev-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build iroha executor
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm/libs/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
- name: Upload executor to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/iroha2-dev-pr-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
image: hyperledger/iroha2-ci:nightly-2024-09-09
steps:
- uses: actions/checkout@v4
- name: cargo fmt (wasm_samples)
working-directory: wasm_samples
- name: cargo fmt (wasm)
working-directory: wasm
run: cargo fmt --all -- --check

python_static_analysis:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-dev-pr-wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build iroha executor
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm/libs/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
- name: Upload executor to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
CARGO_TERM_COLOR: always
IROHA_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test"
DOCKER_COMPOSE_PATH: defaults
WASM_SAMPLES_TARGET_DIR: wasm_samples/target/prebuilt
WASM_TARGET_DIR: wasm/target/prebuilt
TEST_NETWORK_TMP_DIR: /tmp
NEXTEST_PROFILE: ci

Expand Down Expand Up @@ -63,20 +63,20 @@ jobs:
name: report-clippy
path: clippy.json

build_wasm_samples:
build_wasm:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Build
run: ./scripts/build_wasm_samples.sh
run: ./scripts/build_wasm.sh
- name: Upload all built WASMs
uses: actions/upload-artifact@v4
with:
name: wasm_samples
path: ${{ env.WASM_SAMPLES_TARGET_DIR }}
name: wasm
path: ${{ env.WASM_TARGET_DIR }}
retention-days: 1
- name: Upload executor.wasm specifically
uses: actions/upload-artifact@v4
Expand All @@ -89,7 +89,7 @@ jobs:
runs-on: [self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
needs: build_wasm_samples
needs: build_wasm
env:
LLVM_PROFILE_FILE_NAME: "iroha-%p-%m.profraw"
steps:
Expand All @@ -101,11 +101,11 @@ jobs:
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- name: Download the rest of WASM samples
- name: Download the rest of WASM
uses: actions/download-artifact@v4
with:
name: wasm_samples
path: ${{ env.WASM_SAMPLES_TARGET_DIR }}
name: wasm
path: ${{ env.WASM_TARGET_DIR }}
- name: Install irohad
run: which irohad || cargo install --path crates/irohad --locked
- name: Test with no default features
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
context: .

docker-compose-and-pytests:
needs: build_wasm_samples
needs: build_wasm
runs-on: [self-hosted, Linux, iroha2]
timeout-minutes: 60
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build iroha executor
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm/libs/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
- name: Upload executor to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build iroha executor
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm/libs/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
- name: Upload executor to reuse in other jobs
uses: actions/upload-artifact@v4
with:
Expand Down
15 changes: 15 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ iroha_smart_contract_utils = { version = "=2.0.0-rc.1.0", path = "crates/iroha_s
iroha_executor = { version = "=2.0.0-rc.1.0", path = "crates/iroha_executor" }
iroha_executor_data_model = { version = "=2.0.0-rc.1.0", path = "crates/iroha_executor_data_model" }

iroha_multisig_data_model = { version = "=2.0.0-rc.1.0", path = "crates/iroha_multisig_data_model" }

iroha_test_network = { version = "=2.0.0-rc.1.0", path = "crates/iroha_test_network" }
iroha_test_samples = { version = "=2.0.0-rc.1.0", path = "crates/iroha_test_samples" }

Expand Down Expand Up @@ -86,6 +88,7 @@ owo-colors = "4.1.0"
supports-color = "2.1.0"
inquire = "0.6.2"
spinoff = "0.8.0"
humantime = "2.1.0"

criterion = "0.5.1"
expect-test = "1.5.0"
Expand Down Expand Up @@ -201,9 +204,6 @@ resolver = "2"
members = [
"crates/*"
]
exclude = [
"wasm_samples",
]

[profile.deploy]
inherits = "release"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Iroha project mainly consists of the following crates:
* [`iroha_logger`](crates/iroha_logger) uses `tracing` to provide logging facilities.
* [`iroha_macro`](crates/iroha_macro) provides the convenience macros.
* [`iroha_p2p`](crates/iroha_p2p) defines peer creation and handshake logic.
* [`iroha_default_executor`](wasm_samples/default_executor) defines runtime validation logic.
* [`iroha_default_executor`](wasm/libs/default_executor) defines runtime validation logic.
* [`iroha_telemetry`](crates/iroha_telemetry) is used for monitoring and analysis of telemetry data.
* [`iroha_version`](crates/iroha_version) provides message versioning for non-simultaneous system updates.

Expand Down
3 changes: 2 additions & 1 deletion crates/iroha/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ iroha_logger = { workspace = true }
iroha_telemetry = { workspace = true }
iroha_torii_const = { workspace = true }
iroha_version = { workspace = true }
iroha_multisig_data_model = { workspace = true }

attohttpc = { version = "0.28.0", default-features = false }
eyre = { workspace = true }
Expand Down Expand Up @@ -85,7 +86,7 @@ iroha_genesis = { workspace = true }
iroha_test_samples = { workspace = true }
iroha_test_network = { workspace = true }
iroha_executor_data_model = { workspace = true }
executor_custom_data_model = { version = "=2.0.0-rc.1.0", path = "../../wasm_samples/executor_custom_data_model" }
executor_custom_data_model = { version = "=2.0.0-rc.1.0", path = "../../wasm/samples/executor_custom_data_model" }

tokio = { workspace = true, features = ["rt-multi-thread"] }
reqwest = { version = "0.12.7", features = ["json"] }
Expand Down
1 change: 1 addition & 0 deletions crates/iroha/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ pub mod query;

pub use iroha_crypto as crypto;
pub use iroha_data_model as data_model;
pub use iroha_multisig_data_model as multisig_data_model;
Loading

0 comments on commit e7ea539

Please sign in to comment.