[feature] Allow different states in wasm::Runtime
& link-time checking
#3587
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
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 noaccount_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 bigState
into different types and use differentLinker
's forRuntime
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:
query_triggering_event()
from Smart Contract or Validatorquery_operation_to_validate()
from Smart Contract or TriggerThe text was updated successfully, but these errors were encountered: