-
Notifications
You must be signed in to change notification settings - Fork 13
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
merge dynamic_link into feat/1.5.0_dynamiclink (copy of feat/bump_1.5.0) #340
Closed
loloicci
wants to merge
101
commits into
Finschia:feat/1.5.0_dynamiclink
from
loloicci:feat/1.5.0_dynamiclink
Closed
merge dynamic_link into feat/1.5.0_dynamiclink (copy of feat/bump_1.5.0) #340
loloicci
wants to merge
101
commits into
Finschia:feat/1.5.0_dynamiclink
from
loloicci:feat/1.5.0_dynamiclink
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* feat: add contract_call definition to BackendApi * feat: add dynamic link for imported function in custom env * feat: allow custom env module name * feat: add sample contracts for testing dynamic link feature * feat: add fmt::Display trait to FunctionMetadata * chore: add FIXME comment for known issue * fix: move out the callee metadata from context_data to env context_data is wrraped by Arc, so cloned envs are sharing the context_data. so overwrite the previous metadata if there are more then 2 imported functions. * chore: remove ci in example contracts * fix: fix import name condition to allow only one dot * chore: update cargo for contracts * chore: fix lint * chore: fix clippy * chore: cargo fmt * docs: simplify the sample contract docs Most are generated by the template and are not needed. * chore: remove contract unused warnings * chore: delete unnecessary excludes created by template
…#157) * feat: add #[callable_point] proc macro * feat: add #[dynamic_link] proc macro * fix: publiclize the memory module using in #[callable_point] and #[dynamic_link] * feat: add re-exports #[callable_point] and #[dynamic_link] * feat: make tuple return by #[callable_point] and #[dynamic_link] * feat: add copies region of args and return between env The actual copy calls are executed by wasmvm. * fix: disable return the tuple type Finschia#156 * refactor: improve error handling with proc_macro_error * feat: update sample contract for dynamic_link * test: add unit test for copy_region_vals_between_env * test: add integration test for callable_point macro proc_macro cannot do normal unit tests. Instead, it is replaced by the contract's integration test. * test: add integration test for dynamic_link macro proc_macro cannot do normal unit tests. Instead, it is replaced by the contract's integration test. * fix: unlimit the target_arch of memory module When running the test with dynamic_link proc_macro, it should be able to compile the memory module on other architectures as well. * chore: cargo fmt * chore: update cargo.lock for contracts * fix: fix maximum size * chore: cargo clippy * test: add module name test condition for dynamic_link macro * chore: fix reverted unused warnings in the contracts * chore: fix typo * chore: remove unnecessary prefix * refactor: improve abort message * refactor: change to use quote! and proc_macro2 proc_macro2 allows the implementation of separate modules. * chore: update cargo.lock * chore: disable clippy warning for abort_by! * fix: add disallowed type by parameter see: Finschia#152 * chore:cargo fmt * chore: avoid false-positive of clippy * chore: again avoid clippy * chore: fix typo
* feat: add global api for to get env in dynamic call * tet: add integration test for env of global api * refactor: refactor integration test * chore: cargo fmt * feat: add deps into global api It has bug within using the mock envs. leave the issue and continue with W/A first because it's need for the virtual call stack test.
…hia#178) * feat: add dynamic callstack for prevent the re-entrancy attack - includes max call depth limitation * test: add integration test for trying re-entrancy attack * fix: change the duplication check to use contract address Even in a running existing contract, a wasmer instance is newly created every call. cannot use the wasmer instance for check the duplication. * chore: rename to try_pass_callstack * chore: cargo fmt
* refactor: remove available gas parameter by contract_call * test: add unit test for native_dynamic_link_trampoline * refactor: refactor test code for using an existing mock_instance function * chore: cargo fmt * chore: rename function
…hia#188) * test: add unit tests for #[dynamic_link] and #[callable_point] Due to the limitations of proc macro test implementation, test logic cannot be added where attribute and proc-macro-error are used. * chore: cargo fmt * test: refactor tests
* feat: enable dynamic callee function to return tuple typed value * refactor: refactor how to check returned value of dynamic callee * refactor: refactor dynamic call macros * feat: add dynamic call function returns tuple and tests * chore: cargo fmt * chore: cargo clippy * fix: fix attribute format of dynamic caller's pnig * docs: update README.md of contracts * fix: refactor dynamic-callee and dynamic-caller * chore: cargo fmt * chore: format contract/REAMDE.md 's table
* fix: limit exporting GlobalEnv to wasm32 target * chore: cargo clippy
* fix: contract path * fix: contract path(caller)
* chore: remove unneeded line from test wasm * feat: change from where vm fetches callee address * feat: add Contract trait to represent callee contract * feat: add derive Contract * feat: remake macros for dynamic link * feat: remake dynamic caller contract * fix: fix unit tests for dynamic link * fix: fix how to dynamic link callee contract * fix: fix a typo
* revert: Revert "fix: limit exporting GlobalEnv only to wasm32 target (Finschia#212)" This reverts commit b60b63c. * fix: relax the limit of exporting of GlobalEnv
* feat: add number contracts * ci: add tests for number contracts to github workflow
…rkflow (Finschia#221) * fix: improve dynamic callee tests * feat: add dynamic link contracts' tests to github workflow * fix: cargo clippy and improve arg names * ci: comment out clippy for dynamic-link contracts
* feat: expand env type for read/write data from/to mock env * perf: add benchmark for native_dynamic_link_trampoline * perf: add benchmark for read/write region * perf: fix a mistaken commentout * pref: increase gas limit for mock instance big enough for bench iterations
…macro (Finschia#226) * fix: rename generated function by dynamic_link and callable_point * fix: fix tests of contracts for previous commit's change * chore: cargo fmt * fix: fix a test for dynamic_link
* feat: enable implement user defined mock of dynamic link * feat: add userdefined mock and tests to dynamic-caller-contract * fix: fix a doctest for dynamic_link * chore: cargo clippy * chore: remove a whitespace after ! (op not)
* test: enable to fail in dynamic_link callee mock wat * feat: add error for dynamic link * test: add unit test for dynamic link * fix: delete unnecessary blank * fix: modify to the appropriate function * fix: fix unit tests for dynamic link * fix: modified function name * fix: change type to String * refactor: use unwrap_err Co-authored-by: loloicci <[email protected]>
* fix: cache name * docs: add call-number and number * docs: fix typo and title * docs: add entry point info of number and call-number
* feat: add callee_panic of callable_point * test: add integration test for callee_panic * fix: fix test error * fix: adapt cargo schema * fix: add newline at end of file * fix: rename function to do_panic * fix: add "s"
* feat: make callable_point function takes deps as the first arg * feat: fix dynamic callee contracts' callable points * test: add and format docs for macros * feat: remove functions to get deps in global_api * fix: fix merged dynamic_callee_contract
…chia#237) * ci: fix broken workflow for benchmarking (Finschia#209) * ci: clean list of branches to benchmark * ci: fix broken workflow for benchmarking * ci: change rust version for dynamic_link branch * ci: add dynamic_link branch to branches to take benchmark
…inschia#234) * feat: add userdefined mock and tests to dynamic-caller-contract * revert: "feat: add global api for to get env,deps in dynamic call (Finschia#182)" This reverts commit 7b2d9dd. * feat: add write_value_to_env which writes value to instance memory * feat: make callable point take Env as the second arg * fix: fix merged contracts * chore: fix a comment
* feat: add get_caller_addr to deps.api * feat: add some functions to check get_caller_addr to sample contracts * fix: fix reentrancy and split callee's callee contract definition * fix: rename an attribute name of a event * chore: cargo fmt
Finschia#307) * feat: add a query to get own address via callee's get caller address to dynamic_caller_contract * chore: cargo clippy
* fix: delete outdated comments * chore: delete unused serde_json from contracts dependencies * chore: update dynamic-callee-contract's Cargo.lock
* feat: StdResult (de)serialize * test: fix lint fmt * chore: remove comments * test: fix std result pong ordering * chore: add semicolon * test: fix test * test: add pong_with_stdresult test * test: fix lint fmt * test: fix build * test: fix test * test: fix fmt and test * test: fix fmt and test * test: fix lint fmt * test: add StdResult unit test * test: fix build * test: add mock test func * test: fix len * test: fix test string * test: fix lint fmt * test: add stdresult_err to import and reordering * chore: remove conversion_overflow * chore: add target_arch to StdError
* Added description about mock for callee * chore: fix the comment that clearly states that test is the target * comment: fix as pointed out * fix: fix ambiguous comment for dynamic link mock * fix: typo
…ia#316) * fix: add the error handling when getting address from storage * fix: Added error delegation `?` to function caller on `unwrap()?` * fix: fix `?`
* fix: use parity wasm's sign-ext feature * chore: generate new lock files to contracts
…tract (Finschia#318) * chore: write explanatory comments on test functions Signed-off-by: 170210 <[email protected]> * style: format Signed-off-by: 170210 <[email protected]> * style: fix for review Signed-off-by: 170210 <[email protected]> --------- Signed-off-by: 170210 <[email protected]>
* fix: corrected to appropriate error message * fix: reflect comments * fix: delete unnecessary '{}'
* fix: adopt macros - #[cw_serde] - #[derive(QueryResponses)] - write_api! * fix: adopt macros and as with the queue contract, several structures were moved to msg.rs
loloicci
force-pushed
the
feat/1.5.0_dynamiclink
branch
from
January 31, 2024 10:00
5a6bd7f
to
dbf4f67
Compare
loloicci
force-pushed
the
feat/1.5.0_dynamiclink
branch
from
February 1, 2024 09:59
dbf4f67
to
4e229fd
Compare
loloicci
force-pushed
the
feat/1.5.0_dynamiclink
branch
from
February 9, 2024 14:20
55d3593
to
f4e503e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Closes #0
Types of changes
Checklist