You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Access control code is not yet enabled, but has multiple problems:
Problem 1
Access control is done after the resource is loaded from the global storage. For example, for borrow_global:
let res = Self::load_resource(loader, data_store, module_store, gas_meter, addr, ty)?.borrow_global();
gas_meter.charge_borrow_global(...)?;self.check_access(...)?;
...
Ideally, the access check should be done before loading to avoid any overhead and unnecessary data caching. Also gas metering for load_resource accounts for success of the loading, and so on denied access, the gas charge should be the same as if the resource failed to load.
Problem 2
While the feature is not enabled, some code is unconditionally executed and has impact on performance: check_access. It looks up struct name in global struct name cache, which can lead to contention on the read lock when this cache is shared across multiple threads (i.e., V2 loader enabled).
To reproduce
N/A
Expected Behavior
A clear and concise description of what you expected to happen.
System information
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered:
🐛 Bug
Access control code is not yet enabled, but has multiple problems:
Problem 1
Access control is done after the resource is loaded from the global storage. For example, for
borrow_global
:Ideally, the access check should be done before loading to avoid any overhead and unnecessary data caching. Also gas metering for
load_resource
accounts for success of the loading, and so on denied access, the gas charge should be the same as if the resource failed to load.Problem 2
While the feature is not enabled, some code is unconditionally executed and has impact on performance:
check_access
. It looks up struct name in global struct name cache, which can lead to contention on the read lock when this cache is shared across multiple threads (i.e., V2 loader enabled).To reproduce
N/A
Expected Behavior
A clear and concise description of what you expected to happen.
System information
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: