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

[feature] #3929: Lazy queries inside wasm #3958

Merged
merged 2 commits into from
Oct 20, 2023

Conversation

Arjentix
Copy link
Contributor

@Arjentix Arjentix commented Oct 4, 2023

Description

  • Live query store moved from Torii to Core
  • Now wasm can use lazy queries
  • Basic clients should send either Query with pagination and sorting or cursor. Not everything together.
  • Reduced iroha::Configuration stack memory footprint

Linked issue

Benefits

Checklist

  • I've read CONTRIBUTING.md
  • I've used the standard signed-off commit format (or will squash just before merging)
  • All applicable CI checks pass (or I promised to make them pass later)
  • (optional) I've written unit tests for the code changes
  • I replied to all comments after code review, marking all implemented changes with thumbs up

@Arjentix Arjentix self-assigned this Oct 4, 2023
@github-actions github-actions bot added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Oct 4, 2023
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.

this is the first time we're effectively breaking sandboxing by allowing user submitted smart contracts to hold references to host resources. Let's think about security aspect of that

core/src/smartcontracts/isi/query.rs Outdated Show resolved Hide resolved
cli/src/torii/routing.rs Outdated Show resolved Hide resolved
core/src/smartcontracts/wasm.rs Outdated Show resolved Hide resolved
core/src/query/store.rs Outdated Show resolved Hide resolved
@Arjentix
Copy link
Contributor Author

Arjentix commented Oct 5, 2023

this is the first time we're effectively breaking sandboxing by allowing user submitted smart contracts to hold references to host resources. Let's think about security aspect of that

What security risks do you see?

I can't see any new problems for now. All users can do with wasm they already can do with a simple client.
Also keep in mind that our wasm smart contracts and etc. are one-shot and stateless

@Erigara Erigara self-assigned this Oct 6, 2023
cli/src/torii/mod.rs Outdated Show resolved Hide resolved
cli/src/torii/routing.rs Outdated Show resolved Hide resolved
core/src/query/store.rs Outdated Show resolved Hide resolved
core/benches/kura.rs Show resolved Hide resolved
data_model/src/query/mod.rs Outdated Show resolved Hide resolved
data_model/src/query/mod.rs Outdated Show resolved Hide resolved
@mversic mversic self-assigned this Oct 9, 2023
@Arjentix Arjentix marked this pull request as ready for review October 9, 2023 23:34
@Arjentix Arjentix force-pushed the lazy_query_for_wasm branch 2 times, most recently from 4302c26 to eb2652e Compare October 11, 2023 08:18
@coveralls
Copy link

coveralls commented Oct 11, 2023

Pull Request Test Coverage Report for Build 6588505480

  • 340 of 823 (41.31%) changed or added relevant lines in 36 files are covered.
  • 6765 unchanged lines in 127 files lost coverage.
  • Overall coverage decreased (-3.6%) to 55.88%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cli/src/torii/utils.rs 0 1 0.0%
config/base/derive/src/view.rs 18 19 94.74%
config/src/live_query_store.rs 16 17 94.12%
core/src/block.rs 16 17 94.12%
core/src/smartcontracts/isi/query.rs 18 19 94.74%
core/src/wsv.rs 21 22 95.45%
smart_contract/derive/src/entrypoint.rs 0 1 0.0%
smart_contract/executor/derive/src/entrypoint.rs 0 1 0.0%
smart_contract/trigger/derive/src/entrypoint.rs 0 1 0.0%
config/base/derive/src/proxy.rs 32 34 94.12%
Files with Coverage Reduction New Missed Lines %
client/src/lib.rs 1 0.0%
config/src/block_sync.rs 1 95.0%
config/src/network.rs 1 93.75%
config/src/torii.rs 1 96.0%
config/src/wasm.rs 1 87.5%
core/src/smartcontracts/isi/block.rs 1 87.5%
config/base/derive/src/proxy.rs 2 97.59%
config/src/kura.rs 2 79.41%
config/src/lib.rs 2 0.0%
ffi/src/option.rs 2 71.43%
Totals Coverage Status
Change from base Build 5423219773: -3.6%
Covered Lines: 22082
Relevant Lines: 39517

💛 - Coveralls

@Arjentix Arjentix force-pushed the lazy_query_for_wasm branch 3 times, most recently from 693da37 to 1e01148 Compare October 11, 2023 15:07
@Arjentix Arjentix changed the title Lazy query for wasm [feature] #3929: Lazy queries inside wasm Oct 11, 2023
Cargo.toml Outdated Show resolved Hide resolved
core/src/query/store.rs Outdated Show resolved Hide resolved
core/src/query/store.rs Outdated Show resolved Hide resolved
core/src/queue.rs Show resolved Hide resolved
data_model/src/lib.rs Show resolved Hide resolved
data_model/src/query/cursor.rs Show resolved Hide resolved
data_model/src/query/mod.rs Show resolved Hide resolved
smart_contract/derive/src/entrypoint.rs Outdated Show resolved Hide resolved
cli/src/lib.rs Show resolved Hide resolved
core/src/smartcontracts/wasm.rs Show resolved Hide resolved
Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
@Arjentix Arjentix merged commit 0e13452 into hyperledger-iroha:iroha2-dev Oct 20, 2023
13 of 20 checks passed
@Arjentix Arjentix deleted the lazy_query_for_wasm branch October 20, 2023 15:04
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
Development

Successfully merging this pull request may close these issues.

4 participants