-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix: read/write context/permission #93
fix: read/write context/permission #93
Conversation
The read/write permissions of dynamic link caller functions were not properly inherited by callee environment, so fixed this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write a test if it is able.
And, isn't it needed some verification in storing the code? If it has callable point export, the listing function export is also needed after it.
rename fuction name add error handling instead of unwrap()
I am thinking of writing the test in lbm-sdk. |
Because it is possible to define read-write functions in the _list_callable_points function and change the storage (e.g. if you write WASM directly etc)
Co-authored-by: TAKASE Ryo <loloicci@loloicci.dev>
raise error when inheriting from read-only to read-write permission
prepare a separate get_read_write_permission function
@da1suk8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CI is failing for the same reason as below.
|
|
Co-authored-by: Sujong Lee <leesj9476lsj@gmail.com>
Finschia/cosmwasm#270 (comment) Along with the modification of cosmwasm, I also modified here. |
Added 1a56bcd because the name of the variable was not appropriate. |
LGTM |
* feat: apply the wasm module of Finschia/finschia-sdk#936 * ci: add benchmarking job * fix: update error Message via Finschia/wasmvm#93 * ci test * fix: go fmt * build: update commit-hash of wasmvm * docs: update CHANGELOG * test: update on expected gas
Description
This PR is related to Finschia/cosmwasm#263, Finschia/cosmwasm#270
The read/write permissions of dynamic link caller functions were not properly inherited by callee environment, so fixed this.
There are a total of four possible combinations of caller and callee function read-write permissions.
The read-write permission is inherited by callee with the following rules.
If the caller's permission is
read-only
and the function of callee isread-write
, an error occurs.If the caller's permission is
read-only
and the function of callee isread-only
, the callee's permission is set toread-only
.If the caller's permission is
read-write
and the function of callee isread-write
, the callee's permission is set toread-write
.If the caller's permission is
read-write
and the function of callee isread-only
, the callee's permission is set toread-only
.When you build a contract that has the role of callee for dynamic link in cosmwasm, the following function is exported in WASM.
The return value of the function is a Map that takes the function name as a key and returns a read-write-permission.
True is read-only.
(This example is
number
contract)The read-write permission is brought from this function and inherited by the instance of callee.
Types of changes
Checklist