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

[EPM pallet]: remove number of signed submissions #10945

Merged
merged 11 commits into from
Mar 3, 2022

Conversation

niklasad1
Copy link
Member

@niklasad1 niklasad1 commented Feb 28, 2022

Closing #9229

polkadot companion: paritytech/polkadot#5012

@github-actions github-actions bot added the A3-in_progress Pull request is in progress. No review needed at this stage. label Feb 28, 2022
@niklasad1 niklasad1 added B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Feb 28, 2022
@niklasad1 niklasad1 marked this pull request as ready for review February 28, 2022 16:33
@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Feb 28, 2022
Signed-off-by: Niklas <niklasadolfsson1@gmail.com>
@niklasad1 niklasad1 changed the title WIP [EPM pallet]: remove number of signed submissions [EPM pallet]: remove number of signed submissions Mar 1, 2022
@niklasad1 niklasad1 requested a review from kianenigma March 1, 2022 13:42
@kianenigma kianenigma requested a review from emostov March 1, 2022 22:07
@@ -342,7 +342,7 @@ frame_benchmarking::benchmarks! {
let caller = frame_benchmarking::whitelisted_caller();
T::Currency::make_free_balance_be(&caller, T::Currency::minimum_balance() * 10u32.into());

}: _(RawOrigin::Signed(caller), Box::new(solution), c)
}: _(RawOrigin::Signed(caller), Box::new(solution))
Copy link
Contributor

Choose a reason for hiding this comment

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

at the top of this, instead of let c in 1 .. (T::SignedMaxSubmissions::get() - 1);, you should do let c = T::SignedMaxSubmissions::get().

Copy link
Member Author

Choose a reason for hiding this comment

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

the test failed when I tried that lemme try and maybe some off-by-one error when doing that

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

has some flaws, that all should be easy to fix.

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

@kianenigma
Copy link
Contributor

/benchmark runtime pallet pallet_election_provider_multi_phase

@parity-benchapp
Copy link

parity-benchapp bot commented Mar 3, 2022

Benchmark Runtime Pallet for branch "na-fix-9229" 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_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

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

Results
Pallet: "pallet_election_provider_multi_phase", Extrinsic: "on_initialize_nothing", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: Staking CurrentEra (r:1 w:0)
Storage: Staking CurrentPlannedSession (r:1 w:0)
Storage: Staking ErasStartSessionIndex (r:1 w:0)
Storage: Babe EpochIndex (r:1 w:0)
Storage: Babe GenesisSlot (r:1 w:0)
Storage: Babe CurrentSlot (r:1 w:0)
Storage: Staking ForceEra (r:1 w:0)
Storage: ElectionProviderMultiPhase CurrentPhase (r:1 w:0)

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

Model:
Time ~=    13.34
              µs

Reads = 8
Writes = 0

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

Model:
Time ~=    13.34
              µs

Reads = 8
Writes = 0

Pallet: "pallet_election_provider_multi_phase", Extrinsic: "on_initialize_open_signed", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ElectionProviderMultiPhase Round (r:1 w:0)
Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1)

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

Model:
Time ~=     13.5
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=     13.5
              µs

Reads = 1
Writes = 1

Pallet: "pallet_election_provider_multi_phase", Extrinsic: "on_initialize_open_unsigned", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ElectionProviderMultiPhase Round (r:1 w:0)
Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1)

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

Model:
Time ~=    13.68
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    13.68
              µs

Reads = 1
Writes = 1

Pallet: "pallet_election_provider_multi_phase", Extrinsic: "finalize_signed_phase_accept_solution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)
Storage: ElectionProviderMultiPhase QueuedSolution (r:0 w:1)

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

Model:
Time ~=    29.12
              µs

Reads = 1
Writes = 2

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

Model:
Time ~=    29.12
              µs

Reads = 1
Writes = 2

Pallet: "pallet_election_provider_multi_phase", Extrinsic: "finalize_signed_phase_reject_solution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

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

Model:
Time ~=    21.95
              µs

Reads = 1
Writes = 1

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

Model:
Time ~=    21.95
              µs

Reads = 1
Writes = 1

Pallet: "pallet_election_provider_multi_phase", Extrinsic: "create_snapshot_internal", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ElectionProviderMultiPhase SnapshotMetadata (r:0 w:1)
Storage: ElectionProviderMultiPhase DesiredTargets (r:0 w:1)
Storage: ElectionProviderMultiPhase Snapshot (r:0 w:1)

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

Model:
Time ~=    18.58
    + v     0.18
    + t     0.07
              µs

Reads = 0 + (0 * v) + (0 * t)
Writes = 3 + (0 * v) + (0 * t)

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

Data points distribution:
    v     t   mean µs  sigma µs       %
 1000  1000     263.8     6.139    2.3%
 1020  1000       270     6.899    2.5%
 1040  1000     276.7     8.821    3.1%
 1060  1000       277     7.145    2.5%
 1080  1000     278.5     7.289    2.6%
 1100  1000     287.4      5.29    1.8%
 1120  1000     285.9      6.32    2.2%
 1140  1000     288.1     7.964    2.7%
 1160  1000     293.3     9.106    3.1%
 1180  1000     299.3     7.109    2.3%
 1200  1000     301.3     11.26    3.7%
 1220  1000     306.3     8.166    2.6%
 1240  1000     310.5     8.306    2.6%
 1260  1000     319.2     8.113    2.5%
 1280  1000     317.3     6.553    2.0%
 1300  1000     321.3     11.18    3.4%
 1320  1000     324.1      8.76    2.7%
 1340  1000     329.1     8.022    2.4%
 1360  1000       322     8.599    2.6%
 1380  1000     337.2     6.567    1.9%
 1400  1000     334.3     9.734    2.9%
 1420  1000     336.1     10.61    3.1%
 1440  1000     345.1     5.279    1.5%
 1460  1000     350.7     8.077    2.3%
 1480  1000     349.7     5.632    1.6%
 1500  1000       349      9.89    2.8%
 1520  1000     355.4     11.15    3.1%
 1540  1000     361.1     10.05    2.7%
 1560  1000     365.7     10.82    2.9%
 1580  1000     369.3     7.844    2.1%
 1600  1000     375.8      11.1    2.9%
 1620  1000     377.2     12.73    3.3%
 1640  1000     374.6     11.34    3.0%
 1660  1000     385.7     6.688    1.7%
 1680  1000       383     14.44    3.7%
 1700  1000     398.8     3.994    1.0%
 1720  1000     387.4     12.54    3.2%
 1740  1000       396     12.31    3.1%
 1760  1000     413.9     6.395    1.5%
 1780  1000     416.4     4.925    1.1%
 1800  1000     409.5     12.08    2.9%
 1820  1000     416.6     6.873    1.6%
 1840  1000     412.3      14.3    3.4%
 1860  1000     419.6     14.68    3.4%
 1880  1000     428.5     12.33    2.8%
 1900  1000     424.7     15.03    3.5%
 1920  1000     428.5      14.9    3.4%
 1940  1000     436.6     11.31    2.5%
 1960  1000     439.3     12.81    2.9%
 1980  1000     450.4     14.55    3.2%
 2000   500     419.5     14.14    3.3%
 2000   510     421.8     11.11    2.6%
 2000   520     421.8     14.31    3.3%
 2000   530     427.2     13.25    3.1%
 2000   540     428.4     13.06    3.0%
 2000   550     438.6     17.89    4.0%
 2000   560     430.8     12.94    3.0%
 2000   570     428.6     15.41    3.5%
 2000   580     427.5     14.02    3.2%
 2000   590     443.8     6.663    1.5%
 2000   600     431.1     11.22    2.6%
 2000   610       432     13.01    3.0%
 2000   620     431.1     11.13    2.5%
 2000   630       431     11.63    2.6%
 2000   640     427.4     14.71    3.4%
 2000   650     432.7     11.76    2.7%
 2000   660     437.3     13.95    3.1%
 2000   670     438.1     9.451    2.1%
 2000   680     431.8     11.14    2.5%
 2000   690     441.9     10.43    2.3%
 2000   700     432.8     13.06    3.0%
 2000   710     435.4     14.87    3.4%
 2000   720     442.2     9.974    2.2%
 2000   730     436.4     12.56    2.8%
 2000   740     439.7     10.18    2.3%
 2000   750     432.5     17.74    4.1%
 2000   760     438.7      10.8    2.4%
 2000   770     440.8     15.23    3.4%
 2000   780     441.2     12.86    2.9%
 2000   790     450.5     5.753    1.2%
 2000   800     445.1     12.47    2.8%
 2000   810     449.1     8.833    1.9%
 2000   820     442.1     13.14    2.9%
 2000   830     455.4     4.258    0.9%
 2000   840     446.6     13.59    3.0%
 2000   850     444.8     12.12    2.7%
 2000   860     449.3      16.4    3.6%
 2000   870     455.7     12.15    2.6%
 2000   880       448     14.86    3.3%
 2000   890     448.7     8.589    1.9%
 2000   900     453.9     15.68    3.4%
 2000   910     459.5     12.48    2.7%
 2000   920     453.9     12.82    2.8%
 2000   930     453.3     12.44    2.7%
 2000   940     461.2     12.36    2.6%
 2000   950     457.4     12.04    2.6%
 2000   960     459.2     11.24    2.4%
 2000   970     453.9     14.35    3.1%
 2000   980     459.5     13.65    2.9%
 2000   990     460.8     8.998    1.9%
 2000  1000     455.4     13.42    2.9%

Quality and confidence:
param     error
v         0.001
t         0.003

Model:
Time ~=    17.27
    + v    0.191
    + t    0.053
              µs

Reads = 0 + (0 * v) + (0 * t)
Writes = 3 + (0 * v) + (0 * t)

Pallet: "pallet_election_provider_multi_phase", Extrinsic: "elect_queued", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ElectionProviderMultiPhase SignedSubmissionIndices (r:1 w:1)
Storage: ElectionProviderMultiPhase SignedSubmissionNextIndex (r:1 w:1)
Storage: ElectionProviderMultiPhase SnapshotMetadata (r:1 w:1)
Storage: ElectionProviderMultiPhase SignedSubmissionsMap (r:1 w:0)
Storage: ElectionProviderMultiPhase QueuedSolution (r:1 w:1)
Storage: ElectionProviderMultiPhase Round (r:1 w:1)
Storage: ElectionProviderMultiPhase DesiredTargets (r:0 w:1)
Storage: ElectionProviderMultiPhase Snapshot (r:0 w:1)
Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1)

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

Model:
Time ~=    138.6
    + a    0.611
    + d    0.077
              µs

Reads = 6 + (0 * a) + (0 * d)
Writes = 8 + (0 * a) + (0 * d)

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

Data points distribution:
    a     d   mean µs  sigma µs       %
  500   400     478.2     4.836    1.0%
  506   400     488.7     7.217    1.4%
  512   400     481.9     8.096    1.6%
  518   400     488.9     3.293    0.6%
  524   400     489.4     3.487    0.7%
  530   400     495.1     1.829    0.3%
  536   400     497.5     2.325    0.4%
  542   400     503.5     6.179    1.2%
  548   400     503.3     1.875    0.3%
  554   400     503.4     1.792    0.3%
  560   400     509.5     3.006    0.5%
  566   400     513.2     2.445    0.4%
  572   400       518     1.698    0.3%
  578   400     526.1     2.699    0.5%
  584   400       527     3.197    0.6%
  590   400     527.7     6.528    1.2%
  596   400       533     9.497    1.7%
  602   400     533.3     7.217    1.3%
  608   400     537.9     8.798    1.6%
  614   400     546.7      13.2    2.4%
  620   400     552.5     3.675    0.6%
  626   400     556.3     9.001    1.6%
  632   400     554.7     8.756    1.5%
  638   400     561.1     10.16    1.8%
  644   400     572.2     4.774    0.8%
  650   400     570.7     9.038    1.5%
  656   400     567.8     7.783    1.3%
  662   400     577.6     5.189    0.8%
  668   400     588.2     7.552    1.2%
  674   400     580.2     8.153    1.4%
  680   400     593.2     4.521    0.7%
  686   400       582     4.955    0.8%
  692   400     602.3     3.527    0.5%
  698   400     589.8     8.634    1.4%
  704   400     593.4     4.235    0.7%
  710   400     615.9     10.43    1.6%
  716   400     606.6     5.086    0.8%
  722   400     602.6     1.026    0.1%
  728   400     608.1     1.181    0.1%
  734   400     615.9     3.698    0.6%
  740   400     615.7     3.666    0.5%
  746   400     629.8     8.776    1.3%
  752   400     641.6     11.35    1.7%
  758   400     628.8      2.34    0.3%
  764   400       641     4.391    0.6%
  770   400     635.5     1.343    0.2%
  776   400     648.5     3.518    0.5%
  782   400       650     12.09    1.8%
  788   400       652     2.536    0.3%
  794   400     663.3     10.22    1.5%
  800   200       626     2.439    0.3%
  800   204     649.9     14.69    2.2%
  800   208     631.8     1.258    0.1%
  800   212     637.3     2.621    0.4%
  800   216     641.5     8.993    1.4%
  800   220     647.3      11.6    1.7%
  800   224     649.2     8.825    1.3%
  800   228       633     2.551    0.4%
  800   232     637.3     1.465    0.2%
  800   236     662.4     9.148    1.3%
  800   240     661.5     7.273    1.0%
  800   244     637.7     3.208    0.5%
  800   248     642.4     5.294    0.8%
  800   252     678.4     14.85    2.1%
  800   256     651.3      5.72    0.8%
  800   260     652.4     2.111    0.3%
  800   264     648.7     9.129    1.4%
  800   268     652.9     1.895    0.2%
  800   272       671       4.9    0.7%
  800   276     635.4     6.205    0.9%
  800   280     651.6     11.29    1.7%
  800   284     650.1     12.32    1.8%
  800   288     658.1     7.914    1.2%
  800   292     650.6     17.86    2.7%
  800   296     637.7     7.864    1.2%
  800   300     648.7      9.76    1.5%
  800   304     652.6     5.576    0.8%
  800   308     664.2     14.99    2.2%
  800   312     644.6     10.62    1.6%
  800   316     661.4     10.44    1.5%
  800   320     652.5     8.921    1.3%
  800   324     652.3      13.9    2.1%
  800   328     656.1     13.22    2.0%
  800   332     651.4     9.023    1.3%
  800   336     649.2     10.43    1.6%
  800   340     643.5     2.026    0.3%
  800   344     646.3     3.512    0.5%
  800   348     649.9     6.479    0.9%
  800   352     650.9     2.894    0.4%
  800   356     655.6     13.14    2.0%
  800   360     654.6     6.636    1.0%
  800   364     650.5     9.478    1.4%
  800   368     647.3     3.522    0.5%
  800   372     652.2     6.151    0.9%
  800   376     649.4      5.15    0.7%
  800   380     655.6     5.542    0.8%
  800   384     655.9     4.753    0.7%
  800   388     655.3     2.563    0.3%
  800   392     658.1     7.284    1.1%
  800   396     658.4     4.303    0.6%
  800   400     658.5     6.359    0.9%

Quality and confidence:
param     error
a         0.004
d         0.006

Model:
Time ~=    145.8
    + a    0.604
    + d    0.072
              µs

Reads = 6 + (0 * a) + (0 * d)
Writes = 8 + (0 * a) + (0 * d)

Pallet: "pallet_election_provider_multi_phase", Extrinsic: "submit", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ElectionProviderMultiPhase CurrentPhase (r:1 w:0)
Storage: ElectionProviderMultiPhase SnapshotMetadata (r:1 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: ElectionProviderMultiPhase SignedSubmissionIndices (r:1 w:1)
Storage: ElectionProviderMultiPhase SignedSubmissionNextIndex (r:1 w:1)
Storage: ElectionProviderMultiPhase SignedSubmissionsMap (r:0 w:1)

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

Model:
Time ~=    41.57
              µs

Reads = 5
Writes = 3

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

Model:
Time ~=    41.57
              µs

Reads = 5
Writes = 3

Pallet: "pallet_election_provider_multi_phase", Extrinsic: "submit_unsigned", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ElectionProviderMultiPhase CurrentPhase (r:1 w:0)
Storage: ElectionProviderMultiPhase Round (r:1 w:0)
Storage: ElectionProviderMultiPhase DesiredTargets (r:1 w:0)
Storage: ElectionProviderMultiPhase QueuedSolution (r:1 w:1)
Storage: ElectionProviderMultiPhase SnapshotMetadata (r:1 w:0)
Storage: ElectionProviderMultiPhase MinimumUntrustedScore (r:1 w:0)
Storage: ElectionProviderMultiPhase Snapshot (r:1 w:0)

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

Model:
Time ~=        0
    + v    0.798
    + t    0.214
    + a    6.513
    + d    1.592
              µs

Reads = 7 + (0 * v) + (0 * t) + (0 * a) + (0 * d)
Writes = 1 + (0 * v) + (0 * t) + (0 * a) + (0 * d)

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

Data points distribution:
    v     t     a     d   mean µs  sigma µs       %
 1000  1000   800   400      6058     17.06    0.2%
 1020  1000   800   400      6097     22.51    0.3%
 1040  1000   800   400      6082     20.92    0.3%
 1060  1000   800   400      6139     33.35    0.5%
 1080  1000   800   400      6149     17.88    0.2%
 1100  1000   800   400      6149     23.51    0.3%
 1120  1000   800   400      6153      15.5    0.2%
 1140  1000   800   400      6153      15.1    0.2%
 1160  1000   800   400      6172     17.25    0.2%
 1180  1000   800   400      6200     20.14    0.3%
 1200  1000   800   400      6218     15.06    0.2%
 1220  1000   800   400      6239     8.112    0.1%
 1240  1000   800   400      6244     8.132    0.1%
 1260  1000   800   400      6259     21.35    0.3%
 1280  1000   800   400      6264      15.4    0.2%
 1300  1000   800   400      6311     11.57    0.1%
 1320  1000   800   400      6329     21.49    0.3%
 1340  1000   800   400      6394     15.52    0.2%
 1360  1000   800   400      6355     19.41    0.3%
 1380  1000   800   400      6400      23.6    0.3%
 1400  1000   800   400      6399     17.79    0.2%
 1420  1000   800   400      6423     18.15    0.2%
 1440  1000   800   400      6433     19.14    0.2%
 1460  1000   800   400      6462     23.28    0.3%
 1480  1000   800   400      6463     15.19    0.2%
 1500  1000   800   400      6468     27.53    0.4%
 1520  1000   800   400      6458     15.02    0.2%
 1540  1000   800   400      6504     22.01    0.3%
 1560  1000   800   400      6516     21.92    0.3%
 1580  1000   800   400      6546     17.64    0.2%
 1600  1000   800   400      6533     16.45    0.2%
 1620  1000   800   400      6565     13.07    0.1%
 1640  1000   800   400      6563     12.14    0.1%
 1660  1000   800   400      6588     11.31    0.1%
 1680  1000   800   400      6580     11.52    0.1%
 1700  1000   800   400      6591     20.34    0.3%
 1720  1000   800   400      6606     13.34    0.2%
 1740  1000   800   400      6624     19.87    0.2%
 1760  1000   800   400      6641      31.2    0.4%
 1780  1000   800   400      6672     22.41    0.3%
 1800  1000   800   400      6700     15.93    0.2%
 1820  1000   800   400      6706     24.34    0.3%
 1840  1000   800   400      6702     14.89    0.2%
 1860  1000   800   400      6725     11.37    0.1%
 1880  1000   800   400      6756     18.32    0.2%
 1900  1000   800   400      6783     15.39    0.2%
 1920  1000   800   400      6814     27.55    0.4%
 1940  1000   800   400      6781      22.6    0.3%
 1960  1000   800   400      6805     21.38    0.3%
 1980  1000   800   400      6824     36.98    0.5%
 2000   500   800   400      6841      15.5    0.2%
 2000   510   800   400      6858     28.48    0.4%
 2000   520   800   400      6849     26.68    0.3%
 2000   530   800   400      6786     20.38    0.3%
 2000   540   800   400      6819     10.31    0.1%
 2000   550   800   400      6848      18.7    0.2%
 2000   560   800   400      6834     14.49    0.2%
 2000   570   800   400      6904     21.47    0.3%
 2000   580   800   400      6823     30.28    0.4%
 2000   590   800   400      6866      16.9    0.2%
 2000   600   800   400      6847     16.54    0.2%
 2000   610   800   400      6844     13.98    0.2%
 2000   620   800   400      6838     20.24    0.2%
 2000   630   800   400      6830     23.93    0.3%
 2000   640   800   400      6864     28.91    0.4%
 2000   650   800   400      6872     21.58    0.3%
 2000   660   800   400      6909     19.24    0.2%
 2000   670   800   400      6956     29.27    0.4%
 2000   680   800   400      6870     21.18    0.3%
 2000   690   800   400      6878     12.54    0.1%
 2000   700   800   400      6868     14.98    0.2%
 2000   710   800   400      6883     19.12    0.2%
 2000   720   800   400      6890     13.69    0.1%
 2000   730   800   400      6877     13.43    0.1%
 2000   740   800   400      6903     27.01    0.3%
 2000   750   800   400      6902     21.39    0.3%
 2000   760   800   400      6914     27.46    0.3%
 2000   770   800   400      6885     15.97    0.2%
 2000   780   800   400      6895     14.59    0.2%
 2000   790   800   400      6896     17.37    0.2%
 2000   800   800   400      6886     21.23    0.3%
 2000   810   800   400      6868     7.557    0.1%
 2000   820   800   400      6921     13.48    0.1%
 2000   830   800   400      6888      23.4    0.3%
 2000   840   800   400      6903     17.24    0.2%
 2000   850   800   400      6908     14.17    0.2%
 2000   860   800   400      6943      17.1    0.2%
 2000   870   800   400      6934     17.89    0.2%
 2000   880   800   400      6916     23.98    0.3%
 2000   890   800   400      6932     22.07    0.3%
 2000   900   800   400      6951      24.3    0.3%
 2000   910   800   400      6916     11.21    0.1%
 2000   920   800   400      6932     17.51    0.2%
 2000   930   800   400      6941     27.08    0.3%
 2000   940   800   400      6946     23.64    0.3%
 2000   950   800   400      6917     16.23    0.2%
 2000   960   800   400      6925     22.46    0.3%
 2000   970   800   400      6933     17.95    0.2%
 2000   980   800   400      6958     20.25    0.2%
 2000   990   800   400      6935     20.17    0.2%
 2000  1000   500   400      5002     14.46    0.2%
 2000  1000   506   400      5008     9.358    0.1%
 2000  1000   512   400      5058     11.02    0.2%
 2000  1000   518   400      5106     18.57    0.3%
 2000  1000   524   400      5135     15.27    0.2%
 2000  1000   530   400      5187     27.14    0.5%
 2000  1000   536   400      5215     18.59    0.3%
 2000  1000   542   400      5254     23.54    0.4%
 2000  1000   548   400      5272     11.14    0.2%
 2000  1000   554   400      5307     24.04    0.4%
 2000  1000   560   400      5343     10.57    0.1%
 2000  1000   566   400      5411     18.42    0.3%
 2000  1000   572   400      5436      25.2    0.4%
 2000  1000   578   400      5459     24.39    0.4%
 2000  1000   584   400      5491        13    0.2%
 2000  1000   590   400      5549     16.31    0.2%
 2000  1000   596   400      5593     16.97    0.3%
 2000  1000   602   400      5615     15.93    0.2%
 2000  1000   608   400      5659     26.94    0.4%
 2000  1000   614   400      5699     17.65    0.3%
 2000  1000   620   400      5732     14.42    0.2%
 2000  1000   626   400      5765     18.12    0.3%
 2000  1000   632   400      5825     20.05    0.3%
 2000  1000   638   400      5846     15.98    0.2%
 2000  1000   644   400      5875     16.94    0.2%
 2000  1000   650   400      5908     15.52    0.2%
 2000  1000   656   400      5926     12.69    0.2%
 2000  1000   662   400      5983     14.48    0.2%
 2000  1000   668   400      6023     9.653    0.1%
 2000  1000   674   400      6024     8.552    0.1%
 2000  1000   680   400      6085     19.36    0.3%
 2000  1000   686   400      6139     17.53    0.2%
 2000  1000   692   400      6178     16.89    0.2%
 2000  1000   698   400      6218      8.09    0.1%
 2000  1000   704   400      6285     10.81    0.1%
 2000  1000   710   400      6357     12.18    0.1%
 2000  1000   716   400      6377      19.8    0.3%
 2000  1000   722   400      6452     17.25    0.2%
 2000  1000   728   400      6471     19.53    0.3%
 2000  1000   734   400      6508     20.63    0.3%
 2000  1000   740   400      6537     16.61    0.2%
 2000  1000   746   400      6588     18.22    0.2%
 2000  1000   752   400      6614     15.63    0.2%
 2000  1000   758   400      6665     23.34    0.3%
 2000  1000   764   400      6689     12.95    0.1%
 2000  1000   770   400      6737     16.28    0.2%
 2000  1000   776   400      6770      17.3    0.2%
 2000  1000   782   400      6805     31.81    0.4%
 2000  1000   788   400      6844     20.53    0.3%
 2000  1000   794   400      6880     8.279    0.1%
 2000  1000   800   200      6648     12.34    0.1%
 2000  1000   800   204      6620     16.72    0.2%
 2000  1000   800   208      6664     13.69    0.2%
 2000  1000   800   212      6662     16.36    0.2%
 2000  1000   800   216      6628     14.54    0.2%
 2000  1000   800   220      6682     22.35    0.3%
 2000  1000   800   224      6656     16.22    0.2%
 2000  1000   800   228      6687     18.51    0.2%
 2000  1000   800   232      6678     25.19    0.3%
 2000  1000   800   236      6672     17.82    0.2%
 2000  1000   800   240      6654     16.49    0.2%
 2000  1000   800   244      6706     17.18    0.2%
 2000  1000   800   248      6736     9.653    0.1%
 2000  1000   800   252      6714     15.93    0.2%
 2000  1000   800   256      6726     15.47    0.2%
 2000  1000   800   260      6732     11.87    0.1%
 2000  1000   800   264      6760      14.6    0.2%
 2000  1000   800   268      6747     18.47    0.2%
 2000  1000   800   272      6756     13.36    0.1%
 2000  1000   800   276      6754      19.8    0.2%
 2000  1000   800   280      6781      28.1    0.4%
 2000  1000   800   284      6787     16.55    0.2%
 2000  1000   800   288      6787     12.19    0.1%
 2000  1000   800   292      6770     23.88    0.3%
 2000  1000   800   296      6811     22.45    0.3%
 2000  1000   800   300      6822      29.2    0.4%
 2000  1000   800   304      6829     31.75    0.4%
 2000  1000   800   308      6810     17.72    0.2%
 2000  1000   800   312      6811     23.75    0.3%
 2000  1000   800   316      6841     10.63    0.1%
 2000  1000   800   320      6847     14.35    0.2%
 2000  1000   800   324      6880     19.28    0.2%
 2000  1000   800   328      6866     22.15    0.3%
 2000  1000   800   332      6856     15.11    0.2%
 2000  1000   800   336      6836     10.86    0.1%
 2000  1000   800   340      6885     22.34    0.3%
 2000  1000   800   344      6880     30.34    0.4%
 2000  1000   800   348      6895     21.32    0.3%
 2000  1000   800   352      6883     13.45    0.1%
 2000  1000   800   356      6907     11.12    0.1%
 2000  1000   800   360      6896     16.16    0.2%
 2000  1000   800   364      6928     29.45    0.4%
 2000  1000   800   368      6895     24.11    0.3%
 2000  1000   800   372      6883     28.78    0.4%
 2000  1000   800   376      6914     13.15    0.1%
 2000  1000   800   380      6909     25.12    0.3%
 2000  1000   800   384      6956     10.14    0.1%
 2000  1000   800   388      6939      13.2    0.1%
 2000  1000   800   392      6929     14.66    0.2%
 2000  1000   800   396      6953     24.55    0.3%
 2000  1000   800   400      6938     24.19    0.3%

Quality and confidence:
param     error
v         0.003
t         0.007
a         0.012
d         0.018

Model:
Time ~=        0
    + v    0.882
    + t    0.144
    + a    6.534
    + d    1.312
              µs

Reads = 7 + (0 * v) + (0 * t) + (0 * a) + (0 * d)
Writes = 1 + (0 * v) + (0 * t) + (0 * a) + (0 * d)

Pallet: "pallet_election_provider_multi_phase", Extrinsic: "feasibility_check", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: ElectionProviderMultiPhase Round (r:1 w:0)
Storage: ElectionProviderMultiPhase DesiredTargets (r:1 w:0)
Storage: ElectionProviderMultiPhase MinimumUntrustedScore (r:1 w:0)
Storage: ElectionProviderMultiPhase Snapshot (r:1 w:0)

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

Model:
Time ~=        0
    + v    0.802
    + t    0.032
    + a    5.176
    + d    1.619
              µs

Reads = 4 + (0 * v) + (0 * t) + (0 * a) + (0 * d)
Writes = 0 + (0 * v) + (0 * t) + (0 * a) + (0 * d)

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

Data points distribution:
    v     t     a     d   mean µs  sigma µs       %
 1000  1000   800   400      5065     17.21    0.3%
 1020  1000   800   400      5075     12.46    0.2%
 1040  1000   800   400      5082     11.81    0.2%
 1060  1000   800   400      5113     8.292    0.1%
 1080  1000   800   400      5114     14.65    0.2%
 1100  1000   800   400      5128     18.56    0.3%
 1120  1000   800   400      5157     19.75    0.3%
 1140  1000   800   400      5155     6.719    0.1%
 1160  1000   800   400      5186     17.89    0.3%
 1180  1000   800   400      5179     13.58    0.2%
 1200  1000   800   400      5210     19.75    0.3%
 1220  1000   800   400      5234     17.89    0.3%
 1240  1000   800   400      5356     111.7    2.0%
 1260  1000   800   400      5266     23.26    0.4%
 1280  1000   800   400      5277     13.05    0.2%
 1300  1000   800   400      5271     8.716    0.1%
 1320  1000   800   400      5288     16.04    0.3%
 1340  1000   800   400      5338     17.62    0.3%
 1360  1000   800   400      5354      16.9    0.3%
 1380  1000   800   400      5385     12.12    0.2%
 1400  1000   800   400      5421     24.33    0.4%
 1420  1000   800   400      5422     20.24    0.3%
 1440  1000   800   400      5421     13.51    0.2%
 1460  1000   800   400      5430     18.26    0.3%
 1480  1000   800   400      5439     23.46    0.4%
 1500  1000   800   400      5464     27.45    0.5%
 1520  1000   800   400      5454     19.67    0.3%
 1540  1000   800   400      5478     14.08    0.2%
 1560  1000   800   400      5504     20.39    0.3%
 1580  1000   800   400      5529        15    0.2%
 1600  1000   800   400      5525     9.648    0.1%
 1620  1000   800   400      5539     17.41    0.3%
 1640  1000   800   400      5524     17.82    0.3%
 1660  1000   800   400      5607     22.86    0.4%
 1680  1000   800   400      5578     17.48    0.3%
 1700  1000   800   400      5585     11.86    0.2%
 1720  1000   800   400      5601      12.8    0.2%
 1740  1000   800   400      5608     5.134    0.0%
 1760  1000   800   400      5638     15.31    0.2%
 1780  1000   800   400      5691     20.59    0.3%
 1800  1000   800   400      5678     15.62    0.2%
 1820  1000   800   400      5732     11.09    0.1%
 1840  1000   800   400      5738     11.34    0.1%
 1860  1000   800   400      5766     13.71    0.2%
 1880  1000   800   400      5723     19.39    0.3%
 1900  1000   800   400      5774      12.3    0.2%
 1920  1000   800   400      5827     28.87    0.4%
 1940  1000   800   400      5844     10.26    0.1%
 1960  1000   800   400      5828     24.57    0.4%
 1980  1000   800   400      5825     8.969    0.1%
 2000   500   800   400      5859     22.77    0.3%
 2000   510   800   400      5888      26.5    0.4%
 2000   520   800   400      5860      5.77    0.0%
 2000   530   800   400      5878        29    0.4%
 2000   540   800   400      5878     20.04    0.3%
 2000   550   800   400      5873     13.41    0.2%
 2000   560   800   400      5870     14.15    0.2%
 2000   570   800   400      5878     16.87    0.2%
 2000   580   800   400      5851     16.31    0.2%
 2000   590   800   400      5886     11.05    0.1%
 2000   600   800   400      5890     11.28    0.1%
 2000   610   800   400      5881     12.71    0.2%
 2000   620   800   400      5879     15.83    0.2%
 2000   630   800   400      5884     10.24    0.1%
 2000   640   800   400      5878     22.35    0.3%
 2000   650   800   400      5893     19.35    0.3%
 2000   660   800   400      5869     18.14    0.3%
 2000   670   800   400      5883     19.26    0.3%
 2000   680   800   400      5880     13.13    0.2%
 2000   690   800   400      5887     19.06    0.3%
 2000   700   800   400      5870     13.93    0.2%
 2000   710   800   400      5881     14.97    0.2%
 2000   720   800   400      5879     12.75    0.2%
 2000   730   800   400      5876     9.014    0.1%
 2000   740   800   400      5903     13.45    0.2%
 2000   750   800   400      5917     13.58    0.2%
 2000   760   800   400      5890     11.27    0.1%
 2000   770   800   400      5912     9.887    0.1%
 2000   780   800   400      5883     15.39    0.2%
 2000   790   800   400      5910     16.73    0.2%
 2000   800   800   400      5887     19.79    0.3%
 2000   810   800   400      5913     23.81    0.4%
 2000   820   800   400      5909     21.02    0.3%
 2000   830   800   400      5922     25.14    0.4%
 2000   840   800   400      5903     13.79    0.2%
 2000   850   800   400      5922     26.42    0.4%
 2000   860   800   400      5905     16.55    0.2%
 2000   870   800   400      5908     15.93    0.2%
 2000   880   800   400      5908     12.65    0.2%
 2000   890   800   400      5903     13.21    0.2%
 2000   900   800   400      5894     23.64    0.4%
 2000   910   800   400      5869     16.41    0.2%
 2000   920   800   400      5917      22.7    0.3%
 2000   930   800   400      5915     8.523    0.1%
 2000   940   800   400      5864     24.79    0.4%
 2000   950   800   400      5858     17.64    0.3%
 2000   960   800   400      5864     14.18    0.2%
 2000   970   800   400      5887     24.81    0.4%
 2000   980   800   400      5876     25.18    0.4%
 2000   990   800   400      5860     16.61    0.2%
 2000  1000   500   400      4308     19.69    0.4%
 2000  1000   506   400      4322     9.964    0.2%
 2000  1000   512   400      4346     17.24    0.3%
 2000  1000   518   400      4387     15.36    0.3%
 2000  1000   524   400      4428     17.52    0.3%
 2000  1000   530   400      4426     22.43    0.5%
 2000  1000   536   400      4484     15.66    0.3%
 2000  1000   542   400      4524     26.01    0.5%
 2000  1000   548   400      4536      7.33    0.1%
 2000  1000   554   400      4582     18.59    0.4%
 2000  1000   560   400      4594     12.66    0.2%
 2000  1000   566   400      4589     8.676    0.1%
 2000  1000   572   400      4636     13.66    0.2%
 2000  1000   578   400      4703     22.28    0.4%
 2000  1000   584   400      4717     20.61    0.4%
 2000  1000   590   400      4777     25.82    0.5%
 2000  1000   596   400      4799     11.17    0.2%
 2000  1000   602   400      4819     11.03    0.2%
 2000  1000   608   400      4858     12.64    0.2%
 2000  1000   614   400      4869     22.76    0.4%
 2000  1000   620   400      4904     12.56    0.2%
 2000  1000   626   400      4922     18.77    0.3%
 2000  1000   632   400      4963     17.21    0.3%
 2000  1000   638   400      4997     17.15    0.3%
 2000  1000   644   400      5008     16.63    0.3%
 2000  1000   650   400      5065     18.15    0.3%
 2000  1000   656   400      5084     10.91    0.2%
 2000  1000   662   400      5119     21.94    0.4%
 2000  1000   668   400      5143     10.32    0.2%
 2000  1000   674   400      5182     20.48    0.3%
 2000  1000   680   400      5188     12.63    0.2%
 2000  1000   686   400      5227     22.46    0.4%
 2000  1000   692   400      5249     18.12    0.3%
 2000  1000   698   400      5300      11.4    0.2%
 2000  1000   704   400      5298     25.66    0.4%
 2000  1000   710   400      5388     26.07    0.4%
 2000  1000   716   400      5387     15.57    0.2%
 2000  1000   722   400      5405     9.028    0.1%
 2000  1000   728   400      5451     23.28    0.4%
 2000  1000   734   400      5479     24.62    0.4%
 2000  1000   740   400      5525     17.81    0.3%
 2000  1000   746   400      5554     9.026    0.1%
 2000  1000   752   400      5577     18.33    0.3%
 2000  1000   758   400      5624     19.21    0.3%
 2000  1000   764   400      5629     12.99    0.2%
 2000  1000   770   400      5677     13.82    0.2%
 2000  1000   776   400      5716     16.72    0.2%
 2000  1000   782   400      5744     14.17    0.2%
 2000  1000   788   400      5790     24.94    0.4%
 2000  1000   794   400      5823     13.83    0.2%
 2000  1000   800   200      5631     17.68    0.3%
 2000  1000   800   204      5569     9.965    0.1%
 2000  1000   800   208      5593     24.54    0.4%
 2000  1000   800   212      5626     12.27    0.2%
 2000  1000   800   216      5613     12.79    0.2%
 2000  1000   800   220      5592     12.58    0.2%
 2000  1000   800   224      5603     12.94    0.2%
 2000  1000   800   228      5645     20.46    0.3%
 2000  1000   800   232      5632     18.15    0.3%
 2000  1000   800   236      5630     18.12    0.3%
 2000  1000   800   240      5615     17.21    0.3%
 2000  1000   800   244      5678     18.62    0.3%
 2000  1000   800   248      5713     14.92    0.2%
 2000  1000   800   252      5673     18.55    0.3%
 2000  1000   800   256      5696     23.96    0.4%
 2000  1000   800   260      5724     31.52    0.5%
 2000  1000   800   264      5708     10.32    0.1%
 2000  1000   800   268      5731     16.29    0.2%
 2000  1000   800   272      5736      29.4    0.5%
 2000  1000   800   276      5725     18.94    0.3%
 2000  1000   800   280      5735     14.51    0.2%
 2000  1000   800   284      5798     18.57    0.3%
 2000  1000   800   288      5773     32.24    0.5%
 2000  1000   800   292      5797     24.16    0.4%
 2000  1000   800   296      5792     26.95    0.4%
 2000  1000   800   300      5810     48.94    0.8%
 2000  1000   800   304      5790     14.29    0.2%
 2000  1000   800   308      5821     20.62    0.3%
 2000  1000   800   312      5793      15.7    0.2%
 2000  1000   800   316      5828     23.99    0.4%
 2000  1000   800   320      5827     18.99    0.3%
 2000  1000   800   324      5854     28.28    0.4%
 2000  1000   800   328      5839     30.84    0.5%
 2000  1000   800   332      5851     20.87    0.3%
 2000  1000   800   336      5848     30.33    0.5%
 2000  1000   800   340      5881     31.24    0.5%
 2000  1000   800   344      5866     14.68    0.2%
 2000  1000   800   348      5872     20.99    0.3%
 2000  1000   800   352      5860     29.83    0.5%
 2000  1000   800   356      5914     28.84    0.4%
 2000  1000   800   360      5892     44.23    0.7%
 2000  1000   800   364      5923     26.99    0.4%
 2000  1000   800   368      5927     24.41    0.4%
 2000  1000   800   372      5845     19.54    0.3%
 2000  1000   800   376      5870     23.26    0.3%
 2000  1000   800   380      5876     43.14    0.7%
 2000  1000   800   384      5891     30.77    0.5%
 2000  1000   800   388      5895     11.24    0.1%
 2000  1000   800   392      5873     20.65    0.3%
 2000  1000   800   396      5893     35.86    0.6%
 2000  1000   800   400      5881     26.06    0.4%

Quality and confidence:
param     error
v         0.003
t         0.007
a         0.012
d         0.019

Model:
Time ~=        0
    + v    0.835
    + t        0
    + a    5.395
    + d    1.243
              µs

Reads = 4 + (0 * v) + (0 * t) + (0 * a) + (0 * d)
Writes = 0 + (0 * v) + (0 * t) + (0 * a) + (0 * d)


Parity Bot and others added 4 commits March 3, 2022 15:20
…--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
@emostov
Copy link
Contributor

emostov commented Mar 3, 2022

lgtm - the polkadot companion just needs a few more updates, see paritytech/polkadot#5012 (comment)

@niklasad1
Copy link
Member Author

@emostov can you take another look? Hopefully good to go now :)

@niklasad1
Copy link
Member Author

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 15b8fd5 into master Mar 3, 2022
@paritytech-processbot paritytech-processbot bot deleted the na-fix-9229 branch March 3, 2022 22:47
grishasobol pushed a commit to gear-tech/substrate that referenced this pull request Mar 28, 2022
* [EPM pallet]: remove `number of signed submissions`

Closing paritytech#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>
grishasobol pushed a commit to gear-tech/substrate that referenced this pull request Mar 28, 2022
* [EPM pallet]: remove `number of signed submissions`

Closing paritytech#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>
grishasobol pushed a commit to gear-tech/substrate that referenced this pull request Mar 28, 2022
* [EPM pallet]: remove `number of signed submissions`

Closing paritytech#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>
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
* [EPM pallet]: remove `number of signed submissions`

Closing paritytech#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>
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. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants