Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

seal_delegate_call api function (support for library contracts) #10617

Merged
merged 24 commits into from
Feb 8, 2022

Conversation

yarikbratashchuk
Copy link
Contributor

@yarikbratashchuk yarikbratashchuk commented Jan 8, 2022

This PR implements delegate call as a separate api function seal_delegate_call

It is a follow up to #7 (second reason)

- tests
- benchmark
frame/contracts/src/benchmarking/mod.rs Outdated Show resolved Hide resolved
frame/contracts/src/tests.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
@athei athei added A0-please_review Pull request needs code review. B7-runtimenoteworthy C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit. labels Jan 11, 2022
@athei athei added this to In Progress in Smart Contracts via automation Jan 11, 2022
@athei
Copy link
Member

athei commented Jan 11, 2022

Thanks. Currently ooO. Will review next week.

Copy link
Member

@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.

Thanks for your contribution. This is certainly an important functionality to allow library contracts. Apart from the review comments I think the following should be done:

This PR implements the semantics of the older CALLCODE evm op instead of newer DELEGATECALL op. This PR should be changed to implement the latter:

  • Rename seal_call_code to seal_delegate_call
  • Forward msg.sender and msg.value to the library. Meaning seal_caller and seal_value_transferred return the same values as for the contract which calls seal_delegate_call.

I also changed the title of the PR because this should mainly be used for library contracts. Proxy pattern (upgradeable contracts) should be implemented through set_code: #10567

frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/exec.rs Outdated Show resolved Hide resolved
frame/contracts/fixtures/call_code.wat Outdated Show resolved Hide resolved
frame/contracts/fixtures/call_code.wat Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Show resolved Hide resolved
@athei athei changed the title seal_call_code api function (support for Upgradable contracts) seal_call_code api function (support for library contracts) Jan 17, 2022
@athei athei linked an issue Jan 17, 2022 that may be closed by this pull request
- whitespace .wat issues
- wrong/missing .wat comments
- redundant .wat calls/declarations

- change order of functions (seal_delegate_call right after seal_call)
  in decls, tests, benchmark
- fix comments, move doc comments to enum variants
- remove unnecessary empty lines

- rename runtime cost DelegateCall to DelegateCallBase
- do not set CallFlags::ALLOW_REENTRY for delegate_call
Copy link
Member

@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.

Getting better. Still some issues remain:

  • Extend your test so that it checks seal_caller and seal_value_transferred for the proper values.
  • Please make sure that the seal_caller returns the proper value -> the original caller and not the contract itself as it is the case right now.

frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/lib.rs Outdated Show resolved Hide resolved
frame/contracts/fixtures/delegate_call.wat Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/exec.rs Outdated Show resolved Hide resolved
frame/contracts/src/exec.rs Outdated Show resolved Hide resolved
frame/contracts/src/exec.rs Outdated Show resolved Hide resolved
@yarikbratashchuk
Copy link
Contributor Author

@athei, please take a look at the seal_caller approach i came up with.
It uses the property that if all gas is passed and the account id is the same then we assume it was delegate_call.
We look for a caller recursively.

Let me know if you don't like it and want to add caller field to the frame itself.

@yarikbratashchuk yarikbratashchuk changed the title seal_call_code api function (support for library contracts) seal_delegate_call api function (support for library contracts) Jan 19, 2022
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.

Mostly looks good. I've got some questions and some nitpicks.

For the nickpicks it's up to you if you want to address them. If you don't want to it won't block an approval

frame/contracts/src/wasm/runtime.rs Show resolved Hide resolved
Comment on lines +110 to +113
///
/// # Return Value
///
/// Result<ExecReturnValue, ExecError>
Copy link
Contributor

Choose a reason for hiding this comment

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

Someone can get this info by reading the function signature 😉

Suggested change
///
/// # Return Value
///
/// Result<ExecReturnValue, ExecError>

Copy link
Contributor

Choose a reason for hiding this comment

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

@yarikbratashchuk small thing but it is unnecessary

Copy link
Member

Choose a reason for hiding this comment

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

Can you please apply. This comment is no longer necessary since we changed to the type to be no longer a tuple.

frame/contracts/src/exec.rs Outdated Show resolved Hide resolved
frame/contracts/src/exec.rs Outdated Show resolved Hide resolved
frame/contracts/src/exec.rs Outdated Show resolved Hide resolved
frame/contracts/fixtures/delegate_call.wat Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
frame/contracts/src/wasm/runtime.rs Outdated Show resolved Hide resolved
@HCastano
Copy link
Contributor

HCastano commented Feb 1, 2022

@yarikbratashchuk can you also merge master again?

@athei
Copy link
Member

athei commented Feb 2, 2022

/benchmark runtime pallet pallet_contracts

@parity-benchapp
Copy link

parity-benchapp bot commented Feb 2, 2022

Benchmark Runtime Pallet for branch "delegatecall" with command cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Toolchain: stable-x86_64-unknown-linux-gnu (default)
rustc 1.57.0 (f1edd0429 2021-11-29)

Results
Pallet: "pallet_contracts", Extrinsic: "on_initialize", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Contracts DeletionQueue (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    1.602
              µs

Reads = 1
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    1.602
              µs

Reads = 1
Writes = 0

Pallet: "pallet_contracts", Extrinsic: "on_initialize_per_trie_key", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Skipped Metadata (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    7.767
    + k    0.743
              µs

Reads = 1 + (0 * k)
Writes = 1 + (1 * k)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    k   mean µs  sigma µs       %
    0      9.95     0.061    0.6%
   20     26.21     0.239    0.9%
   40      41.2     0.195    0.4%
   60     52.52     0.201    0.3%
   80     64.05     0.212    0.3%
  100     78.91     0.464    0.5%
  120     92.48     0.255    0.2%
  140     108.1     0.358    0.3%
  160     123.7     0.467    0.3%
  180     138.8     0.393    0.2%
  200     152.8     0.575    0.3%
  220     168.9     0.901    0.5%
  240     183.8     0.416    0.2%
  260       200     1.249    0.6%
  280     213.8     0.993    0.4%
  300     227.6     1.515    0.6%
  320     242.8     0.886    0.3%
  340     259.4     0.596    0.2%
  360     274.6     1.033    0.3%
  380     291.5     0.416    0.1%
  400     308.5     1.064    0.3%
  420     322.9     0.862    0.2%
  440       338     0.809    0.2%
  460     351.8     1.163    0.3%
  480     365.9     0.523    0.1%
  500     386.1     1.115    0.2%
  520     399.3     2.224    0.5%
  540     414.2     3.142    0.7%
  560     427.2     1.276    0.2%
  580     444.9     1.186    0.2%
  600     458.6     1.926    0.4%
  620       470     1.823    0.3%
  640     486.1     1.909    0.3%
  660     502.6      1.93    0.3%
  680     517.2     1.509    0.2%
  700     532.3     2.942    0.5%
  720     543.5     1.783    0.3%
  740       559     1.876    0.3%
  760     572.7     1.262    0.2%
  780       587     1.657    0.2%
  800     604.1     4.963    0.8%
  820     616.9     2.113    0.3%
  840     632.5     2.322    0.3%
  860     647.2     2.028    0.3%
  880     659.4     1.693    0.2%
  900     675.2     4.794    0.7%
  920     688.3     4.025    0.5%
  940     700.2     2.389    0.3%
  960     713.4     1.708    0.2%
  980     730.6     2.425    0.3%
 1000     745.3     3.898    0.5%
 1020     762.3     2.452    0.3%

Quality and confidence:
param     error
k             0

Model:
Time ~=    8.338
    + k    0.742
              µs

Reads = 1 + (0 * k)
Writes = 1 + (1 * k)

Pallet: "pallet_contracts", Extrinsic: "on_initialize_per_queue_item", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Contracts DeletionQueue (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=     13.3
    + q    2.192
              µs

Reads = 1 + (0 * q)
Writes = 1 + (0 * q)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    q   mean µs  sigma µs       %
    0      1.63     0.029    1.7%
   20      56.8      0.22    0.3%
   40     101.6     0.528    0.5%
   60     148.5     0.823    0.5%
   80     190.6     0.745    0.3%
  100     231.8     0.713    0.3%
  120     280.4      1.28    0.4%
  140       331     0.436    0.1%
  160     369.5     3.111    0.8%
  180     419.9      6.26    1.4%
  200     452.5     1.885    0.4%
  220     493.8     3.262    0.6%
  240       565     5.724    1.0%
  260     603.4     9.333    1.5%
  280     645.2     7.119    1.1%
  300     666.8     8.339    1.2%
  320     717.8     8.394    1.1%
  340     768.6      8.29    1.0%
  360     802.2     6.625    0.8%
  380     823.9     2.048    0.2%
  400     879.2     11.08    1.2%
  420     928.6     9.775    1.0%
  440       969     8.155    0.8%
  460      1006     7.532    0.7%
  480      1030     12.77    1.2%
  500      1096     8.897    0.8%
  520      1147     11.05    0.9%
  540      1134     3.827    0.3%
  560      1211     11.33    0.9%
  580      1212     6.549    0.5%
  600      1303     7.204    0.5%
  620      1362     9.749    0.7%
  640      1401      11.8    0.8%
  660      1422     16.06    1.1%
  680      1433     11.33    0.7%
  700      1517     9.898    0.6%
  720      1570     12.06    0.7%
  740      1606     19.41    1.2%
  760      1658     14.87    0.8%
  780      1658     18.87    1.1%
  800      1783     17.77    0.9%
  820      1727     16.12    0.9%
  840      1843     13.43    0.7%
  860      1892     10.68    0.5%
  880      1943     26.55    1.3%
  900      2034     19.51    0.9%
  920      2143      18.3    0.8%
  940      2180     14.53    0.6%
  960      2179     14.86    0.6%
  980      2246     22.12    0.9%
 1000      2278     13.92    0.6%
 1020      2326      21.8    0.9%

Quality and confidence:
param     error
q         0.006

Model:
Time ~=        0
    + q    2.222
              µs

Reads = 1 + (0 * q)
Writes = 1 + (0 * q)

Pallet: "pallet_contracts", Extrinsic: "reinstrument", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Contracts PristineCode (r:1 w:0)
Storage: Contracts CodeStorage (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    23.83
    + c    65.12
              µs

Reads = 1 + (0 * c)
Writes = 1 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
    0     25.75     0.219    0.8%
    2     156.3     1.965    1.2%
    4     285.9     5.028    1.7%
    6     412.6     7.899    1.9%
    8     541.9     1.237    0.2%
   10     668.2     0.866    0.1%
   12     799.3     11.58    1.4%
   14     938.8     11.13    1.1%
   16      1070     12.89    1.2%
   18      1191     10.72    0.8%
   20      1316     11.38    0.8%
   22      1445     13.84    0.9%
   24      1573     13.57    0.8%
   26      1740     5.404    0.3%
   28      1849     12.51    0.6%
   30      2010     6.756    0.3%
   32      2098     14.81    0.7%
   34      2248     13.96    0.6%
   36      2374     10.49    0.4%
   38      2498     21.09    0.8%
   40      2615     12.65    0.4%
   42      2761     14.58    0.5%
   44      2874     11.25    0.3%
   46      2990     14.54    0.4%
   48      3118     9.061    0.2%
   50      3305     13.85    0.4%
   52      3430     5.002    0.1%
   54      3546     9.152    0.2%
   56      3672     4.679    0.1%
   58      3795     17.99    0.4%
   60      3913     17.92    0.4%
   62      4048     6.975    0.1%
   64      4186     12.01    0.2%
   66      4336     24.35    0.5%
   68      4465     10.19    0.2%
   70      4581     17.61    0.3%
   72      4694     14.35    0.3%
   74      4839     14.72    0.3%
   76      4955     16.01    0.3%
   78      5071     11.65    0.2%
   80      5195     7.744    0.1%
   82      5313        10    0.1%
   84      5490     20.25    0.3%
   86      5584     12.96    0.2%
   88      5713     18.05    0.3%
   90      5840     9.269    0.1%
   92      5971     18.47    0.3%
   94      6083     15.22    0.2%
   96      6207     13.06    0.2%
   98      6468     23.16    0.3%
  100      6590     16.04    0.2%
  102      6693     9.917    0.1%
  104      6835     11.69    0.1%
  106      6960     17.24    0.2%
  108      7099     20.86    0.2%
  110      7242     15.91    0.2%
  112      7365     28.33    0.3%
  114      7460     14.83    0.1%
  116      7635      53.2    0.6%
  118      7717      27.2    0.3%
  120      7840     15.42    0.1%
  122      7988     19.26    0.2%
  124      8100     23.21    0.2%
  126      8226     30.78    0.3%
  128      8364     37.54    0.4%

Quality and confidence:
param     error
c         0.033

Model:
Time ~=    16.31
    + c    65.23
              µs

Reads = 1 + (0 * c)
Writes = 1 + (0 * c)

Pallet: "pallet_contracts", Extrinsic: "call_with_code_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    221.7
    + c    55.24
              µs

Reads = 4 + (0 * c)
Writes = 2 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
    0     228.1     0.193    0.0%
    2     337.4     0.268    0.0%
    4     455.2     14.05    3.0%
    6       551     1.287    0.2%
    8     665.3     0.487    0.0%
   10     772.9     8.367    1.0%
   12     876.2     5.756    0.6%
   14      1004     10.19    1.0%
   16      1111     12.92    1.1%
   18      1207     7.487    0.6%
   20      1311     6.368    0.4%
   22      1415     8.489    0.5%
   24      1516     10.32    0.6%
   26      1679      14.6    0.8%
   28      1779     13.47    0.7%
   30      1882     13.41    0.7%
   32      1984     13.19    0.6%
   34      2104     16.09    0.7%
   36      2244     2.577    0.1%
   38      2293     10.05    0.4%
   40      2403     13.37    0.5%
   42      2500     13.43    0.5%
   44      2614     15.65    0.5%
   46      2713     12.78    0.4%
   48      2814     21.29    0.7%
   50      3019     23.57    0.7%
   52      3104     11.92    0.3%
   54      3213     10.48    0.3%
   56      3331     8.896    0.2%
   58      3417     12.86    0.3%
   60      3528     16.91    0.4%
   62      3646     13.53    0.3%
   64      3760     26.33    0.7%
   66      3860     11.79    0.3%
   68      3956     18.92    0.4%
   70      4076     20.97    0.5%
   72      4165     10.39    0.2%
   74      4277     15.29    0.3%
   76      4377     23.51    0.5%
   78      4497     16.91    0.3%
   80      4583     13.09    0.2%
   82      4688     22.23    0.4%
   84      4799     15.94    0.3%
   86      4899     16.69    0.3%
   88      5004     18.95    0.3%
   90      5103      13.2    0.2%
   92      5197     11.69    0.2%
   94      5307     13.59    0.2%
   96      5416     12.71    0.2%
   98      5740     17.51    0.3%
  100      5827     16.59    0.2%
  102      5926     11.77    0.1%
  104      6022     15.86    0.2%
  106      6147     18.48    0.3%
  108      6252     17.33    0.2%
  110      6345     10.77    0.1%
  112      6456     18.95    0.2%
  114      6576     9.429    0.1%
  116      6657     21.08    0.3%
  118      6800     21.21    0.3%
  120      6850     15.28    0.2%
  122      6956     13.39    0.1%
  124      7073     18.75    0.2%
  126      7186     14.88    0.2%
  128      7280     19.33    0.2%

Quality and confidence:
param     error
c         0.049

Model:
Time ~=    207.6
    + c    55.36
              µs

Reads = 4 + (0 * c)
Writes = 2 + (0 * c)

Pallet: "pallet_contracts", Extrinsic: "instantiate_with_code", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Contracts CodeStorage (r:1 w:1)
Storage: Contracts AccountCounter (r:1 w:1)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Timestamp Now (r:1 w:0)
Storage: System Account (r:1 w:1)
Storage: Contracts PristineCode (r:0 w:1)
Storage: Contracts OwnerInfoOf (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    264.3
    + c    143.9
    + s    1.736
              µs

Reads = 5 + (0 * c) + (0 * s)
Writes = 6 + (0 * c) + (0 * s)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c     s   mean µs  sigma µs       %
    0  1024      2054     6.909    0.3%
    1  1024      2227     8.067    0.3%
    2  1024      2364     11.09    0.4%
    3  1024      2334     11.88    0.5%
    4  1024      2649     16.21    0.6%
    5  1024      2780     12.33    0.4%
    6  1024      2766      12.3    0.4%
    7  1024      3068     11.85    0.3%
    8  1024      3200     13.07    0.4%
    9  1024      3206     14.85    0.4%
   10  1024      3493     15.17    0.4%
   11  1024      3714     7.456    0.2%
   12  1024      3608      10.5    0.2%
   13  1024      3943     13.56    0.3%
   14  1024      4075     16.66    0.4%
   15  1024      4040      15.2    0.3%
   16  1024      4342     19.27    0.4%
   17  1024      4523     13.86    0.3%
   18  1024      4497     9.668    0.2%
   19  1024      4794     19.39    0.4%
   20  1024      4931      10.8    0.2%
   21  1024      4916     16.19    0.3%
   22  1024      5209     9.765    0.1%
   23  1024      5343     24.78    0.4%
   24  1024      5345     21.02    0.3%
   25  1024      5679     17.47    0.3%
   26  1024      5811     10.53    0.1%
   27  1024      5796     13.54    0.2%
   28  1024      6148     36.35    0.5%
   29  1024      6227     13.12    0.2%
   30  1024      6215     20.82    0.3%
   31  1024      6529     24.24    0.3%
   32  1024      6628     30.81    0.4%
   33  1024      6705     22.69    0.3%
   34  1024      7006     10.81    0.1%
   35  1024      7189     32.37    0.4%
   36  1024      7120     27.93    0.3%
   37  1024      7381     16.87    0.2%
   38  1024      7559     19.96    0.2%
   39  1024      7537      31.7    0.4%
   40  1024      7836     40.52    0.5%
   41  1024      7978     30.56    0.3%
   42  1024      7939     24.84    0.3%
   43  1024      8240     20.15    0.2%
   44  1024      8374     22.39    0.2%
   45  1024      8335     10.23    0.1%
   46  1024      8658     27.82    0.3%
   47  1024      8789     23.46    0.2%
   48  1024      8757     26.42    0.3%
   49  1024      9156     37.15    0.4%
   50  1024      9356     30.54    0.3%
   51  1024      9298     31.81    0.3%
   52  1024      9636     43.72    0.4%
   53  1024      9724     28.11    0.2%
   54  1024      9706     41.93    0.4%
   55  1024     10000     35.57    0.3%
   56  1024     10160     51.42    0.5%
   57  1024     10100     17.52    0.1%
   58  1024     10390     23.49    0.2%
   59  1024     10550     25.87    0.2%
   60  1024     10510     12.72    0.1%
   61  1024     10820     28.21    0.2%
   62     0      9193     30.66    0.3%
   62    20      9186     38.84    0.4%
   62    40      9210     35.02    0.3%
   62    60      9234     21.95    0.2%
   62    80      9264     12.99    0.1%
   62   100      9308     13.75    0.1%
   62   120      9352     20.14    0.2%
   62   140      9405     14.22    0.1%
   62   160      9396     10.15    0.1%
   62   180      9457     29.17    0.3%
   62   200      9487     19.77    0.2%
   62   220      9553      40.7    0.4%
   62   240      9561     32.89    0.3%
   62   260      9620     30.59    0.3%
   62   280      9614     17.76    0.1%
   62   300      9656     27.04    0.2%
   62   320      9706     23.55    0.2%
   62   340      9810     56.25    0.5%
   62   360      9742     12.89    0.1%
   62   380      9825     31.96    0.3%
   62   400      9829     25.33    0.2%
   62   420      9870     16.31    0.1%
   62   440      9903     10.41    0.1%
   62   460      9954     22.38    0.2%
   62   480      9963     18.37    0.1%
   62   500     10010     19.62    0.1%
   62   520     10040      28.3    0.2%
   62   540     10110     23.68    0.2%
   62   560     10110     18.08    0.1%
   62   580     10140     29.06    0.2%
   62   600     10190     27.72    0.2%
   62   620     10250     39.84    0.3%
   62   640     10270     33.44    0.3%
   62   660     10290     31.84    0.3%
   62   680     10330        41    0.3%
   62   700     10350     25.15    0.2%
   62   720     10410     26.32    0.2%
   62   740     10410     15.84    0.1%
   62   760     10460     26.82    0.2%
   62   780     10480     10.92    0.1%
   62   800     10550     25.28    0.2%
   62   820     10550     26.04    0.2%
   62   840     10610     27.77    0.2%
   62   860     10620     20.93    0.1%
   62   880     10640     10.47    0.0%
   62   900     10700     29.23    0.2%
   62   920     10760     46.61    0.4%
   62   940     10820     55.77    0.5%
   62   960     10800      33.2    0.3%
   62   980     10840     30.62    0.2%
   62  1000     10870     25.44    0.2%
   62  1020     10910     33.27    0.3%
   62  1024     10950     36.95    0.3%

Quality and confidence:
param     error
c         0.123
s         0.007

Model:
Time ~=    226.4
    + c    143.8
    + s    1.751
              µs

Reads = 5 + (0 * c) + (0 * s)
Writes = 6 + (0 * c) + (0 * s)

Pallet: "pallet_contracts", Extrinsic: "instantiate", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Contracts CodeStorage (r:1 w:1)
Storage: Contracts AccountCounter (r:1 w:1)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Timestamp Now (r:1 w:0)
Storage: System Account (r:1 w:1)
Storage: Contracts OwnerInfoOf (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    171.7
    + s    1.701
              µs

Reads = 6 + (0 * s)
Writes = 5 + (0 * s)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    s   mean µs  sigma µs       %
    0     173.2     0.212    0.1%
   20     204.3     0.131    0.0%
   40     243.2     2.274    0.9%
   60     273.3     0.241    0.0%
   80     307.6     0.398    0.1%
  100     341.8     0.347    0.1%
  120     374.9     0.366    0.0%
  140     409.5     0.322    0.0%
  160     445.8     4.085    0.9%
  180     478.1     0.286    0.0%
  200     511.3     0.508    0.0%
  220     546.4     0.353    0.0%
  240     580.1     0.542    0.0%
  260     617.1     5.513    0.8%
  280     659.9     14.17    2.1%
  300     692.3     12.07    1.7%
  320     718.9     7.113    0.9%
  340     756.4     12.17    1.6%
  360     791.7     9.387    1.1%
  380     821.8     9.494    1.1%
  400     856.1     5.987    0.6%
  420     886.3     4.427    0.4%
  440     927.9     12.21    1.3%
  460       962     14.96    1.5%
  480     992.1     6.511    0.6%
  500      1028       9.1    0.8%
  520      1072     17.06    1.5%
  540      1091     4.035    0.3%
  560      1124     5.361    0.4%
  580      1168     14.38    1.2%
  600      1208     15.72    1.3%
  620      1234     13.34    1.0%
  640      1281     14.92    1.1%
  660      1301     14.23    1.0%
  680      1334     10.69    0.8%
  700      1378     16.17    1.1%
  720      1415     15.74    1.1%
  740      1450     14.33    0.9%
  760      1475     14.62    0.9%
  780      1503     11.42    0.7%
  800      1550     15.53    1.0%
  820      1575     13.89    0.8%
  840      1624      13.6    0.8%
  860      1657     12.59    0.7%
  880      1669     7.712    0.4%
  900      1721     15.15    0.8%
  920      1751     13.76    0.7%
  940      1784     13.26    0.7%
  960      1807     11.26    0.6%
  980      1854     14.58    0.7%
 1000      1891     11.64    0.6%
 1020      1927     9.664    0.5%

Quality and confidence:
param     error
s         0.001

Model:
Time ~=    170.6
    + s    1.719
              µs

Reads = 6 + (0 * s)
Writes = 5 + (0 * s)

Pallet: "pallet_contracts", Extrinsic: "call", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    138.3
              µs

Reads = 4
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    138.3
              µs

Reads = 4
Writes = 2

Pallet: "pallet_contracts", Extrinsic: "upload_code", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Contracts CodeStorage (r:1 w:1)
Storage: Contracts PristineCode (r:0 w:1)
Storage: Contracts OwnerInfoOf (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    51.82
    + c    65.64
              µs

Reads = 1 + (0 * c)
Writes = 3 + (0 * c)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    c   mean µs  sigma µs       %
    0     50.25     0.293    0.5%
    1     118.3     0.258    0.2%
    2     181.7      0.29    0.1%
    3     245.1     0.597    0.2%
    4     316.2     3.084    0.9%
    5     374.5     0.389    0.1%
    6     439.7      6.22    1.4%
    7     508.7     0.579    0.1%
    8     572.7     6.269    1.0%
    9     654.1     14.68    2.2%
   10     704.6     11.31    1.6%
   11     767.8     11.28    1.4%
   12     830.9      10.6    1.2%
   13     919.5     15.99    1.7%
   14     975.8     12.58    1.2%
   15      1036     11.53    1.1%
   16      1117     11.48    1.0%
   17      1168     14.94    1.2%
   18      1236     13.33    1.0%
   19      1301     14.49    1.1%
   20      1360      16.1    1.1%
   21      1425     15.19    1.0%
   22      1486     16.11    1.0%
   23      1555      11.7    0.7%
   24      1607     12.17    0.7%
   25      1719     8.334    0.4%
   26      1768     15.46    0.8%
   27      1850      6.78    0.3%
   28      1900     14.21    0.7%
   29      1959      13.5    0.6%
   30      2019      13.5    0.6%
   31      2085      15.2    0.7%
   32      2152     14.61    0.6%
   33      2230     19.94    0.8%
   34      2288     11.83    0.5%
   35      2372     8.304    0.3%
   36      2412     13.83    0.5%
   37      2489        21    0.8%
   38      2545     19.55    0.7%
   39      2613     6.823    0.2%
   40      2665     13.37    0.5%
   41      2717      10.3    0.3%
   42      2784     14.64    0.5%
   43      2855     9.697    0.3%
   44      2927     8.377    0.2%
   45      2977     19.98    0.6%
   46      3042      18.6    0.6%
   47      3118     11.05    0.3%
   48      3187     9.767    0.3%
   49      3311     16.49    0.4%
   50      3362     18.09    0.5%
   51      3423      14.5    0.4%
   52      3489      7.61    0.2%
   53      3557     19.87    0.5%
   54      3609     13.34    0.3%
   55      3684      13.6    0.3%
   56      3736     16.17    0.4%
   57      3810     15.02    0.3%
   58      3879     15.08    0.3%
   59      3932     17.35    0.4%
   60      3997     9.298    0.2%
   61      4056     15.63    0.3%
   62      4140     16.06    0.3%
   63      4181      10.4    0.2%
   64      4249     11.51    0.2%

Quality and confidence:
param     error
c          0.04

Model:
Time ~=    49.73
    + c    65.78
              µs

Reads = 1 + (0 * c)
Writes = 3 + (0 * c)

Pallet: "pallet_contracts", Extrinsic: "remove_code", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Contracts OwnerInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:0 w:1)
Storage: Contracts PristineCode (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    24.53
              µs

Reads = 1
Writes = 3

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    24.53
              µs

Reads = 1
Writes = 3

Pallet: "pallet_contracts", Extrinsic: "seal_caller", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    216.9
    + r    47.28
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     213.8     0.133    0.0%
    1     264.3     0.259    0.0%
    2     312.8     0.389    0.1%
    3     361.9      4.01    1.1%
    4     407.3     0.765    0.1%
    5     453.6     1.354    0.2%
    6     499.3     0.866    0.1%
    7     548.2     0.988    0.1%
    8     597.2      3.68    0.6%
    9     644.4     5.554    0.8%
   10     686.1     1.017    0.1%
   11     738.1     6.778    0.9%
   12     782.9     4.849    0.6%
   13     825.8     1.649    0.1%
   14     883.2      4.43    0.5%
   15     929.9     8.802    0.9%
   16     974.1     2.668    0.2%
   17      1025     10.57    1.0%
   18      1083     12.79    1.1%
   19      1128     12.66    1.1%
   20      1168     12.03    1.0%

Quality and confidence:
param     error
r         0.085

Model:
Time ~=    214.6
    + r    47.72
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_address", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    216.8
    + r    47.01
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     213.8     0.263    0.1%
    1     263.7      0.32    0.1%
    2       312     0.405    0.1%
    3     357.8      0.63    0.1%
    4     405.1     0.464    0.1%
    5     454.5     3.953    0.8%
    6     498.5     1.616    0.3%
    7     547.5     0.976    0.1%
    8     594.9     3.936    0.6%
    9     639.2     1.436    0.2%
   10     686.2     3.762    0.5%
   11     733.9     7.456    1.0%
   12     777.9     2.081    0.2%
   13     824.1     2.642    0.3%
   14     898.7     15.35    1.7%
   15     938.1     11.49    1.2%
   16     978.3      11.9    1.2%
   17      1017     6.082    0.5%
   18      1068     9.103    0.8%
   19      1109      5.06    0.4%
   20      1157     5.572    0.4%

Quality and confidence:
param     error
r         0.099

Model:
Time ~=    215.8
    + r    47.36
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_gas_left", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    217.5
    + r    46.46
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     215.9     2.907    1.3%
    1       263     0.238    0.0%
    2     310.6     0.384    0.1%
    3     356.2     0.502    0.1%
    4     403.3     0.586    0.1%
    5     448.8     1.728    0.3%
    6     494.2     0.448    0.0%
    7     545.2     4.003    0.7%
    8     601.8     10.32    1.7%
    9     640.4     11.31    1.7%
   10     680.4     3.581    0.5%
   11     731.4      11.7    1.5%
   12     789.3     2.897    0.3%
   13     832.8     4.468    0.5%
   14     868.8      1.16    0.1%
   15     914.6     1.582    0.1%
   16     963.9     4.016    0.4%
   17      1007     5.116    0.5%
   18      1060     12.29    1.1%
   19      1099     6.172    0.5%
   20      1146     11.51    1.0%

Quality and confidence:
param     error
r         0.088

Model:
Time ~=    218.2
    + r    46.62
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_balance", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    222.1
    + r    136.3
              µs

Reads = 5 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0       215     1.745    0.8%
    1     355.2     1.228    0.3%
    2     503.4      12.2    2.4%
    3     625.9     4.648    0.7%
    4     766.4      7.99    1.0%
    5     905.5     11.33    1.2%
    6      1035     12.42    1.1%
    7      1173     13.79    1.1%
    8      1302     10.89    0.8%
    9      1452     9.073    0.6%
   10      1585     11.51    0.7%
   11      1726     5.002    0.2%
   12      1867     6.799    0.3%
   13      1978     14.84    0.7%
   14      2142     9.258    0.4%
   15      2264     11.62    0.5%
   16      2413     18.04    0.7%
   17      2536     10.27    0.4%
   18      2689     10.12    0.3%
   19      2798     12.83    0.4%
   20      2940     20.27    0.6%

Quality and confidence:
param     error
r         0.157

Model:
Time ~=    220.7
    + r    136.4
              µs

Reads = 5 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_value_transferred", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    217.7
    + r    46.74
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     216.7     2.628    1.2%
    1     263.5     0.318    0.1%
    2     311.4      0.31    0.0%
    3     357.5     0.493    0.1%
    4       406     0.827    0.2%
    5     450.5     0.582    0.1%
    6     497.2      1.53    0.3%
    7       544      1.21    0.2%
    8     602.3     12.43    2.0%
    9     639.1     4.288    0.6%
   10     684.3     3.515    0.5%
   11     752.9     11.29    1.5%
   12       794     1.493    0.1%
   13       825     13.52    1.6%
   14     875.2     3.804    0.4%
   15     927.3     10.65    1.1%
   16     974.4      11.8    1.2%
   17      1016     9.296    0.9%
   18      1067     11.97    1.1%
   19      1109     12.31    1.1%
   20      1146     3.011    0.2%

Quality and confidence:
param     error
r          0.11

Model:
Time ~=    218.2
    + r    47.04
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_minimum_balance", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    217.6
    + r    46.44
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     213.7      0.21    0.0%
    1     263.7     0.313    0.1%
    2     314.8     5.218    1.6%
    3     357.2     0.575    0.1%
    4     404.8       1.1    0.2%
    5     448.9     0.651    0.1%
    6     495.6     1.057    0.2%
    7     544.8     2.711    0.4%
    8     588.5     0.604    0.1%
    9     641.3     11.14    1.7%
   10     680.9     2.997    0.4%
   11     727.8     6.737    0.9%
   12     775.1     3.011    0.3%
   13     831.1     14.55    1.7%
   14     883.8     14.13    1.5%
   15     917.2     2.898    0.3%
   16     967.9     9.227    0.9%
   17      1010     8.178    0.8%
   18      1061     13.21    1.2%
   19      1098     3.339    0.3%
   20      1148     11.39    0.9%

Quality and confidence:
param     error
r         0.095

Model:
Time ~=      217
    + r    46.76
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_block_number", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=      217
    + r    46.29
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     213.6     0.159    0.0%
    1     263.2     0.564    0.2%
    2       315     3.204    1.0%
    3     355.9     0.544    0.1%
    4     402.7     0.594    0.1%
    5     448.3     1.068    0.2%
    6     496.8     5.921    1.1%
    7     547.6     8.485    1.5%
    8     587.2     1.049    0.1%
    9     633.1     1.213    0.1%
   10     681.7     8.169    1.1%
   11     725.1     5.071    0.6%
   12     767.6     1.506    0.1%
   13     816.8      7.76    0.9%
   14     866.8     1.949    0.2%
   15     926.8     12.24    1.3%
   16     968.9      13.9    1.4%
   17      1010     10.87    1.0%
   18      1053     8.534    0.8%
   19      1104     11.71    1.0%
   20      1147     9.399    0.8%

Quality and confidence:
param     error
r         0.094

Model:
Time ~=      216
    + r    46.64
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_now", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    216.4
    + r    46.49
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     213.7     0.079    0.0%
    1     263.6     1.135    0.4%
    2     314.7     4.783    1.5%
    3     356.1     0.345    0.0%
    4     403.1     0.994    0.2%
    5     448.1     0.488    0.1%
    6     494.1     0.683    0.1%
    7     543.5     0.915    0.1%
    8       588      1.54    0.2%
    9     636.6     4.901    0.7%
   10     681.7     6.988    1.0%
   11     722.6     0.915    0.1%
   12     770.7      4.58    0.5%
   13       828     11.28    1.3%
   14     876.6     12.59    1.4%
   15     915.3     1.754    0.1%
   16     966.7     9.589    0.9%
   17      1009     10.53    1.0%
   18      1064     14.88    1.3%
   19      1111     12.53    1.1%
   20      1151     12.13    1.0%

Quality and confidence:
param     error
r         0.094

Model:
Time ~=    214.5
    + r    46.93
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_weight_to_fee", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    217.5
    + r    118.8
              µs

Reads = 5 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     213.9     0.203    0.0%
    1     339.1     5.729    1.6%
    2     455.6     0.453    0.0%
    3     573.3      1.74    0.3%
    4     696.1      7.48    1.0%
    5     820.3     13.88    1.6%
    6     939.6     13.15    1.4%
    7      1053     12.76    1.2%
    8      1180     14.81    1.2%
    9      1286      14.9    1.1%
   10      1406     11.35    0.8%
   11      1536     13.16    0.8%
   12      1649     13.05    0.7%
   13      1769     14.09    0.7%
   14      1883     12.31    0.6%
   15      1999     10.36    0.5%
   16      2130     13.96    0.6%
   17      2257     8.417    0.3%
   18      2365     11.72    0.4%
   19      2487     10.23    0.4%
   20      2595     13.98    0.5%

Quality and confidence:
param     error
r         0.142

Model:
Time ~=    218.7
    + r    119.2
              µs

Reads = 5 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_gas", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=      126
    + r    23.86
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     122.5     0.088    0.0%
    1     150.6     1.508    1.0%
    2     172.8     0.138    0.0%
    3       198     0.294    0.1%
    4     221.4     0.239    0.1%
    5       245     0.181    0.0%
    6     269.9     0.672    0.2%
    7     298.3     4.662    1.5%
    8     316.4      0.27    0.0%
    9     339.5     0.358    0.1%
   10     363.1     0.377    0.1%
   11     390.7     0.649    0.1%
   12     414.5     0.398    0.0%
   13     437.5     0.511    0.1%
   14     460.7     0.517    0.1%
   15     483.7     0.764    0.1%
   16     508.7     1.696    0.3%
   17     530.9     1.571    0.2%
   18     561.3     12.28    2.1%
   19     577.4     0.781    0.1%
   20     602.2     4.161    0.6%

Quality and confidence:
param     error
r         0.042

Model:
Time ~=    125.8
    + r    23.92
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_input", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    216.3
    + r    45.99
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     213.7     0.252    0.1%
    1     266.7     2.133    0.7%
    2     309.2     0.433    0.1%
    3     353.9     0.589    0.1%
    4     401.2     0.443    0.1%
    5     450.9      5.19    1.1%
    6     493.1     5.404    1.0%
    7     537.7     0.978    0.1%
    8     583.7     0.702    0.1%
    9     642.5     15.66    2.4%
   10       676     5.942    0.8%
   11     720.8     4.564    0.6%
   12     766.7     9.466    1.2%
   13     815.4     12.74    1.5%
   14     880.4     14.82    1.6%
   15     907.8     4.872    0.5%
   16     955.6     8.198    0.8%
   17     997.8     1.885    0.1%
   18      1060     14.21    1.3%
   19      1089     8.798    0.8%
   20      1150     12.55    1.0%

Quality and confidence:
param     error
r         0.114

Model:
Time ~=    215.7
    + r    46.39
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_input_per_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    294.6
    + n    11.87
              µs

Reads = 4 + (0 * n)
Writes = 1 + (0 * n)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    n   mean µs  sigma µs       %
    0     262.4     0.249    0.0%
   20     506.1     3.531    0.6%
   40     748.4     10.25    1.3%
   60      1010     9.057    0.8%
   80      1236     13.47    1.0%
  100      1472     12.11    0.8%
  120      1712     15.33    0.8%
  140      1955     15.83    0.8%
  160      2192      16.9    0.7%
  180      2438      22.6    0.9%
  200      2671     12.67    0.4%
  220      2915     9.501    0.3%
  240      3153     12.01    0.3%
  260      3399     15.11    0.4%
  280      3625     14.94    0.4%
  300      3879     17.64    0.4%
  320      4117     14.33    0.3%
  340      4340     16.58    0.3%
  360      4579     13.36    0.2%
  380      4820     17.69    0.3%
  400      5056     17.46    0.3%
  420      5283     13.62    0.2%
  440      5525     20.31    0.3%
  460      5765     11.81    0.2%
  480      5987     17.83    0.2%
  500      6219     16.54    0.2%
  520      6474     20.51    0.3%
  540      6709     15.36    0.2%
  560      6942     17.94    0.2%
  580      7178     24.65    0.3%
  600      7453     18.04    0.2%
  620      7646     26.65    0.3%
  640      7887     25.78    0.3%
  660      8140     38.87    0.4%
  680      8367     15.49    0.1%
  700      8602     16.11    0.1%
  720      8841     20.22    0.2%
  740      9072     23.71    0.2%
  760      9315     40.94    0.4%
  780      9549     21.98    0.2%
  800      9787     30.72    0.3%
  820     10030     27.28    0.2%
  840     10240     22.41    0.2%
  860     10490     22.45    0.2%
  880     10730     18.85    0.1%
  900     10960     23.03    0.2%
  920     11180     22.02    0.1%
  940     11430     13.14    0.1%
  960     11690     20.65    0.1%
  980     11930     25.12    0.2%
 1000     12160      11.7    0.0%
 1020     12420     37.51    0.3%

Quality and confidence:
param     error
n         0.003

Model:
Time ~=    295.6
    + n    11.87
              µs

Reads = 4 + (0 * n)
Writes = 1 + (0 * n)

Pallet: "pallet_contracts", Extrinsic: "seal_return", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    209.9
    + r    1.984
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0       210     0.251    0.1%
    1     213.4     4.899    2.2%

Quality and confidence:
param     error
r         1.635

Model:
Time ~=      210
    + r    3.385
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_return_per_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    212.4
    + n    0.185
              µs

Reads = 4 + (0 * n)
Writes = 1 + (0 * n)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    n   mean µs  sigma µs       %
    0     211.7     0.159    0.0%
   20     216.1     0.186    0.0%
   40     219.7     0.156    0.0%
   60     223.9     0.284    0.1%
   80     227.6     0.309    0.1%
  100     231.3     0.223    0.0%
  120     234.7     0.408    0.1%
  140     238.2     0.209    0.0%
  160     242.2     0.436    0.1%
  180       246     0.137    0.0%
  200     250.2     1.088    0.4%
  220     253.2     0.225    0.0%
  240       257     0.286    0.1%
  260     260.4      0.21    0.0%
  280     265.5      1.55    0.5%
  300     267.8     0.134    0.0%
  320     271.4     0.267    0.0%
  340     275.3     0.252    0.0%
  360     279.1     0.181    0.0%
  380     282.8     0.244    0.0%
  400     286.8     0.224    0.0%
  420     299.4     2.055    0.6%
  440     305.6     1.503    0.4%
  460     305.1     1.538    0.5%
  480       308     0.195    0.0%
  500     312.6     0.652    0.2%
  520     310.5     3.061    0.9%
  540     312.5     0.443    0.1%
  560     316.2     0.182    0.0%
  580     320.7     2.667    0.8%
  600     323.6      0.58    0.1%
  620     332.4     8.249    2.4%
  640     337.7     5.366    1.5%
  660     336.4     3.516    1.0%
  680     338.4     0.499    0.1%
  700       342     0.278    0.0%
  720     349.5     3.632    1.0%
  740     350.5     3.169    0.9%
  760     353.2     0.286    0.0%
  780     365.2     0.158    0.0%
  800     360.1     0.317    0.0%
  820     367.2     4.544    1.2%
  840     375.9     2.806    0.7%
  860     371.5     0.184    0.0%
  880     375.8     0.177    0.0%
  900       386     10.37    2.6%
  920     385.5     3.925    1.0%
  940       387     0.474    0.1%
  960     390.1     0.166    0.0%
  980     393.6     0.273    0.0%
 1000     401.8     5.887    1.4%
 1020     404.9     7.597    1.8%

Quality and confidence:
param     error
n             0

Model:
Time ~=      213
    + n    0.188
              µs

Reads = 4 + (0 * n)
Writes = 1 + (0 * n)

Pallet: "pallet_contracts", Extrinsic: "seal_terminate", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)
Storage: Contracts DeletionQueue (r:1 w:1)
Storage: Contracts OwnerInfoOf (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=      214
    + r    51.47
              µs

Reads = 4 + (4 * r)
Writes = 1 + (5 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     213.9     0.154    0.0%
    1     265.4     0.276    0.1%

Quality and confidence:
param     error
r         0.105

Model:
Time ~=    213.9
    + r    51.48
              µs

Reads = 4 + (4 * r)
Writes = 1 + (5 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_random", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)
Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=      228
    + r      157
              µs

Reads = 5 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     215.5     4.244    1.9%
    1     377.9     5.084    1.3%
    2       537     3.016    0.5%
    3     701.2     11.17    1.5%
    4       854     5.202    0.6%
    5      1012     11.34    1.1%
    6      1176     5.952    0.5%
    7      1338     3.023    0.2%
    8      1481     4.482    0.3%
    9      1650     6.198    0.3%
   10      1807     9.583    0.5%
   11      1961     10.04    0.5%
   12      2092     10.81    0.5%
   13      2280     6.101    0.2%
   14      2434     13.36    0.5%
   15      2579     20.52    0.7%
   16      2731     13.63    0.4%
   17      2881     20.62    0.7%
   18      3062     17.13    0.5%
   19      3206      17.3    0.5%
   20      3358     13.48    0.4%

Quality and confidence:
param     error
r         0.167

Model:
Time ~=    227.8
    + r    156.9
              µs

Reads = 5 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_deposit_event", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    222.6
    + r    283.2
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     210.9     0.217    0.1%
    1     503.7     0.384    0.0%
    2       800     16.47    2.0%
    3      1074     9.338    0.8%
    4      1359     12.99    0.9%
    5      1639     15.29    0.9%
    6      1923      11.6    0.6%
    7      2197     9.986    0.4%
    8      2492     13.62    0.5%
    9      2796      12.5    0.4%
   10      3056     12.43    0.4%
   11      3338     10.39    0.3%
   12      3641     10.08    0.2%
   13      3919     13.46    0.3%
   14      4185     8.525    0.2%
   15      4455     17.48    0.3%
   16      4744     15.49    0.3%
   17      5053     13.25    0.2%
   18      5324     17.36    0.3%
   19      5591     10.43    0.1%
   20      5897      25.6    0.4%

Quality and confidence:
param     error
r         0.194

Model:
Time ~=    224.4
    + r    283.3
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_deposit_event_per_topic_and_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)
Storage: System EventTopics (r:100 w:100)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    539.4
    + t    291.6
    + n    80.97
              µs

Reads = 4 + (100 * t) + (0 * n)
Writes = 1 + (100 * t) + (0 * n)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    t     n   mean µs  sigma µs       %
    0    16      1801     19.08    1.0%
    1    16      2133     9.254    0.4%
    2    16      2436     11.99    0.4%
    3    16      2738     15.38    0.5%
    4     0      1683      10.9    0.6%
    4     1      1759     15.03    0.8%
    4     2      1824     7.504    0.4%
    4     3      1904     13.49    0.7%
    4     4      1980     15.84    0.8%
    4     5      2057     16.06    0.7%
    4     6      2144     18.49    0.8%
    4     7      2202     12.07    0.5%
    4     8      2297     13.05    0.5%
    4     9      2391     15.87    0.6%
    4    10      2450      9.71    0.3%
    4    11      2542     14.35    0.5%
    4    12      2610     17.01    0.6%
    4    13      2658     14.87    0.5%
    4    14      2830     11.03    0.3%
    4    15      2908     13.92    0.4%
    4    16      2983     15.97    0.5%

Quality and confidence:
param     error
t          2.15
n         0.423

Model:
Time ~=    521.5
    + t    282.8
    + n    82.33
              µs

Reads = 4 + (100 * t) + (0 * n)
Writes = 1 + (100 * t) + (0 * n)

Pallet: "pallet_contracts", Extrinsic: "seal_debug_message", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:0)
Storage: Contracts ContractInfoOf (r:1 w:1)
Storage: Contracts CodeStorage (r:1 w:0)
Storage: Timestamp Now (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    132.5
    + r     39.5
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     129.7     0.194    0.1%
    1     172.6     0.225    0.1%
    2     212.5     0.264    0.1%
    3     252.5     1.551    0.6%
    4     289.5     0.405    0.1%
    5       328     1.614    0.4%
    6     369.2      0.55    0.1%
    7     411.2     4.188    1.0%
    8     446.2     2.214    0.4%
    9       488     4.851    0.9%
   10       526     4.562    0.8%
   11     569.7     0.924    0.1%
   12     608.2     1.224    0.2%
   13     655.9     9.971    1.5%
   14     691.1     10.12    1.4%
   15     723.7     1.447    0.1%
   16     764.2     6.376    0.8%
   17     807.2     5.946    0.7%
   18     847.9     9.462    1.1%
   19     892.5     15.35    1.7%
   20     919.5     1.921    0.2%

Quality and confidence:
param     error
r         0.075

Model:
Time ~=    131.5
    + r    39.73
              µs

Reads = 4 + (0 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_set_storage", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Skipped Metadata (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    55.21
    + r    402.1
              µs

Reads = 4 + (100 * r)
Writes = 1 + (100 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     213.6     0.169    0.0%
    1       548     1.837    0.3%
    2     901.4     6.848    0.7%
    3      1271     8.931    0.7%
    4      1648     17.26    1.0%
    5      2042     13.99    0.6%
    6      2434     10.55    0.4%
    7      2808      18.1    0.6%
    8      3164     15.68    0.4%
    9      3654     9.775    0.2%
   10      4063     22.27    0.5%
   11      4466     17.36    0.3%
   12      4835     20.11    0.4%
   13      5263     27.85    0.5%
   14      5608     31.73    0.5%
   15      6040      14.5    0.2%
   16      6487     34.53    0.5%
   17      6895     28.04    0.4%
   18      7480     24.45    0.3%
   19      7887     36.35    0.4%
   20      8279     16.65    0.2%

Quality and confidence:
param     error
r         1.009

Model:
Time ~=    43.55
    + r    405.1
              µs

Reads = 4 + (100 * r)
Writes = 1 + (100 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_set_storage_per_new_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Skipped Metadata (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    611.6
    + n    27.24
              µs

Reads = 105 + (0 * n)
Writes = 103 + (0 * n)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    n   mean µs  sigma µs       %
    0     554.2     10.35    1.8%
    1     645.6     7.335    1.1%
    2     669.3     6.441    0.9%
    3     697.2      2.72    0.3%
    4     720.6     1.741    0.2%
    5     755.2     12.61    1.6%
    6     774.5     5.178    0.6%
    7     809.4      6.77    0.8%
    8       832     2.511    0.3%
    9     857.7      4.04    0.4%
   10     882.7     2.802    0.3%
   11     911.1     5.613    0.6%
   12     941.3     8.133    0.8%
   13     965.1     8.284    0.8%
   14     989.3     2.713    0.2%
   15      1028       9.7    0.9%
   16      1041     2.586    0.2%

Quality and confidence:
param     error
n         0.242

Model:
Time ~=    603.4
    + n    28.06
              µs

Reads = 105 + (0 * n)
Writes = 103 + (0 * n)

Pallet: "pallet_contracts", Extrinsic: "seal_set_storage_per_old_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Skipped Metadata (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    633.9
    + n     10.1
              µs

Reads = 105 + (0 * n)
Writes = 103 + (0 * n)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    n   mean µs  sigma µs       %
    0     551.4     0.908    0.1%
    1     635.1     8.162    1.2%
    2     662.9     4.232    0.6%
    3     672.6     3.037    0.4%
    4     685.8     2.585    0.3%
    5     685.5     2.309    0.3%
    6     694.4       3.9    0.5%
    7     712.8     8.803    1.2%
    8     710.2     1.501    0.2%
    9       721     4.292    0.5%
   10     725.5      3.22    0.4%
   11     739.8     5.503    0.7%
   12     741.9     2.558    0.3%
   13     761.8     6.203    0.8%
   14     775.4     3.297    0.4%
   15       795     5.182    0.6%
   16     795.2     2.634    0.3%

Quality and confidence:
param     error
n         0.317

Model:
Time ~=    618.6
    + n    11.39
              µs

Reads = 105 + (0 * n)
Writes = 103 + (0 * n)

Pallet: "pallet_contracts", Extrinsic: "seal_clear_storage", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Skipped Metadata (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    93.88
    + r    378.8
              µs

Reads = 5 + (100 * r)
Writes = 3 + (100 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     216.6     2.321    1.0%
    1     550.8     0.948    0.1%
    2     886.7     3.287    0.3%
    3      1253     9.917    0.7%
    4      1591     11.44    0.7%
    5      1962     12.14    0.6%
    6      2320     16.49    0.7%
    7      2698     16.99    0.6%
    8      3044      18.2    0.5%
    9      3505     18.06    0.5%
   10      3869     15.81    0.4%
   11      4237     26.97    0.6%
   12      4616      23.1    0.5%
   13      4972     20.23    0.4%
   14      5347     20.87    0.3%
   15      5748      9.94    0.1%
   16      6132     13.13    0.2%
   17      6518     30.41    0.4%
   18      7092     37.47    0.5%
   19      7475     36.51    0.4%
   20      7870     27.41    0.3%

Quality and confidence:
param     error
r         0.937

Model:
Time ~=    77.92
    + r    382.2
              µs

Reads = 5 + (100 * r)
Writes = 3 + (100 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_clear_storage_per_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Skipped Metadata (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    609.9
    + n    10.19
              µs

Reads = 105 + (0 * n)
Writes = 103 + (0 * n)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    n   mean µs  sigma µs       %
    0       559     11.26    2.0%
    1     607.9     6.968    1.1%
    2     644.1     3.393    0.5%
    3     645.7     3.522    0.5%
    4       658     1.132    0.1%
    5     664.1     1.522    0.2%
    6     672.3     3.002    0.4%
    7       680     1.448    0.2%
    8     690.3     2.973    0.4%
    9     690.8     5.971    0.8%
   10     705.4     6.572    0.9%
   11     713.8       4.2    0.5%
   12       720     3.011    0.4%
   13     730.2     3.231    0.4%
   14       752     1.916    0.2%
   15     769.3     1.963    0.2%
   16     782.5     10.14    1.2%

Quality and confidence:
param     error
n          0.23

Model:
Time ~=    599.9
    + n    10.93
              µs

Reads = 105 + (0 * n)
Writes = 103 + (0 * n)

Pallet: "pallet_contracts", Extrinsic: "seal_get_storage", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Skipped Metadata (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=      129
    + r    317.7
              µs

Reads = 4 + (100 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     215.4     0.161    0.0%
    1     489.3     2.015    0.4%
    2     774.2     2.946    0.3%
    3      1088     10.68    0.9%
    4      1386      8.91    0.6%
    5      1694     13.73    0.8%
    6      2007     10.98    0.5%
    7      2314      12.5    0.5%
    8      2597     10.82    0.4%
    9      2979     25.67    0.8%
   10      3264     11.48    0.3%
   11      3619     26.16    0.7%
   12      3896     32.21    0.8%
   13      4232     21.17    0.5%
   14      4521     18.22    0.4%
   15      4858      18.4    0.3%
   16      5195     35.09    0.6%
   17      5552     27.43    0.4%
   18      5969     30.76    0.5%
   19      6283     30.43    0.4%
   20      6631     32.82    0.4%

Quality and confidence:
param     error
r         0.707

Model:
Time ~=    107.4
    + r    320.5
              µs

Reads = 4 + (100 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_get_storage_per_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Skipped Metadata (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    569.1
    + n     63.1
              µs

Reads = 104 + (0 * n)
Writes = 1 + (0 * n)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    n   mean µs  sigma µs       %
    0     489.9     1.623    0.3%
    1     610.8     2.155    0.3%
    2     708.2     1.421    0.2%
    3     765.8     2.949    0.3%
    4     836.1     9.345    1.1%
    5     889.5     1.826    0.2%
    6     956.4     11.31    1.1%
    7      1009     4.934    0.4%
    8      1073     8.684    0.8%
    9      1126     10.34    0.9%
   10      1186     9.788    0.8%
   11      1253     8.905    0.7%
   12      1305     7.823    0.5%
   13      1374       2.5    0.1%
   14      1435     6.314    0.4%
   15      1528     13.51    0.8%
   16      1594     13.04    0.8%

Quality and confidence:
param     error
n         0.358

Model:
Time ~=    553.3
    + n    64.25
              µs

Reads = 104 + (0 * n)
Writes = 1 + (0 * n)

Pallet: "pallet_contracts", Extrinsic: "seal_contains_storage", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Skipped Metadata (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    128.4
    + r    290.7
              µs

Reads = 4 + (100 * r)
Writes = 1 + (0 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     213.9     0.199    0.0%
    1     464.2     5.979    1.2%
    2     720.3     1.784    0.2%
    3      1006      8.25    0.8%
    4      1284      10.4    0.8%
    5      1533     8.803    0.5%
    6      1836     14.76    0.8%
    7      2122      16.6    0.7%
    8      2380     17.73    0.7%
    9      2700     12.78    0.4%
   10      2980     12.26    0.4%
   11      3308     28.74    0.8%
   12      3597     22.86    0.6%
   13      3953     26.22    0.6%
   14      4134     31.44    0.7%
   15      4493     28.84    0.6%
   16      4726     24.13    0.5%
   17      5076     13.87    0.2%
   18      5460      27.3    0.4%
   19      5725     33.51    0.5%
   20      6028     30.06    0.4%

Quality and confidence:
param     error
r         0.634

Model:
Time ~=    112.5
    + r    292.3
              µs

Reads = 4 + (100 * r)
Writes = 1 + (0 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_contains_storage_per_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Skipped Metadata (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    516.4
    + n    9.691
              µs

Reads = 104 + (0 * n)
Writes = 1 + (0 * n)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    n   mean µs  sigma µs       %
    0     466.2     7.145    1.5%
    1     514.2     1.544    0.3%
    2     547.3     4.049    0.7%
    3     551.4     1.722    0.3%
    4     561.1     0.994    0.1%
    5     572.1     2.666    0.4%
    6     575.5     1.057    0.1%
    7     584.6     1.159    0.1%
    8     594.7     7.742    1.3%
    9       600     2.575    0.4%
   10     619.1     5.892    0.9%
   11     611.6     1.938    0.3%
   12     620.9     1.707    0.2%
   13     633.1     6.338    1.0%
   14     645.1     3.195    0.4%
   15     669.3     8.594    1.2%
   16     673.4     4.728    0.7%

Quality and confidence:
param     error
n         0.223

Model:
Time ~=    508.2
    + n    10.29
              µs

Reads = 104 + (0 * n)
Writes = 1 + (0 * n)

Pallet: "pallet_contracts", Extrinsic: "seal_take_storage", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Skipped Metadata (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    109.2
    + r    410.2
              µs

Reads = 5 + (100 * r)
Writes = 3 + (100 * r)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    r   mean µs  sigma µs       %
    0     215.4     0.206    0.0%
    1     586.3     2.575    0.4%
    2     951.6     4.758    0.4%
    3      1350     11.37    0.8%
    4      1714     7.212    0.4%
    5      2143     10.68    0.4%
    6      2528     10.27    0.4%
    7      2925     13.76    0.4%
    8      3287     16.06    0.4%
    9      3803     9.874    0.2%
   10      4171     27.18    0.6%
   11      4612     29.48    0.6%
   12      4995     26.32    0.5%
   13      5390     25.93    0.4%
   14      5778      18.3    0.3%
   15      6202     24.09    0.3%
   16      6655     26.83    0.4%
   17      7073     13.86    0.1%
   18      7647     41.63    0.5%
   19      8073     29.49    0.3%
   20      8453      21.8    0.2%

Quality and confidence:
param     error
r         0.877

Model:
Time ~=    87.97
    + r    412.9
              µs

Reads = 5 + (100 * r)
Writes = 3 + (100 * r)

Pallet: "pallet_contracts", Extrinsic: "seal_take_storage_per_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Skipped Metadata (r:0 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    661.4
    + n    64.93
              µs

Reads = 105 + (0 * n)
Writes = 103 + (0 * n)

Min Squares Analysis
========
-- Extrinsic Time --

Data points distribution:
    n   mean µs  sigma µs       %
    0     586.5     2.812    0.4%
    1     704.8     1.511    0.2%
    2     800.9<truncated>...

ERROR: Unable to push ./frame/contracts/src/weights.rs

@yarikbratashchuk
Copy link
Contributor Author

@athei, same problem, sorry for the inconvenience.
Next time I make PR from my account.

@athei
Copy link
Member

athei commented Feb 3, 2022

No worries. We are trying to resolve this situation by improving the bot: paritytech/bench-bot#54

But for now it would be best to open from your account until that issue is resolved.

@joao-paulo-parity
Copy link
Contributor

@athei
Copy link
Member

athei commented Feb 3, 2022

@yarikbratashchuk Can you apply that diff?

@yarikbratashchuk
Copy link
Contributor Author

@athei, applied.

@athei
Copy link
Member

athei commented Feb 3, 2022

Can you address the two open comments?

@yarikbratashchuk
Copy link
Contributor Author

Oh, sorry, missed that. Done.

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.

Thanks!

@athei
Copy link
Member

athei commented Feb 7, 2022

We merged something in the mean time. You need to resolve conflicts, again.

@athei
Copy link
Member

athei commented Feb 7, 2022

So I can't find an error there. I am willing to merge this in an imperfect state since it is still unstable. If you merge master in a way so that you keep the weight changes from master and only add the functions you added then we can merge.

@athei
Copy link
Member

athei commented Feb 8, 2022

bot merge

@paritytech-processbot paritytech-processbot bot merged commit aa7a756 into paritytech:master Feb 8, 2022
Smart Contracts automation moved this from In Progress to Done Feb 8, 2022
grishasobol pushed a commit to gear-tech/substrate that referenced this pull request Mar 28, 2022
…ritytech#10617)

* seal_call_code implementation

- tests
- benchmark

* Addressing @xgreenx's comments

* Fix test-linux-stable-int

* Rename seal_call_code to seal_delegate_call

* Pass value unchanged into lib contract

* Address @athei's comments

- whitespace .wat issues
- wrong/missing .wat comments
- redundant .wat calls/declarations

- change order of functions (seal_delegate_call right after seal_call)
  in decls, tests, benchmark
- fix comments, move doc comments to enum variants
- remove unnecessary empty lines

- rename runtime cost DelegateCall to DelegateCallBase
- do not set CallFlags::ALLOW_REENTRY for delegate_call

* Do not pass CallFlags::ALLOWS_REENTRY for delegate_call

* Update comment for seal_delegate_call and CallFlags

* Addressing @athei's comments (minor)

* Allow reentry for a new frame after delegate_call (revert)

* Same seal_caller and seal_value_transferred for lib contract

- test
- refactor frame args due to review
- logic for seal_caller (please review)

* Put caller on frame for delegate_call, minor fixes

* Update comment for delegate_call

* Addressing @athei's comments

* Update weights generated by benchmark

* Improve comments

* Address @HCastano's comments

* Update weights, thanks @joao-paulo-parity

* Improve InvalidCallFlags error comment
driemworks added a commit to ideal-lab5/substrate-offchain-ipfs that referenced this pull request May 9, 2022
* Make some UI test expectations crisper (#10791)

* Make some UI test expectations crisper

* Update frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs

* Update UI test expectations

* Missing newlines

* More whitespace issues

* contracts: `is_contract(address)` and `caller_is_origin()` are added to API (#10789)

* is_contract() and caller_is_origin() added to Ext API

* is_contract() exposed in wasm runtime.rs

* + test for is_contract()

* + seal_is_contract benchmark

* caller_is_origin() exposed to wasm/runtime.rs and covered by a test

* + seal_caller_is_origin benchmark

* Update frame/contracts/src/exec.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Update frame/contracts/src/exec.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Update frame/contracts/src/exec.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Update frame/contracts/src/wasm/runtime.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Update frame/contracts/src/wasm/runtime.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Update frame/contracts/src/wasm/runtime.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Update frame/contracts/src/exec.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* identation fix for benchmark macroses; test cosmetic improvement

* benchmark fix

* + is_contract() wasm test

* + caller_is_origin() wasm test

* Apply suggestions from code review

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* is_contract() to borrow param instead of taking ownership

* phrasing improved

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* fixed wasm tests according to @athei feedback

* dead code warnings suppressed by unstable-interface attributes

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
Co-authored-by: Parity Bot <admin@parity.io>

* maybe_total_supply in pallet-assets (#10799)

* maybe_total_supply in pallet-assets

* Update frame/assets/src/functions.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Referenda and Conviction Voting pallets (#10195)

* Initial draft of new referendum state machine.

* Docs

* Fixes

* Fixes

* Add conviction-voting pallet

* Basic build

* Building

* Some TODOs

* Tests building

* Add missing file

* Basic lifecycle test

* Add couple of tests

* Another test

* More tests

* Fixes

* Fixes

* Formatting

* Fixes

* Tests

* Fixes

* Fixes

* More tests

* Formatting

* First few benchmarks

* First few benchmarks

* Defered queue servicing

* More testing

* Benchmarks

* Fiddly benchmark

* Final nudge benchmarks

* Formatting

* Formatting

* Finished up benchmarks

* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_referenda --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/referenda/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Events finished

* Missing file

* No GenesisConfig for Referenda

* Formatting

* Docs

* Docs

* Docs

* Per-class conviction voting

* New test & mock utils

* More tests

* Tests

* Tests finished 🎉

* Benchmarking stuff

* Fixes

* Test harness

* Test harness

* Benchmarks for Conviction=Voting

* Benchmarking pipeline complete

* Docs

* Formatting

* Remove unneeded warning

* Fix UI tests

* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_conviction_voting --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/conviction-voting/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Docs

* Update frame/conviction-voting/src/vote.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* update sp-runtime version

* MEL Fixes for Referenda and Conviction Voting (#10725)

* free maxencodedlen

* more maxencodedlen

* more MEL

* more mel

* disable storage info

* More Referenda Patches (#10760)

* basic fixes

* fix benchmarking

* fix license

* prevent panic in curve math

* fmt

* bump crate versions

* Update mock.rs

Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* More efficient WASM instance memory decommit on macos (#10801)

* More efficient WASM instance memory decommit on macos

* Apply suggestions from code review

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Updated error message

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* make inner field of IdentityFields pub (#10773)

* Corrected description of clear_attribute extrinsic (#10729)

* block validators after X sessions, update mock runtime for test

* sp-maybe-compressed-blob: reduce boilerplate code (#10814)

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* `seal_delegate_call` api function (support for library contracts)  (#10617)

* seal_call_code implementation

- tests
- benchmark

* Addressing @xgreenx's comments

* Fix test-linux-stable-int

* Rename seal_call_code to seal_delegate_call

* Pass value unchanged into lib contract

* Address @athei's comments

- whitespace .wat issues
- wrong/missing .wat comments
- redundant .wat calls/declarations

- change order of functions (seal_delegate_call right after seal_call)
  in decls, tests, benchmark
- fix comments, move doc comments to enum variants
- remove unnecessary empty lines

- rename runtime cost DelegateCall to DelegateCallBase
- do not set CallFlags::ALLOW_REENTRY for delegate_call

* Do not pass CallFlags::ALLOWS_REENTRY for delegate_call

* Update comment for seal_delegate_call and CallFlags

* Addressing @athei's comments (minor)

* Allow reentry for a new frame after delegate_call (revert)

* Same seal_caller and seal_value_transferred for lib contract

- test
- refactor frame args due to review
- logic for seal_caller (please review)

* Put caller on frame for delegate_call, minor fixes

* Update comment for delegate_call

* Addressing @athei's comments

* Update weights generated by benchmark

* Improve comments

* Address @HCastano's comments

* Update weights, thanks @joao-paulo-parity

* Improve InvalidCallFlags error comment

* Add Storage Info to Various Pallets (#10810)

* atomic swap

* bounties

* bounties fmt

* gilt

* indices

* nicks

* randomness-collective-flip

* recovery

* reuse maxapprovals

* Update tests.rs

* Update frame/randomness-collective-flip/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* use the correct bound

* complete recovery

* use `bounded_vec` macro

* Update tests.rs

* transaction payment

* uniques

* mmr

* example offchain worker

* beefy-mmr

* Update frame/recovery/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use BoundedVec instead of a type-parameterized BoundedString

* cargo fmt

* Update frame/atomic-swap/src/lib.rs

* use config const

* Update lib.rs

* update mel_bound

* fmt

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* fixed regression in inline docs (#10819)

* try-runtime-cli: Add to docs (#10822)

* try-runtime-cli: Add to docs of pre/post hooks

* Add note about --ws-max-out-buffer-capacity 1000

* Bump serde from 1.0.132 to 1.0.136 (#10816)

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.132 to 1.0.136.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.132...v1.0.136)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* uodate tests, ipfs tests failing

* --dev implies --tmp (#10828)

* Add a new host function for reporting fatal errors; make WASM backtraces readable when printing out errors (#10741)

* Add a new host function for reporting fatal errors

* Fix one of the wasmtime executor tests

* Have `#[runtime_interface(wasm_only)]` actually mean WASM-only, and not no_std-only

* Print out errors through `Display` instead of `Debug`

* Switch one more trait to require `Error` for its error instead of only `Debug`

* Align to review comments

* specify ipfs version, update tests

* Add db params for export-state CLI command (#10830)

* update tests, cleanup

* Allow `SetBalance` to handle error when trying to kill acount with reference counter. (#10826)

* bug found

* fix logic

* a little simpler

* add test

* UncheckedExtrinsic: Harden decode and clarify `EXTRINSIC_FORMAT_VERSION` (#10829)

* UncheckedExtrinsic: Harden decode and clarify `EXTRINSIC_FORMAT_VERSION`

* Apply suggestions from code review

* fix typo

* pallet-staking: Add extrinsic `force_apply_min_commission` (#10786)

* pallet-staking: Add extrinsic `force_apply_min_commission`

* Add benchmarks

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Bound iteration by  max_validator_count

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Only apply to 1 validator

* Update doc comments

* Uncomment tests

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Accept signed origins

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Remove contains_key check

* Add test for try_mutate_exists

* Impove try_mutate_exists docs

* Delete redundant try_mutate_exists tests;

* Delete residual from removed test

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Return an error when the stash does not exist

* Update try_mutate_exist doc wording

* Update frame/staking/src/pallet/mod.rs

* Apply suggestions from code review

Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Upgradable contracts using `set_code` function (#10690)

* poc logic

* set_code_hash impl, tests, benchmark

* Address @xgreenx's comments

* Move func defs closer to set_storage

* Check if code exists

- increment/decrement codehash refcount

* Document error for non-existing code hash

* Revert unrelated change

* Changes due to @athei's review

* Fix error handling

- comment errors: ReturnCodes
- update mock ext implementation
- return Error::CodeNotFound when no code for such hash

* Emit ContractCodeUpdated when setting new code_hash

* Address @athei's comments

* Move related defs to the bottom

* Minor comment update

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Improve docs

* Improve docs

* Update frame/contracts/src/wasm/runtime.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Refactor set_code_hash test

* Minor change to benchmark

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Minor change to benchmark

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Minor comment refactor

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Address @HCastano's comments

* Update seal_set_code_hash comment

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Move set_code_hash after delegate_call

* Move function to the bottom

* Moved and changed banchmark, added verify block

* Bring back previous benchmark

* Remove skip_meta for seal_set_code_hash

* Bring back skip_meta for seal_set_storage_per_new_kb

* Apply weights

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Separate wasmi and wasmer sandbox implementations into their own modules (#10563)

* Moves wasmi specific `ImportResolver` and `MemoryTransfer` impls to submodule

* Splits context store environmental, moves impl `Externals` to wasmi backend

* Adds wasmer sandbox backend stub module

* Move sandbox impl code to backend specific modules

* Moves wasmi stuff

* Fixes value conversion

* Makes it all compile

* Remove `with_context_store`

* Moves `WasmerBackend` to the impl

* Reformat the source

* Moves wasmer MemoryWrapper

* Reformats the source

* Fixes mutability

* Moves backend impls to a submodule

* Fix visibility

* Reformat the source

* Feature gate wasmer backend module

* Moves wasmi memory allocation to backend module

* Rename WasmerBackend to Backend

* Refactor dispatch result decoding, get rid of Wasmi types in common sandbox code

* Reformat the source

* Remove redundant prefixes in backend functions

* Remove wasmer-sandbox from default features

* Post-review changes

* Add conversion soundness proof

* Remove redundant prefix

* Removes now redundant clone_inner

* Add `Error::SandboxBackend`, refactor invoke result

* Fix comments

* Rename `Error::SandboxBackend` to `Sandbox`

* Simplifies logic in `wasmer_backend::invoke`

* Fixes memory management

* Show Network ID when creating and inspecting (#10838)

Signed-off-by: Antonio Yang <yanganto@gmail.com>

* Reduce overhead of generating network event metrics (#10839)

* Fix reentrancy of FrozenBalance::died hook (#10473)

* assets: execute `died` hook outside of mutate

Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>

* assets: extend tests for `died` hook

Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>

* assets: update doc of FrozenBalance::died

Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>

* assets: review fixes

- fix cases where `died` should not have been called
- use `Option<DeadConsequence>` instead of `DeadConsequence`

Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>

* assets: update comment in mock.rs

Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>

* assets: return `Remove` in dead_account

The return value is ignored in the only case that it is produced
by a call, but having it this way makes it more understandable.

Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>

* allow trailing comma (#10841)

* build-script-utils: allow reading the git commit hash from env var (#10845)

* build-script-utils: allow reading the git commit hash from env var

* build-script-utils: make the env var name substrate specific

* Don't create DB leaves when syncing historic blocks (#10844)

* Don't create DB leaves when syncing historic blocks

* Changed leaves check and added test

* fmt

* cleanup, use unsigned tx when appropriate

* add weights

* fix broken link (#10846)

* subkey: Support `--version` cli command (#10853)

* subkey: Support `--version` cli command

* FMT :facepalm:

* Remove `u32_trait` (#10850)

* Remove `u32_trait`

This trait only existed because there wasn't any const generic support at time of creation. However,
we now have support for it :)

* FMT

* wasm-builder: Support latest nightly (#10837)

* wasm-builder: Support latest nightly

With latest nightly, aka rust version 1.60+ namespaced features are added. This changes the handling
of optional dependencies. We currently have features that enable optional dependencies when `std` is
enabled. This was before no problem, but now the wasm-builder detects them as enabled. To support
the transition period until 1.60 is released as stable, this pr adds an heuristic to not enable these
optional crates in the wasm build when they are enabled in the `std` feature. This heuristic fails
when someones enables these optional dependencies from the outside as well as via the `std` feature,
however we hope that no one is doing this at the moment. When namespaced features are enabled, these
dependencies needs to be enabled using `dep:dependency-name` to solve this properly.

https://doc.rust-lang.org/cargo/reference/unstable.html#namespaced-features

* Remove accidentally added features

* update tests, remove unneeded params

* min authorities check before removal

* contracts: Fix `seal_call` weights (#10796)

* Fix call weights

* Fix instantiate benchmark

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Remove stale and superflous comments

* `decrement_refcount` should be infallible

* Don't hardcode increment_refcount, decrement_refcount

* Rename CopyIn/CopyOut

* Fix warning in tests

Co-authored-by: Parity Bot <admin@parity.io>

* Enable the `parking_lot` feature for `tokio` (#10855)

* [ci] fix publish-rustdocs (#10858)

* Fix beefy mock ecdsa keys (#10854)

Compressed ECDSA keys requires to have 0x02 or 0x03 as their first byte
in order to allow public key recovery.

Nevertheless the test was working because of the `unwrap_or_default()`
at the end of the conversion routine (i.e. the invalid keys were
converted to an empty vector).

* Mark sync_state_genSyncSpec JSON-RPC as safe (#10832)

* Mark sync_state_genSyncSpec JSON-RPC as safe

* Note that parameter is unused

* Ideally I'd wait for compilation to be finished before pushing, but it's really taking a long time

* Remove deny_unsafe parameter

* Remove unused dependency

* Reduce CPU overhead of gossip (#10859)

* sp-core-hashing: use the `digest::Digest` trait to handle the hashing function uniformly (#10835)

* sp-core-hashing: use sha3 instead of tiny-keccak

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* use blake2 instead of blake2-rfc

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* improve som hashing of sp-core and sp-api-proc-macro

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Some nits

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* cargo fmt

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Use fully qualified sytnax for `retain_mut` (#10865)

* add llvm (#10864)

* refactor election score (#10834)

* refactor election score

* Test for ord

* remove reference

* vec -> slice

* change iter to iter_by_significance

* improve doc

* fix typo

* add explanation about [u128; 3]

* consolidate threshold and epsilon

* random fixes

* rename

* remove Into

* make iter_by_sig private

* remove vec

* Fix tests

* Measure per byte and not kb for certain benchmarks (#10863)

* Tidy Democracy (#10867)

* add test

* Assorted refactorings

* complete test

* saturating math

* final check

* use `default`

Co-authored-by: Gav Wood <gavin@parity.io>

* cleanup storage maps, cleanup unused imports

* sc-executor: Improve logging (#10869)

Improves the logging by switching to `tracing` for a better log output. Besides that, it also adds a
trace for the function being executed.

* fix test issues

* Track allowed requests for state/warp sync (#10843)

* Track allowed requests for state/warp sync

* Added missing allowed_requests resets

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* fmt

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Slots: Ensure that a race betwen finalized and best number is taken care off (#10876)

* Remove old lock file (#10879)

* Further reduce the CPU overhead of networking metrics (#10875)

* Simplify `num_connected_peers`

* Track requested peer counts

* Revert "Track requested peer counts"

This reverts commit 9f1c8704353df6afc17ed7e9f4ab8d8e29466ae4.

* Remove `substrate_sub_libp2p_peerset_num_requested` metric

* Remove two unused functions that I forgot to get rid of in previous commit

* Introduce `BoundedVec::iter_mut` (#10884)

* Introduce iters into BoundedVec

* Fix

* Remove unneeded funcs

* Update frame/support/src/storage/bounded_vec.rs

* Update frame/support/src/storage/bounded_vec.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Slots: Log total proposing duration as milliseconds (#10886)

Parachains have currently a total proposing time of 500ms, so it this
currently always prints `0`. While actually the value is not `0` ;)

* staking: Clarify reward calc docs (#10890)

* tracing: Adds `init_for_tests` (#10893)

This function is useful for tests. It will enable `TRACE` logging and also uses the libtest aware writer.

* make submissions pub (#10899)

* contracts: Allow stack height metering to be disabled (#10877)

* Allow stack height metering to be disabled

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Parity Bot <admin@parity.io>

* Rename Uniques Error::Unknown to something more sensible (#10895)

* Rename Uniques Error::Unknown to something more sensible

* Typos

* Typos

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* state-machine: Move all functionality from trie backend to the essence (#10904)

* state-machine: Move all functionality from trie backend to the essence

This is required for some future changes of me and it also makes more sense to have all the
functionality inside the essence. Besides that it changes the child root cache to directly
cache the hash.

* Update primitives/state-machine/src/trie_backend_essence.rs

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

* FMT

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

* staking: Remove `SessionInterface` supertrait (#10901)

* consensus-slots: cleanup SlotDuration config (#10878)

* consensus-slots: cleanup the SlotDuration config

* fix tests

* address review comments

* add contracts pallet + rpc to runtime

* Replace libsecp256k1 with k256 in FRAME related code (#10883)

* Replace libsecp256k1 with k256 in beefy-mmr

* Port of FRAME `contracts` benchmarking from `libsecp256k1` to `k256`

* Newtype to allow `Pcg32` rng usage with `k256` in contracts benchmarks

* Use `sp-io::crypto` to generate dummy keys in `contracts` bechmarks

* More compact code

* Cargo fmt

* Build `sp-keystore` only for dev profile

* Move public key generation back to the `map`

* Clean obsolete BABE's weight data (#10748)

* Clean obsolete BABE weight data
* Take out test assertion from check closure
* Optimize metadata access using `HeaderMetadata` trait
* Apply suggestions from code review
* Introduce finalize and import pre-commit synchronous actions
* Do not hold locks between internal methods calls
* Remove unused generic bound
* Apply suggestions from code review
* Register BABE's pre-commit actions on `block_import` instead of `start_babe`
* PreCommit actions should be `Fn` instead of `FnMut`
* More robust safenet in case of malformed finality notifications

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Factor DB weights out into their own files (#10908)

* Factor DB weights out into their own files

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Review fixes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix CI

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Weights in own mod

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Get rid of unnecessary use of `async-std` in non-test code (#10891)

* No longer generate specs with consensus_engine field (#10346)

* No longer generate specs with consensus_engine field

* #[allow(unused)]

* Upgrading parity-scale-codec to v3 (#10825)

* Upgraded dependencies

* Adapting code to scale v3

* Empty commit to trigger CI

* Triggering CI

* Fixing UI test

* Remove superfluous dev-dep added by #9228

* Cryout for CI

* sc-cli: Fix bugs after switching to clap3 (#10920)

* sc-cli: Fix bugs after switching to clap3

Before switching to clap3 we support cli options like `--reserved-nodes A B` and after you needed to
pass `--reserved-nodes` cli option multiple times `--reserved-nodes A --reserved-nodes B`. This is
fixed by setting `multiple_occurrences(true)` option. This also done for all the other `Vec` cli
options in `sc-cli`. Besides that `--sync` wasn't supporting case insensitive parsing of the value.
This is now also supported. For both regressions a test is added. Besides that the pr removes all
the `rename_all = PascalCase` attributes, because they are not needed. All other `ArgEnum`s were
checked and all are already using `ignore_case(true)`.

* Bring back `PascalCase`, because otherwise it falls back to `kebab-case`...

* Storage benchmarking (#10897)

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP: DB benchmarking

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Simplify code

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove old files

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove old files

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Minimize changes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add license

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove dependencies

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Extend template

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Linter

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Linter

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Beauty fixes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove default

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add feature

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove seed

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* CI wakeup

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Review fixes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Adding doc

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Adding doc

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Improve template

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Do not expose columns

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix ColumnId

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Nicer template prints

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Cleanup

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix json path

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Simplify `bench_write` logic

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Invert tx before the second commit

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* add transfer assets extrinsic

* add chain ext

* Minor improvements to `bounded_vec` and `defensive`.  (#10873)

* Fix a few things in bounded_vec

* add test for try_extend

* Update frame/support/src/storage/bounded_vec.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* some review comments

* use swap

* remove clone

* use pop instead of truncate

* remove warn

* review comments

* Update frame/support/src/storage/bounded_vec.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* fix rustdoc

* fix links

* undo link

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Replace libsecp256k1 with secp256k1 (#10798)

* Replace libsecp256k1 with secp256k1

* Wipe ecdsa secret key from memory on drop

* Some comments for a known issue

* Safer core crypto primitives `from_slice` constructor

Previous version panics if slice lenght is not the expected one.

* Unit test fix

* Enable use of global secp256k1 context

* Better comments for ecdsa `Pair` drop

* Replace `libsecp256k1` with `seco256k1` in `beefy-mmr`

Used to convert ecdsa public key to ETH address

* Replace `libsecp256k1` with `secp256k1` in FRAME `contracts`benchmarks

* Temporary rollback of `beefy-mmr` to libsecp256k1

Check for detected build issues

* Cargo fmt

* Rollback of FRAME `contracts` benchmarks to `libsecp256k1`

* Rollback for unrelated changes

* Typo fix

* Add comments for deprecated `ecdsa_verify` and `secp256k1_ecdsa_recover`

* Integrate try-runtime into substrate node template (#10909)

* [10892-integrate-try-runtime-into-node-template] - Integrated try-runtime into node template

* [10892-integrate-try-runtime-into-node-template] Added match arms for try-runtime in command.rs

* [10892-integrate-try-runtime-into-node-template] Added match arms for try-runtime in command.rs

* Added feature flag for try-runtime in node-template/node and enabled try-runtime for node-template/runtime

* Added missing type annotations for try-runtime SubCommand in node-template

* Added missing type annotations for try-runtime SubCommand in node-template

* Implemented frame_try_runtime::TryRuntime<Block> for the node-template Runtime

* doc corrections (#10936)

* #10576: generic utility to unsubscribe from broadcast upon drop of the rx-side. (#10708)

* #10576: refactor `sc-utils::notification` and `sc-client-api::notifications`, so that they use common subscribe/unsubscribe routines

* Add some docs. Reorganise `sc-utils::notification`

* `sc-clent-api::notifications` and `sc-utils::notification` — ensure the SubscriptionGuard is dropped before the Rx-channel

* `sc-utils::pubsub::SubscriptionGuard` make it a bit more ergonomic.

Let the `Rx` to be put inside of the `SubscriptionGuard`, so that the latter shall guarantee the order:
- first unsubscribe;
- then drop the `Rx`.

* Being less zealous with splitting the modules into little pieces

* rework pubsub: the concrete usage should only define a good registry type

* sc-client-api::notifications: make it comply with the reworked pubsub

* cargo fmt

* make sc-client-api tests work

* Address the review notes

* cargo fmt

* Describe the behaviour of pubsub registry

* Doc-comments for module `sc-utils::pubsub`

* Fix: it used to send notifications regardless of the filter setup during subscription

* `sc-client-api::StorageNotifications` the API does not have to require mut-self-reference.

As a result `sc-service::Client` does not have to wrap its `storage_notifications` into a Mutex.

* cargo fmt

* Several changes addressing the notes by @bckhr.

- Remove the `impl Default for StorageNotifications<Block>`;
- no need for groupping the `remove_from` and `listen_from` into a separate `helpers` module;
- remove unnecessary import `use registry::SubscribeOp`.

* Add a doc-comment to the `sc-client::notifications::SubscribeOp`

* As per @bkchr note on the unproven assertion: behave gracefully upon receiving a duplicate subscription-ID.

* sc-utils::pubsub: log when a registry yields an ID that does point to an existing sink

* `sc-utils::notifications`: payload materialized lazily

* Update Cargo.lock (after adding `log` as a dependency to the `sc-utils`)

* `sc-client-api::notifications`: introduce a struct (instead of a type def) for the notification message

* Get rid of `sc-utils::pubsub::Channel` trait (instead just use the `sc-utils::mpsc`)

* The SubsID is no more generic: the fact it is a `Copy` is known — no need to pass it by ref

* sc-utils::pubsub internals do not have to be generic over the channel type

* Rename Hub::dispatch into Hub::send

* That method was unnecessary (`SubscriberSink::render_notification`)

* cargo fmt

* No need for a separate UnsubscribeGuard type

* Ditch the type-def of SubsID in the sc-utils::pubsub, instead — just use the crate::id_sequence::SeqID

* Return the <Registry as Dispatch>::Ret when sending an item

* Make the `Hub<M, R>::lock_registry(...)` method more ergonomic

* cargo doc links

* cargo doc links

* Use a simpler name for the type

* cargo doc links

* Derive `Default` rather than implement it

* Derive `Default` rather than implement it

* Remove an unnecessary usage of type_name

* Define a more cautious order between sinks.remove->registry.unsubscribe and registry.subscribe->sinks.insert

* Hub: lock_registry_for_tests->map_registry_for_tests — a safer choice for a public API

* Replace Mutex over the shared Registry with a ReentrableMutex+RefCell

* sc-utils::pubsub: add tests for a panicking registry

* Add the missing copyright headers

* Arc<Vec<_>> -> Arc<[_]>

* Bring back MaxNominations as a metadata constant (#10947)

* chain ext: parse params and call transfer func

* Bump futures from 0.3.16 to 0.3.19 (#10930)

Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.16 to 0.3.19.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.16...0.3.19)

---
updated-dependencies:
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Clean up extra_constant renaming. (#10935)

Co-authored-by: Xiankun Cheng <xiankuncheng@Xiankuns-MacBook-Pro-2.local>

* Bump smallvec from 1.7.0 to 1.8.0 (#10949)

Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: smallvec
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* new pallet: whitelist pallet (#10159)

* pallet whitelist

* refactor a bit

* fmt

* address audit

* improve tests

* return Ok + refund

* add test for dispatching failing

* add dispatch_whitelisted_call_with_preimage

* fmt

* better name

* Consume all data on decode

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add error docs

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove phantom data

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use rust 2021

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update crate features

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make compile

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_whitelist --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/whitelist/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Bump Preimage max size

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_whitelist --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/whitelist/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Parity Bot <admin@parity.io>

* Release primitive crates (#10937)

* cargo set-version --bump major -p pallet-contracts-primitives

* cargo set-version --bump major -p sp-core

* cargo set-version --bump major -p sp-runtime-interface

* cargo set-version --bump major -p sp-wasm-interface

* cargo set-version --bump major -p sp-runtime

* cargo set-version --bump major -p sp-storage

* cargo set-version --bump major -p sp-rpc

* cargo set-version --bump major -p sp-io

* cargo set-version --bump major -p sp-trie

* cargo set-version -p sp-state-machine  -- 0.12.0

* cargo set-version -p sp-externalities  -- 0.12.0

* cargo set-version -p sp-keystore -- 0.12.0

* cargo set-version --bump major -p sp-keyring

* cargo set-version --bump major -p sp-version

* cargo set-version --bump major -p sp-tracing

* cargo set-version --bump major -p sp-application-crypto

* cargo set-version --bump major -p sp-arithmetic

* cargo unleash version bump-major -p sp-runtime-interface-proc-macro

* Add codec max-encoded-len feature to sp-arithmetic

* cargo unleash version bump-major -p sp-core-hashing-proc-macro

* Update new whitelist pallet to new primitive versions (#10953)

* sp-trie: Switch to thiserror and some other small cleanups (#10954)

* sp-trie: Switch to thiserror and some other small cleanups

* Add some extra method for converting a compact proof to a memory db

* Only maintain at most 1 `UnlockChunk` per era (#10670)

* Only maintain at most 1 `UnlockChunk` per era

* Bound `unlocking`

* Run cargo +nightly-2021-10-29 fmt

* Make benchmarks stuff compile

* Update frame/staking/src/lib.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Remove DerefMut; Implement neccesary methods directly

* Doc comments for new BoundedVec methods

* Fix benchmarks

* wip bonded_vec macro

* Correct rust doc

* Apply suggestions from code review

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update staking::Config impls

* Add MaxUnlockingChunks to more places

* Use defensive saturating add

* FMT

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* staking: Expose `MaxUnlockingChunks` in metadata as a const (#10958)

* Allow trailing commas for `bounded_vec!` (#10959)

* SimpleSlotWorker: Do not implement `SlotWorker` for all types implementing `SimpleSlotWorker` (#10934)

Because Rust currently doesn't support specialization, it prevents users from implementing
`SlotWorker` for their own types. This pr solves this by removing the generic implementation of
`SlotWorker` for `SimpleSlotWorker` and providing some wrapper type for that.

* Bump digest from 0.10.2 to 0.10.3 (#10960)

Bumps [digest](https://github.com/RustCrypto/traits) from 0.10.2 to 0.10.3.
- [Release notes](https://github.com/RustCrypto/traits/releases)
- [Commits](https://github.com/RustCrypto/traits/compare/digest-v0.10.2...digest-v0.10.3)

---
updated-dependencies:
- dependency-name: digest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump scale-info from 2.0.0 to 2.0.1 (#10965)

Bumps [scale-info](https://github.com/paritytech/scale-info) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/paritytech/scale-info/releases)
- [Changelog](https://github.com/paritytech/scale-info/blob/master/CHANGELOG.md)
- [Commits](https://github.com/paritytech/scale-info/commits)

---
updated-dependencies:
- dependency-name: scale-info
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add pr-custom-review config (#10968)

* Revise how staking configurations are set (#10955)

* Revise how staking configurations are set

fixes #10938

* Fix and add additional tests

* Format

* Formatting

* Add doc

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/staking/src/tests.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Format

* Fix build

* Update weights.rs

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Parity Bot <admin@parity.io>

* Bump libc from 0.2.112 to 0.2.119 (#10967)

Bumps [libc](https://github.com/rust-lang/libc) from 0.2.112 to 0.2.119.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.112...0.2.119)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump parity-db from 0.3.5 to 0.3.8 (#10970)

Bumps [parity-db](https://github.com/paritytech/parity-db) from 0.3.5 to 0.3.8.
- [Release notes](https://github.com/paritytech/parity-db/releases)
- [Commits](https://github.com/paritytech/parity-db/commits/v0.3.8)

---
updated-dependencies:
- dependency-name: parity-db
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [EPM pallet]: remove `number of signed submissions` (#10945)

* [EPM pallet]: remove `number of signed submissions`

Closing #9229

* fix tests

* remove needless assert

* Update frame/election-provider-multi-phase/src/lib.rs

* cargo fmt

Signed-off-by: Niklas <niklasadolfsson1@gmail.com>

* fix grumbles

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_election_provider_multi_phase --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/election-provider-multi-phase/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* drop `num_signed_submissions` in WeightInfo too

* fix build

Co-authored-by: Parity Bot <admin@parity.io>

* Refactored block body database scheme (#10779)

* Refactored tx storage database scheme

* Bump parity-db

* fmt

* Fix handling invalid index size + test

* Removed superflous result

* Minor changes

* fmt

* Deprecate "paritydb-experimental" CLI in favour or "paritydb" (#10975)

* Deprecate paritydb-experimental

* Updated comment

* [contracts] Stabilize "seal0" `is_contract` and `caller_is_origin`  (#10971)

* stabilize `seal_is_contract`

* stabilize `seal_caller_is_origin`

* Trie version migration pallet  (#10073)

* starting

* Updated from other branch.

* setting flag

* flag in storage struct

* fix flagging to access and insert.

* added todo to fix

* also missing serialize meta to storage proof

* extract meta.

* Isolate old trie layout.

* failing test that requires storing in meta when old hash scheme is used.

* old hash compatibility

* Db migrate.

* runing tests with both states when interesting.

* fix chain spec test with serde default.

* export state (missing trie function).

* Pending using new branch, lacking genericity on layout resolution.

* extract and set global meta

* Update to branch 4

* fix iterator with root flag (no longer insert node).

* fix trie root hashing of root

* complete basic backend.

* Remove old_hash meta from proof that do not use inner_hashing.

* fix trie test for empty (force layout on empty deltas).

* Root update fix.

* debug on meta

* Use trie key iteration that do not include value in proofs.

* switch default test ext to use inner hash.

* small integration test, and fix tx cache mgmt in ext.
test  failing

* Proof scenario at state-machine level.

* trace for db upgrade

* try different param

* act more like iter_from.

* Bigger batches.

* Update trie dependency.

* drafting codec changes and refact

* before removing unused branch no value alt hashing.
more work todo rename all flag var to alt_hash, and remove extrinsic
replace by storage query at every storage_root call.

* alt hashing only for branch with value.

* fix trie tests

* Hash of value include the encoded size.

* removing fields(broken)

* fix trie_stream to also include value length in inner hash.

* triedbmut only using alt type if inner hashing.

* trie_stream to also only use alt hashing type when actually alt hashing.

* Refactor meta state, logic should work with change of trie treshold.

* Remove NoMeta variant.

* Remove state_hashed trigger specific functions.

* pending switching to using threshold, new storage root api does not
make much sense.

* refactoring to use state from backend (not possible payload changes).

* Applying from previous state

* Remove default from storage, genesis need a special build.

* rem empty space

* Catch problem: when using triedb with default: we should not revert
nodes: otherwhise thing as trie codec cannot decode-encode without
changing state.

* fix compilation

* Right logic to avoid switch on reencode when default layout.

* Clean up some todos

* remove trie meta from root upstream

* update upstream and fix benches.

* split some long lines.

* UPdate trie crate to work with new design.

* Finish update to refactored upstream.

* update to latest triedb changes.

* Clean up.

* fix executor test.

* rust fmt from master.

* rust format.

* rustfmt

* fix

* start host function driven versioning

* update state-machine part

* still need access to state version from runtime

* state hash in mem: wrong

* direction likely correct, but passing call to code exec for genesis
init seem awkward.

* state version serialize in runtime, wrong approach, just initialize it
with no threshold for core api < 4 seems more proper.

* stateversion from runtime version (core api >= 4).

* update trie, fix tests

* unused import

* clean some TODOs

* Require RuntimeVersionOf for executor

* use RuntimeVersionOf to resolve genesis state version.

* update runtime version test

* fix state-machine tests

* TODO

* Use runtime version from storage wasm with fast sync.

* rustfmt

* fmt

* fix test

* revert useless changes.

* clean some unused changes

* fmt

* removing useless trait function.

* remove remaining reference to state_hash

* fix some imports

* Follow chain state version management.

* trie update, fix and constant threshold for trie layouts.

* update deps

* Update to latest trie pr changes.

* fix benches

* Verify proof requires right layout.

* update trie_root

* Update trie deps to  latest

* Update to latest trie versioning

* Removing patch

* update lock

* extrinsic for sc-service-test using layout v0.

* Adding RuntimeVersionOf to CallExecutor works.

* fmt

* error when resolving version and no wasm in storage.

* use existing utils to instantiate runtime code.

* migration pallet

* Patch to delay runtime switch.

* Revert "Patch to delay runtime switch."

This reverts commit d35f273b7d67b1b85a9e72973cab13c5c156c1d3.

* fix test

* fix child migration calls.

* useless closure

* remove remaining state_hash variables.

* Fix and add more tests

* Remove outdated comment

* useless inner hash

* fmt

* remote tests

* finally ksm works

* batches are broken

* clean the benchmarks

* Apply suggestions from code review

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Apply suggestions from code review

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>

* Update frame/state-trie-migration/src/lib.rs

* brand new version

* fix build

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Update primitives/storage/src/lib.rs

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

* fmt and opt-in feature to apply state change.

* feature gate core version, use new test feature for node and test node

* Use a 'State' api version instead of Core one.

* fix merge of test function

* use blake macro.

* Fix state api (require declaring the api in runtime).

* Opt out feature, fix macro for io to select a given version
instead of latest.

* run test nodes on new state.

* fix

* new test structure

* new testing stuff from emeric

* Add commit_all, still not working

* Fix all tests

* add comment

* we have PoV tracking baby

* document stuff, but proof size is still wrong

* FUCK YEAH

* a big batch of review comments

* add more tests

* tweak test

* update config

* some remote-ext stuff

* delete some of the old stuff

* sync more files with master to minimize the diff

* Fix all tests

* make signed migration a bit more relaxed

* add witness check to signed submissions

* allow custom migration to also go above limit

* Fix these pesky tests

* ==== removal of the unsigned stuff ====

* Make all tests work again

* separate the tests from the logic so it can be reused easier

* fix overall build

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

* Slightly better termination

* some final tweaks

* Fix tests

* Restrict access to signed migrations

* address most of the review comments

* fix defensive

* New simplified code

* Fix weights

* fmt

* Update frame/state-trie-migration/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* make the tests correctly fail

* Fix build

* Fix build

* try and fix the benchmarks

* fix build

* Fix cargo file

* Fix runtime deposit

* make rustdoc happy

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_state_trie_migration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/state-trie-migration/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: cheme <emericchevalier.pro@gmail.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Parity Bot <admin@parity.io>

* BEEFY and GRANDPA protocol names should use full genesis hash (#10974)

std::fmt::Display shows formats as reduced hash (e.g. 0xb0a8…dafe)

Use hex::encode to format full hash.

Signed-off-by: acatangiu <adrian@parity.io>

* Move weight constants to own mod (#10980)

* Move block+ext weights to own mod

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Unused import

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* add block usage logs to system pallet (#10940)

* add block usage logs to system pallet

* add Debug

* use % instead of default Debug impl

* change formatting

* revert

* update runtime storage, update chain extension

* cleanup chain ext

* Fix the undeterministic storage proof recorded for the same execution (#10915)

* Add a test case for the determinism of recorded proof

* Replace HashMap with BTreeMap for the actual proof records

* cargo +nightly fmt --all

* Store the trie nodes in BTreeSet for StorageProof

* Nit

* Revert the BTreeMap changes and sort when converting to storage proof

* Remove PartialEq from StorageProof

* Remove unnecessary change

* Add `compare` method to StorageProof

* FMT

* Dummy change to trigger CI

* Use `BTreeSet` for StorageProof and keep using `Vec` for CompactProof

* Update comment on `iter_nodes`

* Revert `PartialEq` removal

* create iris ledger pallet

* ledger funcs in chain ext

* rename Iris -> IrisAssets, update readmes

* Minor Uniques pallet improvements and XCM v3 preparations (#10896)

* Introduce Helper to Uniques for benchmark stuff

* Fixes

* Formatting

* Featuregate the Helper, include ContainsPair

* Introduce & use EnsureOriginWithArg

* Benchmarking

* Docs

* More ContainsBoth helpers

* Formatting

* Formatting

* Fixes

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* election provider support: Update some test only types (#10983)

* Feedback from @XLC for Referenda Pallet (#10991)

* feedback from @xlc

* english

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make bags-list generic over node value and instantiable (#10997)

* make instantiable

* update

* cargo fmt

* Clean up

* bags-list: Make it generic over node value

* Respond to some feedback

* Apply suggestions from code review

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Add back default impl for weight update worst case

* Update to Score in more places'

* Use VoteWeight, not u64 to reduce test diff

* FMT

* FullCodec implies Codec

* formatting

* Fixup bags list remote test

Co-authored-by: doordashcon <jesse.chejieh@gmail.com>
Co-authored-by: Doordashcon <90750465+Doordashcon@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* sc-finality-grandpa: use the #[from] attriute to remove boilerplate code (#11003)

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* contracts: Add test to verify unique trie ids (#10914)

* Add test to verify unique trie ids

* Rename trie_seed to nonce

* Rename AccountCounter -> Nonce

* fmt

* sp-core: `full_crypto` doesn't imply `std` (#11006)

* sp-core: `full_crypto` doesn't imply `std`

This pr changes the feature set of `secp256k1` to not use `global-context` when only the
`full_crypto` is enabled. It will be slower when the `std` feature is not enabled as the context
always needs to be recreated, but that is fine.

* Update client/cli/src/arg_enums.rs

Co-authored-by: Davide Galassi <davxy@datawok.net>

Co-authored-by: Davide Galassi <davxy@datawok.net>

* Remove unused `parent_hash` in `OverlayedChanges::into_storage_changes` (#11011)

Ref https://github.com/paritytech/substrate/pull/10922#issuecomment-1064258443

CC @cheme

* iris ledger pallet -> transfer not yet functioning

* sp-api: Don't be dirty (#11015)

Ensure that the sp api macros don't use functions without providing the full path to the function.
This hygiene ensures that we don't actually try to call a method of an imported trait for example.

* unlock and transfer works

* Update clap to the latest version (#11017)

* Update clap to the latest version

Besides that it also removes some `structopt` leftovers from some docs.

* Fix compile errors

* More fixes

* Move scripts used in CI to the new location (#11008)

Move scripts used in CI to the new location - **./scripts/ci/**

* Move github scripts

* Move more files

* Move ci scripts and fix dependencies

* Update docs/node-template-release.md

Co-authored-by: João Paulo Silva de Souza <77391175+joao-paulo-parity@users.noreply.github.com>

* Remove Cargo.lock

* Apply suggestions from code review

Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>

* Make more paths uniform

Co-authored-by: João Paulo Silva de Souza <77391175+joao-paulo-parity@users.noreply.github.com>
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>

* Move `sp-npos-elections-solution-type` to `frame-election-provider-support` (#11016)

* Move `sp-npos-elections-solution-type`
to `frame-election-provider-support`
First stab at it, will need to amend some more stuff

* Fixing tests

* Fixing tests

* Fixing cargo.toml for std configuration

* fmt

* Committing suggested changes
renaming, and re exporting macro.

* Removing unneeded imports

* shell.nix: Update to a newer nightly (#11028)

* update chain ext

* update naming, formatting, start tests

* Update lockfile (#11035)

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Additional `benchmark-storage` flags (#11004)

* Fix typos

* Enable overwriting handlebars template

* Optionally name json output or disable json altogether

* Don't write to json by default

* Include block id in handlebars output

* Include warmups for write benchmarks

* PR comments

* Drop unnecessary file extension

* Use more appropriate types

* Use more appropriate error message

* More use of more appropriate types

* Rework write benchmark warmups

* Run same benchmark for both read and write

* SharedData: Update locks to mention possible deadlocks (#11034)

* SharedData: Update locks to mention possible deadlocks

* Update `Cargo.lock`

* Stabilize `seal_delegate_call` (#11037)

* add tests

* re-enumerate chain ext func ids

* Bump names from 0.12.0 to 0.13.0 (#11047)

Bumps [names](https://github.com/fnichol/names) from 0.12.0 to 0.13.0.
- [Release notes](https://github.com/fnichol/names/releases)
- [Changelog](https://github.com/fnichol/names/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fnichol/names/compare/v0.12.0...v0.13.0)

---
updated-dependencies:
- dependency-name: names
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* State migration rpc (#10981)

* setting flag

* flag in storage struct

* fix flagging to access and insert.

* added todo to fix

* also missing serialize meta to storage proof

* extract meta.

* Isolate old trie layout.

* failing test that requires storing in meta when old hash scheme is used.

* old hash compatibility

* Db migrate.

* runing tests with both states when interesting.

* fix chain spec test with serde default.

* export state (missing trie function).

* Pending using new branch, lacking genericity on layout resolution.

* extract and set global meta

* Update to branch 4

* fix iterator with root flag (no longer insert node).

* fix trie root hashing of root

* complete basic backend.

* Remove old_hash meta from proof that do not use inner_hashing.

* fix trie test for empty (force layout on empty deltas).

* Root update fix.

* debug on meta

* Use trie key iteration that do not include value in proofs.

* switch default test ext to use inner hash.

* small integration test, and fix tx cache mgmt in ext.
test  failing

* Proof scenario at state-machine level.

* trace for db upgrade

* try different param

* act more like iter_from.

* Bigger batches.

* Update trie dependency.

* drafting codec changes and refact

* before removing unused branch no value alt hashing.
more work todo rename all flag var to alt_hash, and remove extrinsic
replace by storage query at every storage_root call.

* alt hashing only for branch with value.

* fix trie tests

* Hash of value include the encoded size.

* removing fields(broken)

* fix trie_stream to also include value length in inner hash.

* triedbmut only using alt type if inner hashing.

* trie_stream to also only use alt hashing type when actually alt hashing.

* Refactor meta state, logic should work with change of trie treshold.

* Remove NoMeta variant.

* Remove state_hashed trigger specific functions.

* pending switching to using threshold, new storage root api does not
make much sense.

* refactoring to use state from backend (not possible payload changes).

* Applying from previous state

* Remove default from storage, genesis need a special build.

* rem empty space

* Catch problem: when using triedb with default: we should not revert
nodes: otherwhise thing as trie codec cannot decode-encode without
changing state.

* fix compilation

* Right …
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
…ritytech#10617)

* seal_call_code implementation

- tests
- benchmark

* Addressing @xgreenx's comments

* Fix test-linux-stable-int

* Rename seal_call_code to seal_delegate_call

* Pass value unchanged into lib contract

* Address @athei's comments

- whitespace .wat issues
- wrong/missing .wat comments
- redundant .wat calls/declarations

- change order of functions (seal_delegate_call right after seal_call)
  in decls, tests, benchmark
- fix comments, move doc comments to enum variants
- remove unnecessary empty lines

- rename runtime cost DelegateCall to DelegateCallBase
- do not set CallFlags::ALLOW_REENTRY for delegate_call

* Do not pass CallFlags::ALLOWS_REENTRY for delegate_call

* Update comment for seal_delegate_call and CallFlags

* Addressing @athei's comments (minor)

* Allow reentry for a new frame after delegate_call (revert)

* Same seal_caller and seal_value_transferred for lib contract

- test
- refactor frame args due to review
- logic for seal_caller (please review)

* Put caller on frame for delegate_call, minor fixes

* Update comment for delegate_call

* Addressing @athei's comments

* Update weights generated by benchmark

* Improve comments

* Address @HCastano's comments

* Update weights, thanks @joao-paulo-parity

* Improve InvalidCallFlags error comment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

delegatecall/callcode implementation
5 participants