Skip to content
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

Remove BelowSubsistenceThreshold and NewContractNotFunded #1062

Merged
merged 12 commits into from
Dec 10, 2021

Conversation

cmichi
Copy link
Collaborator

@cmichi cmichi commented Dec 1, 2021

Do not merge yet!

Closes #1044.

Follow-up to paritytech/substrate#10082.

I haven't adapted the off-chain testing environment for the deposit mechanism, I'll create a follow-up for that. Right now, the off-chain env doesn't take the new deposit mechanism into account in any way.

@cmichi cmichi requested a review from athei December 1, 2021 16:03
Copy link
Contributor

@athei athei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return codes didn't change for backwards compatibility. We merely stopped emitting some of them. Please check: https://github.com/paritytech/substrate/blob/450cd6804dd77312b27d72ebdebccc4c6027f579/frame/contracts/src/wasm/runtime.rs#L47-L77

@cmichi
Copy link
Collaborator Author

cmichi commented Dec 3, 2021

@athei Argh, ofc, I've updated the PR.

@paritytech-ci
Copy link

🦑 📈 ink! Example Contracts ‒ Changes Report 📉 🦑

These are the results when building the examples/* contracts from this branch with cargo-contract 0.16.0-78ea802 and comparing them to ink! master:

Δ Optimized Size Δ Used Gas Total Optimized Size Total Used Gas
accumulator 1.74 K
adder 2.87 K
contract-terminate 1.50 K 200_571
contract-transfer 8.02 K 727
delegator 9.95 K 6_151
dns 21.69 K 18_864
erc1155 47.30 K 54_061
erc20 10.34 K 6_414
erc721 36.21 K 66_677
flipper 2.02 K 173
incrementer 1.94 K 166
multisig 46.25 K 63_165
proxy 3.90 K 2_112
rand-extension 5.14 K 5_553
subber 2.89 K
trait-erc20 27.50 K 15_834
trait-flipper 1.83 K 168
trait-incrementer 1.93 K 332

Link to the run | Last update: Fri Dec 3 09:49:50 CET 2021

@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2021

Codecov Report

Merging #1062 (28ef5f8) into master (378d83f) will decrease coverage by 15.56%.
The diff coverage is 0.00%.

❗ Current head 28ef5f8 differs from pull request most recent head 9100ca1. Consider uploading reports for the commit 9100ca1 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1062       +/-   ##
===========================================
- Coverage   78.79%   63.22%   -15.57%     
===========================================
  Files         248      248               
  Lines        9371     9369        -2     
===========================================
- Hits         7384     5924     -1460     
- Misses       1987     3445     +1458     
Impacted Files Coverage Δ
crates/engine/src/ext.rs 72.60% <ø> (ø)
crates/env/src/api.rs 36.36% <ø> (ø)
...tes/env/src/engine/experimental_off_chain/impls.rs 54.12% <0.00%> (ø)
crates/lang/codegen/src/traits.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/ir/src/ir/contract.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/env.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/mod.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/enforced_error.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/blake2b.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/storage.rs 0.00% <0.00%> (-100.00%) ⬇️
... and 54 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 378d83f...9100ca1. Read the comment docs.

@HCastano HCastano added the E-on-ice The issue or PR is currently on ice and not further discussed or developed. label Dec 8, 2021
Copy link
Contributor

@HCastano HCastano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this PR waiting for?

/// - Panics in case the requested transfer would have brought the
/// contract balance below the subsistence threshold.
/// - Panics in case the requested transfer would have brought this
/// contract's balance below the minimum balance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What balance is the minimum balance referring to in this case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chains existential deposit, I clarified it in the comment.

@cmichi cmichi merged commit 9ed2f48 into master Dec 10, 2021
@cmichi cmichi deleted the cmichi-integrate-substrate-storage-deposit-pr branch December 10, 2021 09:55
xgreenx pushed a commit to Supercolony-net/ink that referenced this pull request Feb 8, 2022
…k#1062)

* Remove `BelowSubsistenceThreshold` and `NewContractNotFunded`

* Fix `clippy:single-match`

* Fix doc-link

* Fix `clippy:redundant-pattern-matching`

* Fix error codes

* Fix error codes

* Remove superfluous whitespace

* Clarity what minimum balance refers to

* Fix typo: chain's ➜ chains

* Revert "Fix typo: chain's ➜ chains"

This reverts commit 40c0920.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-on-ice The issue or PR is currently on ice and not further discussed or developed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reflect the contracts pallet's switch to charging a deposit for storage in ink!
5 participants