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] #3982: Clear live queries after smart contract end #4024

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

Arjentix
Copy link
Contributor

@Arjentix Arjentix commented Oct 30, 2023

Description

  • Queries are removed from LiveQueryStore after wasm end
  • Added QueryId type alias
  • Added client crate API to directly use cursor
  • Added test

Linked issue

Closes #3982

Benefits

  • Optimizes storage
  • Less dangerous
  • More flexible client API

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 integration tests for the code changes
  • I replied to all comments after code review, marking all implemented changes with thumbs up

@Arjentix Arjentix added iroha2-dev The re-implementation of a BFT hyperledger in RUST Refactor Improvement to overall code quality Optimization Something isn't working as well as it should labels Oct 30, 2023
@Arjentix Arjentix self-assigned this Oct 30, 2023
@coveralls
Copy link

coveralls commented Oct 30, 2023

Pull Request Test Coverage Report for Build 6929164387

  • 75 of 215 (34.88%) changed or added relevant lines in 8 files are covered.
  • 6737 unchanged lines in 127 files lost coverage.
  • Overall coverage decreased (-3.1%) to 56.369%

Changes Missing Coverage Covered Lines Changed/Added Lines %
data_model/src/query/cursor.rs 0 1 0.0%
core/src/query/store.rs 4 7 57.14%
smart_contract/src/lib.rs 5 8 62.5%
ffi/derive/src/convert.rs 0 4 0.0%
smart_contract/executor/src/permission.rs 0 6 0.0%
client/src/client.rs 0 21 0.0%
core/src/smartcontracts/wasm.rs 64 166 38.55%
Files with Coverage Reduction New Missed Lines %
config/base/derive/src/view.rs 1 99.37%
config/src/block_sync.rs 1 95.0%
config/src/network.rs 1 93.75%
config/src/torii.rs 1 95.45%
config/src/wasm.rs 1 87.5%
core/src/smartcontracts/isi/block.rs 1 87.5%
config/src/kura.rs 2 79.41%
config/src/lib.rs 2 0.0%
ffi/src/option.rs 2 71.43%
config/src/genesis.rs 3 72.92%
Totals Coverage Status
Change from base Build 5423219773: -3.1%
Covered Lines: 22968
Relevant Lines: 40746

💛 - Coveralls

@Erigara Erigara self-assigned this Oct 31, 2023
@Erigara
Copy link
Contributor

Erigara commented Oct 31, 2023

I think tests is required here, we can postpone until client fetch_size will be merged

core/src/query/store.rs Outdated Show resolved Hide resolved
@Arjentix Arjentix force-pushed the live_query_end branch 3 times, most recently from 655cc18 to 6f83160 Compare November 2, 2023 22:24
@Arjentix Arjentix requested review from mversic and Erigara November 2, 2023 23:45
@mversic mversic assigned VAmuzing and mversic and unassigned VAmuzing Nov 6, 2023
@Arjentix Arjentix force-pushed the live_query_end branch 3 times, most recently from 38be575 to 950a9de Compare November 13, 2023 17:32
@Arjentix
Copy link
Contributor Author

Added test

client/src/client.rs Outdated Show resolved Hide resolved
client/tests/integration/queries/mod.rs Outdated Show resolved Hide resolved
core/src/smartcontracts/wasm.rs Outdated Show resolved Hide resolved
mversic
mversic previously approved these changes Nov 16, 2023
@mversic mversic requested a review from Erigara November 16, 2023 09:57
client/src/client.rs Outdated Show resolved Hide resolved
mversic
mversic previously approved these changes Nov 20, 2023
client/Cargo.toml Outdated Show resolved Hide resolved
…tract end

Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
@Arjentix Arjentix merged commit 0511141 into hyperledger-iroha:iroha2-dev Nov 20, 2023
12 checks passed
@Arjentix Arjentix deleted the live_query_end branch November 20, 2023 11:35
DCNick3 pushed a commit to DCNick3/iroha that referenced this pull request Nov 22, 2023
…tract end (hyperledger-iroha#4024)

Signed-off-by: Daniil Polyakov <arjentix@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 Optimization Something isn't working as well as it should Refactor Improvement to overall code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants