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] Allow different states in wasm::Runtime & link-time checking #3587

Closed
Arjentix opened this issue Jun 8, 2023 · 0 comments
Closed
Assignees
Labels
Enhancement New feature or request iroha2-dev The re-implementation of a BFT hyperledger in RUST QA-confirmed This bug is reproduced and needs a fix Refactor Improvement to overall code quality

Comments

@Arjentix
Copy link
Contributor

Arjentix commented Jun 8, 2023

Initially it's a sub-task for #3230 .

Problems

The problem is that in #3230 I need to introduce another entypoint which should be executed with data different from our current State. For example there will be no account_id, but current desing forces me to use it.

Also with current design we skip link-time checking. We always link all functions. But for example query_triggering_event() function shouldn't be executed from Smart Contract or Validator, it should be executed only from Trigger.

Solution

Make Runtime generic over state it uses. This will allow split current big State into different types and use different Linker's for Runtime to implement link-time checking.

How to test from outside world

When this will be implemented there will be no way to execute inappropriate functions from WASM.

Things that should fail:

  1. Executing query_triggering_event() from Smart Contract or Validator
  2. Execution query_operation_to_validate() from Smart Contract or Trigger
@Arjentix Arjentix added Enhancement New feature or request iroha2-dev The re-implementation of a BFT hyperledger in RUST Refactor Improvement to overall code quality labels Jun 8, 2023
@Arjentix Arjentix self-assigned this Jun 8, 2023
Arjentix added a commit to Arjentix/iroha that referenced this issue Jun 8, 2023
…time & link-time checking

Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Arjentix added a commit to Arjentix/iroha that referenced this issue Jun 9, 2023
…time & link-time checking

Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Arjentix added a commit to Arjentix/iroha that referenced this issue Jun 9, 2023
…time & link-time checking

Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Arjentix added a commit to Arjentix/iroha that referenced this issue Jun 9, 2023
…time & link-time checking

Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Arjentix added a commit to Arjentix/iroha that referenced this issue Jun 13, 2023
…time & link-time checking

Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Arjentix added a commit that referenced this issue Jun 14, 2023
…checking

Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
@Arjentix Arjentix reopened this Jun 20, 2023
@timofeevmd timofeevmd self-assigned this Jun 21, 2023
@timofeevmd timofeevmd added the QA-confirmed This bug is reproduced and needs a fix label Jun 26, 2023
mversic pushed a commit that referenced this issue Oct 17, 2023
…checking

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
Enhancement New feature or request iroha2-dev The re-implementation of a BFT hyperledger in RUST QA-confirmed This bug is reproduced and needs a fix Refactor Improvement to overall code quality
Projects
None yet
Development

No branches or pull requests

2 participants