Phala-Network / phala-blockchain

The Phala Network Blockchain, pRuntime and the bridge.
https://phala.network
Apache License 2.0
333 stars 149 forks source link

Read blockchain storage from sideVM (or Fat Contract) #920

Open Soptq opened 2 years ago

Soptq commented 2 years ago

Currently the sideVM and Fat Contract lack the ability to read blockchain storage. Access control can be implemented so that only partial storage can be accessed.

One workaround is to use http request to directly fetch data through pRuntime's RPC endpoint. However, this is not very standard and could have some negative effects.

h4x3rotab commented 2 years ago

As discussed earlier, we could offer a read API to access the on-chain storage from SideVM. SideVM is a purely non deterministic env. So it should be fine.