-
Couldn't load subscription status.
- Fork 475
Add gas_limit host fn
#2691
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
base: master
Are you sure you want to change the base?
Add gas_limit host fn
#2691
Conversation
|
@cmichi Ill leave this draft PR so to ask questions in the meantime. This is what I have right now, and im getting the following error when running e2e tests ---- gas_hostfns::e2e_tests::e2e_gas_limit_works stdout ----
[==] Building cargo project
[==] Post processing code
thread 'gas_hostfns::e2e_tests::e2e_gas_limit_works' panicked at /home/USER/Desktop/polkadot/ink/crates/e2e/src/xts.rs:472:35:
decoding `trace_tx` result failed: Could not decode `Option::Some(T)`:
Could not decode `Trace::Call.0`:
Could not decode `CallTrace::child_call_count`:
Not enough data to fill bufferI don't really understand the error, what I am missing? |
|
You need to run the ink-node (check out https://use.ink/docs/v6/getting-started/deploy-your-contract). Pop CLI does this however for you! Please let me know if that works! |
|
Hey Daan, thanks for your message. On the docs its stated that its automatically ran, despite that I've tried running e2e tests after manually booting the node and with Im running pop test --e2e integration-tests/internal/gas-hostfns
pop test --e2e integration-tests/internal/misc-hostfns |
|
What you can also do is use the runtime_only backend like I am doing here: #2686 Then for the e2e tests you don't have to run a node, it is also faster dev cycle. You might have to add the precompiles in the sandboxed runtime though, but you can do that. |
|
@LucasGrasso The PR looks fine, your error likely comes from using an older This one has not been released yet, but we use it in the CI of There are some CI failures due to |
|
Worked with Opening the PR for review. Ran formatting. |
|
@LucasGrasso I left some minor comments, but all in all your PR looks great and you got the hang of it! Also nice that you thought about adding a changelog entry, nearly everyone forgets about that :-). If you want, feel free to take a look at some of the other host functions in #2653! There's a bunch that follow the same outline. |
|
@cmichi applied proposed changes, thanks for your help and review!
I sure will! Would you rather I create one PR per fn or just pack maybe two or three in one PR, I dont want to overwhelm with a huge PR. |
Summary
Partially Addresses #2653.
cargo-contractorpallet-revive?Expands the
TypedEnvBackendtrait and its implementations to implement thegas_limithost fn.Description
Implements the
gas_limithost fn in the on-chain enviroment and provides e2e tests for it.Checklist before requesting a review
CHANGELOG.md