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] #3833, #2373, #3601: Split off Kagami #3841

Merged
merged 18 commits into from
Sep 4, 2023

Conversation

0x009922
Copy link
Contributor

@0x009922 0x009922 commented Aug 28, 2023

Description

Outline:

  • Refactor Kagami
    • Remove kagami validator
    • Remove kagami swarm
    • Refactor kagami genesis according to the comment
  • Introduce iroha_swarm: according to the comment
  • Introduce iroha_wasm_builder_cli: a CLI around iroha_wasm_builder. It replaces kagami validator in the following way:
    # before
    kagami validator > validator.wasm
    
    # after
    iroha_wasm_builder_cli check ./default_validator
    iroha_wasm_builder_cli build ./default_validator --optimize --format > validator.wasm
  • Update CI scripts which used the previous commands

Linked issue

Closes #3833 #2373 #3601

Benefits

  • Kagami is now a portable and lightweight tool. There is no issue with mentioning it in the documentation.
  • Swarm is now simpler, without redundant functionality. Easy to enhance in the future.
  • A general tool for building smartcontracts. Easy to enhance in the future. More reliable than kagami validator thanks to spinners.

Checklist

  • Investigate the logic behind the format option in iroha_wasm_builder::Builder, maybe open an issue to refactor it.
  • Self-review
  • Add README to iroha_swarm

@mversic mversic self-assigned this Aug 28, 2023
@coveralls
Copy link
Collaborator

coveralls commented Aug 28, 2023

Pull Request Test Coverage Report for Build 6035809576

  • 527 of 755 (69.8%) changed or added relevant lines in 8 files are covered.
  • 5362 unchanged lines in 89 files lost coverage.
  • Overall coverage decreased (-1.4%) to 58.083%

Changes Missing Coverage Covered Lines Changed/Added Lines %
wasm_builder/src/lib.rs 0 3 0.0%
tools/swarm/src/cli.rs 24 41 58.54%
tools/swarm/src/util.rs 33 51 64.71%
tools/swarm/src/ui.rs 0 25 0.0%
tools/kagami/src/genesis.rs 0 30 0.0%
tools/swarm/src/main.rs 0 35 0.0%
tools/swarm/src/compose.rs 470 508 92.52%
wasm_builder_cli/src/main.rs 0 62 0.0%
Files with Coverage Reduction New Missed Lines %
cli/src/main.rs 1 0.0%
cli/src/torii/pagination.rs 1 98.9%
config/base/src/runtime_upgrades.rs 1 51.72%
config/src/torii.rs 1 96.67%
core/src/smartcontracts/isi/block.rs 1 87.5%
crypto/src/merkle.rs 1 96.23%
data_model/derive/src/partially_tagged.rs 1 99.67%
data_model/src/account.rs 1 52.21%
data_model/src/domain.rs 1 47.37%
logger/src/lib.rs 1 95.15%
Totals Coverage Status
Change from base Build 5423219773: -1.4%
Covered Lines: 20537
Relevant Lines: 35358

💛 - Coveralls

tools/swarm/src/ui.rs Outdated Show resolved Hide resolved
wasm_builder_cli/src/main.rs Outdated Show resolved Hide resolved
wasm_builder_cli/README.md Outdated Show resolved Hide resolved
DCNick3
DCNick3 previously approved these changes Aug 29, 2023
Copy link
Contributor

@ilchu ilchu left a comment

Choose a reason for hiding this comment

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

Good to feel the old crutches gone. Overall structure is much more digestible too.

tools/kagami/src/genesis.rs Outdated Show resolved Hide resolved
wasm_builder_cli/src/main.rs Outdated Show resolved Hide resolved
wasm_builder_cli/src/main.rs Outdated Show resolved Hide resolved
tools/kagami/src/genesis.rs Outdated Show resolved Hide resolved
DCNick3
DCNick3 previously approved these changes Aug 31, 2023
Cargo.toml Outdated Show resolved Hide resolved
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
@0x009922 0x009922 merged commit 373a415 into hyperledger:iroha2-dev Sep 4, 2023
8 checks passed
@0x009922 0x009922 deleted the 3833-split-kagami branch September 4, 2023 10:24
mversic pushed a commit that referenced this pull request Oct 17, 2023
* [refactor]: remove Swarm from Kagami; introduce refactored `iroha_swarm`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [refactor]: remove validator from Kagami; cleanup

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [misc]: fix workspace info, introduce `wasm_builder_cli`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [ci]: update Genesis and Swarm cmds in scripts

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [feat]: produce workable `iroha_wasm_builder_cli`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [feat]: enhance CLI UI with spinners

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [build]: remove `iroha_wasm_builder` dep from Kagami

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [build]: tree-shake unused spinners

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [test]: fix swarm tests

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [docs]: add README for `iroha_swarm`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [refactor]: remove `UserInterface` struct

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [feat]: add `--outfile` arg for wasm cli

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [docs]: document how to build the default validator

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [chore]: unused imports

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [docs]: link the directory to the cli

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [docs]: enhance warning about an inlined validator

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [chore]: use stdout

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

* [refactor]: move `wasm_builder_cli` to `./tools/`

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>

---------

Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
6 participants