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

Limited Kusama <> Polkadot bridge#5174

Closed
svyatonik wants to merge 34 commits into
masterfrom
sv-bridges-finally
Closed

Limited Kusama <> Polkadot bridge#5174
svyatonik wants to merge 34 commits into
masterfrom
sv-bridges-finally

Conversation

@svyatonik
Copy link
Copy Markdown
Contributor

@svyatonik svyatonik commented Mar 22, 2022

Even though there are some TODOs here, the PR is reviewable already (the only planned code changes are weight-related). Main TODOs in this PR:

  • deal with weights - that's the first time we'll be adding bridge benchmarks to the polkadot runtimes, so something may go wrong;
  • upgrade - do we need it at all, or we should use governance process for that?
  • get an explicit approval from @gavofyork on main use-case. I'm not sure if this has been discussed in details before - all that is presented here is just my vision and I have a limited knowledge of Kusama/Polkadot governance mechanisms;
  • security audit of the integration code. All bridge pallets are already audited, but there's some recent updates in the Kusama and Polkadot runtimes that need an audit (all commits, starting from 7f0a28d need an audit).

Short bridge FAQ

This bridge adds Polkadot GRANDPA light client (pallet-bridge-gandpa) to the Kusama runtime and vice versa. This light client may be used to verify proofs (e.g. storage proofs) from the bridged chain. In our implementation, we'll be accepting messages (using pallet-bridge-messages) at the source chain and submit storage proofs of these messages to the target chain. Both chains may serve as the source and target chains. The message in our implementation means encoded call (that's the main part of the regular transaction) that will be accepted at the source chain and then dispatched (using pallet-bridge-dispatch) at the target chain.

Apart from the on-chain pallets, there's also offchain entity - relay/relayer, which is submitting message delivery transactions to both chains.

More details can be found in the parity-bridges-common repository.

Bridge limitations

While the bridge we develop is a general-usage bridge, it'll have serious restrictions in initial deployment.

  1. Bridge may only be used by the Kusama council
  2. Only balances::transfer calls may be sent over the bridge
  3. The bridge will be slow - e.g. it may take 1 hour to deliver message from Kusama to Polkadot and 4 hours to deliver message from Polkadot to Kusama

Why is it so restricted? The main reason is that the bridge is going to change in the future (detailed plan is still WiP) and if we'll allow everyone to use it now, it'll be hard, if not impossible, to perform migrations.

Bridge use-case

@gavofyork - This is the most questionable part here, where I'd like to get your approval.

How it is designed:

  1. there'll be some Kusama account that will pay for the Kusama council messages - KusamaCouncilAccount;
  2. once bridge is deployed, we'll configure it to use the this account for payments (by setting AllowedMessageSender parameter from the polkadot_messages.rs file);
  3. we have a means to 'derive' accounts at the target chain from accounts of the source chain. In our case, we'll need to derive Polkadot account from the KusamaCouncilAccount. Let it be the KusamaCouncilAccountAtPolkadot;
  4. at Polkadot, DOTs may be sent to this accounts from the treasury;
  5. Kusama council members may submit send-message-over-bridge motions, thus spending (transferring) DOTs from KusamaCouncilAccountAtPolkadot at the Polkadot.

Technically it means, that we'll only accept messages that are being sent using origin pallet_collective::RawOrigin::<CouncilCollective>::Members(_, _) or pallet_collective::RawOrigin::<CouncilCollective>::Member(). So even one member can send messages (aka spend DOTs)!

Please check if I'm wrong here - I guess we may need some corrections here.

Local Demo

Everyone may test it with local Kusama/Polkadot chains, using this guide. This guide needs some updates - in particular, how to fill all send-message transaction parameters, but overall it is usable.

There's also kusama-polkadot.test repository, which may be used for spinning up local Kusama and Polkadot nodes + running the bridge. But it is a bit outdated and maintenance is not guaranteed.

P.S.: I'm pinging @andresilva as well, as suggested by @stefan-sopic, since you're somewhat related to bridges :) Feel free to ignore if you feel its outside of your interests/expertise.

@svyatonik svyatonik added A0-please_review Pull request needs code review. B7-runtimenoteworthy C1-low PR touches the given topic and has a low impact on builders. D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited. labels Mar 22, 2022
Comment thread runtime/kusama/src/lib.rs
}

/// Initialize with-Polkadot bridge.
pub struct InitializePolkadotBridge;
Copy link
Copy Markdown
Contributor Author

@svyatonik svyatonik Mar 22, 2022

Choose a reason for hiding this comment

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

I'm unsure about this upgrade. We'll need to initialize the "pallet owner" field of both bridge pallets (that's the account that may issue some special "requests" - e.g. halt bridge during temporarily to handle runtime upgrade , update messages pallet parameters like conversion rate, ...). Don't know if doing this during runtime upgrade or using some governance mechanisms after runtime upgrade is better here.

Comment thread runtime/kusama/src/polkadot_messages.rs Outdated
crate::OriginCaller::system(frame_system::RawOrigin::Signed(ref submitter)) =>
Some(submitter.clone()),

OriginCaller::Council(_) => AllowedMessageSender::get(),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's another questionable part, which I've mentioned in description. It means that we'll only accept messages with OriginCaller::Council origin

@svyatonik
Copy link
Copy Markdown
Contributor Author

/benchmark runtime polkadot pallet_bridge_grandpa

@ghost
Copy link
Copy Markdown

ghost commented Mar 22, 2022

Benchmark Runtime Polkadot Pallet for branch "sv-bridges-finally" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=pallet_bridge_grandpa --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/

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

Results
Pallet: "pallet_bridge_grandpa", Extrinsic: "submit_finality_proof", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaGrandpa IsHalted (r:1 w:0)
Storage: BridgeKusamaGrandpa RequestCount (r:1 w:1)
Storage: BridgeKusamaGrandpa BestFinalized (r:1 w:1)
Storage: BridgeKusamaGrandpa ImportedHeaders (r:1 w:2)
Storage: BridgeKusamaGrandpa CurrentAuthoritySet (r:1 w:0)
Storage: BridgeKusamaGrandpa ImportedHashesPointer (r:1 w:1)
Storage: BridgeKusamaGrandpa ImportedHashes (r:1 w:1)

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

Model:
Time ~=    70.66
    + p     46.7
    + v    1.317
              µs

Reads = 7 + (0 * p) + (0 * v)
Writes = 6 + (0 * p) + (0 * v)

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

Data points distribution:
    p     v   mean µs  sigma µs       %
    1  1000      1427     10.92    0.7%
   21  1000      2366     11.07    0.4%
   41  1000      3297     7.376    0.2%
   61  1000      4240     13.93    0.3%
   81  1000      5169     19.58    0.3%
  101  1000      6162     18.72    0.3%
  121  1000      7026     16.31    0.2%
  141  1000      7995     34.08    0.4%
  161  1000      8896     27.25    0.3%
  181  1000      9880     22.71    0.2%
  201  1000     10780      31.2    0.2%
  221  1000     11680        22    0.1%
  241  1000     12620     24.66    0.1%
  261  1000     13570        40    0.2%
  281  1000     14500     21.92    0.1%
  301  1000     15460     19.45    0.1%
  321  1000     16370     35.23    0.2%
  341  1000     17300     39.15    0.2%
  361  1000     18240     28.42    0.1%
  381  1000     19200     52.58    0.2%
  401  1000     20110     30.92    0.1%
  421  1000     21020     17.64    0.0%
  441  1000     21990     59.33    0.2%
  461  1000     22930     46.97    0.2%
  481  1000     23780     16.31    0.0%
  501  1000     24710     25.13    0.1%
  521  1000     25790     47.79    0.1%
  541  1000     26670     35.72    0.1%
  561  1000     27560     28.71    0.1%
  581  1000     28520     50.25    0.1%
  601  1000     29480     40.94    0.1%
  621  1000     30400     43.31    0.1%
  641  1000     31290     18.96    0.0%
  661  1000     32270     66.31    0.2%
  681  1000     33180      73.3    0.2%
  701  1000     34190      85.7    0.2%
  721  1000     35040     58.21    0.1%
  741  1000     36000     55.83    0.1%
  761  1000     36900     64.45    0.1%
  781  1000     37850     48.47    0.1%
  801  1000     38760     34.83    0.0%
  821  1000     39720     43.48    0.1%
  841  1000     40680     68.09    0.1%
  861  1000     41510     44.46    0.1%
  881  1000     42590     85.46    0.2%
  901  1000     43580     56.34    0.1%
  921  1000     44430     47.24    0.1%
  941  1000     45330     65.63    0.1%
  961  1000     46280     39.61    0.0%
  981  1000     47230     47.93    0.1%
 1001  1000     48240     57.25    0.1%
 1021  1000     49070     84.82    0.1%
 1024     1     47900     66.56    0.1%
 1024    20     47930      60.5    0.1%
 1024    39     47910     44.14    0.0%
 1024    58     47990      50.3    0.1%
 1024    77     48040     70.79    0.1%
 1024    96     48080     57.06    0.1%
 1024   115     48050     35.06    0.0%
 1024   134     48180     57.33    0.1%
 1024   153     48110     53.54    0.1%
 1024   172     48090      39.6    0.0%
 1024   191     48170     35.68    0.0%
 1024   210     48150     26.84    0.0%
 1024   229     48270     85.63    0.1%
 1024   248     48250     66.35    0.1%
 1024   267     48280     72.52    0.1%
 1024   286     48260     56.09    0.1%
 1024   305     48350     43.37    0.0%
 1024   324     48370     40.94    0.0%
 1024   343     48390     50.48    0.1%
 1024   362     48450     49.76    0.1%
 1024   381     48460     49.19    0.1%
 1024   400     48460     57.44    0.1%
 1024   419     48520     98.49    0.2%
 1024   438     48480     45.19    0.0%
 1024   457     48620     44.95    0.0%
 1024   476     48510      52.3    0.1%
 1024   495     48560     38.73    0.0%
 1024   514     48560      67.5    0.1%
 1024   533     48600     42.55    0.0%
 1024   552     48620     45.29    0.0%
 1024   571     48650     36.66    0.0%
 1024   590     48750     50.69    0.1%
 1024   609     48700     59.27    0.1%
 1024   628     48770     58.64    0.1%
 1024   647     48730     49.52    0.1%
 1024   666     48810     70.29    0.1%
 1024   685     48810     70.08    0.1%
 1024   704     48890     53.68    0.1%
 1024   723     48820     25.17    0.0%
 1024   742     48890     54.09    0.1%
 1024   761     48880     63.59    0.1%
 1024   780     48940     55.28    0.1%
 1024   799     49020     65.87    0.1%
 1024   818     49010     65.87    0.1%
 1024   837     49020     53.34    0.1%
 1024   856     49030     34.34    0.0%
 1024   875     49020     62.11    0.1%
 1024   894     49050     53.23    0.1%
 1024   913     49210     54.63    0.1%
 1024   932     49120     31.68    0.0%
 1024   951     49210     54.16    0.1%
 1024   970     49210     52.35    0.1%
 1024   989     49250      48.9    0.0%

Quality and confidence:
param     error
p         0.007
v         0.007

Model:
Time ~=    70.45
    + p    46.73
    + v    1.308
              µs

Reads = 7 + (0 * p) + (0 * v)
Writes = 6 + (0 * p) + (0 * v)


ERROR: Unable to push ./runtime/polkadot/src/weights/

@svyatonik
Copy link
Copy Markdown
Contributor Author

/benchmark runtime polkadot pallet_bridge_messages

@ghost
Copy link
Copy Markdown

ghost commented Mar 22, 2022

Benchmark Runtime Polkadot Pallet for branch "sv-bridges-finally" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=pallet_bridge_messages --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/

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

Results
Pallet: "pallet_bridge_messages", Extrinsic: "send_minimal_message_worst_case", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaMessages OutboundLanes (r:1 w:1)
Storage: unknown [0x3a143f4abdba538105373c7cdb014a50] (r:1 w:0)
Storage: unknown [0x90ae353245e43eb2b7d8771456afb898] (r:1 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: unknown [0x18014d0485d5a02787c9a59d88a35a43] (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: BridgeKusamaMessages OutboundMessages (r:0 w:9)

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

Model:
Time ~=    46.49
              µs

Reads = 8
Writes = 12

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

Model:
Time ~=    46.49
              µs

Reads = 8
Writes = 12

Pallet: "pallet_bridge_messages", Extrinsic: "send_1_kb_message_worst_case", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaMessages OutboundLanes (r:1 w:1)
Storage: unknown [0x3a143f4abdba538105373c7cdb014a50] (r:1 w:0)
Storage: unknown [0x90ae353245e43eb2b7d8771456afb898] (r:1 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: unknown [0x18014d0485d5a02787c9a59d88a35a43] (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: BridgeKusamaMessages OutboundMessages (r:0 w:9)

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

Model:
Time ~=    48.87
              µs

Reads = 8
Writes = 12

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

Model:
Time ~=    48.87
              µs

Reads = 8
Writes = 12

Pallet: "pallet_bridge_messages", Extrinsic: "send_16_kb_message_worst_case", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaMessages OutboundLanes (r:1 w:1)
Storage: unknown [0x3a143f4abdba538105373c7cdb014a50] (r:1 w:0)
Storage: unknown [0x90ae353245e43eb2b7d8771456afb898] (r:1 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: unknown [0x18014d0485d5a02787c9a59d88a35a43] (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: BridgeKusamaMessages OutboundMessages (r:0 w:9)

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

Model:
Time ~=     68.3
              µs

Reads = 8
Writes = 12

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

Model:
Time ~=     68.3
              µs

Reads = 8
Writes = 12

Pallet: "pallet_bridge_messages", Extrinsic: "maximal_increase_message_fee", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaMessages OutboundLanes (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: BridgeKusamaMessages OutboundMessages (r:1 w:1)

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

Model:
Time ~=     3823
              µs

Reads = 5
Writes = 3

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

Model:
Time ~=     3823
              µs

Reads = 5
Writes = 3

Pallet: "pallet_bridge_messages", Extrinsic: "increase_message_fee", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaMessages OutboundLanes (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: BridgeKusamaMessages OutboundMessages (r:1 w:1)

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

Model:
Time ~=        0
    + i    0.001
              µs

Reads = 5 + (0 * i)
Writes = 3 + (0 * i)

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

Data points distribution:
    i   mean µs  sigma µs       %
    0     30.14     0.173    0.5%
52428     102.3     0.283    0.2%
104856     172.3      0.44    0.2%
157284     229.2     1.051    0.4%
209712     290.3     0.423    0.1%
262140     354.3     0.367    0.1%
314568     420.4     4.205    1.0%
366996     480.9     4.344    0.9%
419424     547.5     6.234    1.1%
471852     612.1     5.876    0.9%
524280     681.1     14.63    2.1%
576708     734.1      1.09    0.1%
629136     798.5     3.371    0.4%
681564     868.3     6.069    0.6%
733992     939.1     7.812    0.8%
786420      1003     5.203    0.5%
838848      1079     11.66    1.0%
891276      1163     16.69    1.4%
943704      1221     5.643    0.4%
996132      1308      16.5    1.2%
1048560      1386     11.41    0.8%
1100988      1461     13.76    0.9%
1153416      1532      13.2    0.8%
1205844      1618     13.54    0.8%
1258272      1728     4.906    0.2%
1310700      1811     13.48    0.7%
1363128      1850      12.1    0.6%
1415556      1939     13.81    0.7%
1467984      2002     15.67    0.7%
1520412      2087     9.758    0.4%
1572840      2231     11.09    0.4%
1625268      2257     9.862    0.4%
1677696      2326     14.82    0.6%
1730124      2408     14.99    0.6%
1782552      2487     12.98    0.5%
1834980      2584     13.32    0.5%
1887408      2645     18.82    0.7%
1939836      2723      13.5    0.4%
1992264      2802     17.17    0.6%
2044692      2898     9.591    0.3%
2097120      2949     12.29    0.4%
2149548      3059     19.29    0.6%
2201976      3122     9.868    0.3%
2254404      3228     11.27    0.3%
2306832      3299     10.42    0.3%
2359260      3385     13.85    0.4%
2411688      3461     14.48    0.4%
2464116      3571     11.24    0.3%
2516544      3616     18.15    0.5%
2568972      3683     14.49    0.3%
2621400      3782     17.61    0.4%

Quality and confidence:
param     error
i             0

Model:
Time ~=        0
    + i    0.001
              µs

Reads = 5 + (0 * i)
Writes = 3 + (0 * i)

Pallet: "pallet_bridge_messages", Extrinsic: "receive_single_message_proof", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgeKusamaMessages InboundLanes (r:1 w:1)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)

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

Model:
Time ~=    77.27
              µs

Reads = 4
Writes = 1

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

Model:
Time ~=    77.27
              µs

Reads = 4
Writes = 1

Pallet: "pallet_bridge_messages", Extrinsic: "receive_two_messages_proof", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgeKusamaMessages InboundLanes (r:1 w:1)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)

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

Model:
Time ~=    135.4
              µs

Reads = 4
Writes = 1

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

Model:
Time ~=    135.4
              µs

Reads = 4
Writes = 1

Pallet: "pallet_bridge_messages", Extrinsic: "receive_single_message_proof_with_outbound_lane_state", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgeKusamaMessages InboundLanes (r:1 w:1)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)

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

Model:
Time ~=    82.05
              µs

Reads = 4
Writes = 1

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

Model:
Time ~=    82.05
              µs

Reads = 4
Writes = 1

Pallet: "pallet_bridge_messages", Extrinsic: "receive_single_message_proof_1_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgeKusamaMessages InboundLanes (r:1 w:1)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)

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

Model:
Time ~=    85.12
              µs

Reads = 4
Writes = 1

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

Model:
Time ~=    85.12
              µs

Reads = 4
Writes = 1

Pallet: "pallet_bridge_messages", Extrinsic: "receive_single_message_proof_16_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgeKusamaMessages InboundLanes (r:1 w:1)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)

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

Model:
Time ~=      158
              µs

Reads = 4
Writes = 1

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

Model:
Time ~=      158
              µs

Reads = 4
Writes = 1

Pallet: "pallet_bridge_messages", Extrinsic: "receive_single_prepaid_message_proof", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgeKusamaMessages InboundLanes (r:1 w:1)

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

Model:
Time ~=    74.66
              µs

Reads = 3
Writes = 1

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

Model:
Time ~=    74.66
              µs

Reads = 3
Writes = 1

Pallet: "pallet_bridge_messages", Extrinsic: "receive_delivery_proof_for_single_message", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgeKusamaMessages OutboundLanes (r:1 w:1)
Storage: BridgeKusamaMessages OutboundMessages (r:1 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: System Account (r:2 w:2)

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

Model:
Time ~=    45.86
              µs

Reads = 7
Writes = 3

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

Model:
Time ~=    45.86
              µs

Reads = 7
Writes = 3

Pallet: "pallet_bridge_messages", Extrinsic: "receive_delivery_proof_for_two_messages_by_single_relayer", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgeKusamaMessages OutboundLanes (r:1 w:1)
Storage: BridgeKusamaMessages OutboundMessages (r:2 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: System Account (r:2 w:2)

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

Model:
Time ~=    49.72
              µs

Reads = 8
Writes = 3

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

Model:
Time ~=    49.72
              µs

Reads = 8
Writes = 3

Pallet: "pallet_bridge_messages", Extrinsic: "receive_delivery_proof_for_two_messages_by_two_relayers", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaMessages PalletOperatingMode (r:1 w:0)
Storage: BridgeKusamaGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgeKusamaMessages OutboundLanes (r:1 w:1)
Storage: BridgeKusamaMessages OutboundMessages (r:2 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: System Account (r:3 w:3)

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

Model:
Time ~=    63.16
              µs

Reads = 9
Writes = 4

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

Model:
Time ~=    63.16
              µs

Reads = 9
Writes = 4


Parity Bot added 2 commits March 22, 2022 10:15
…-- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=pallet_bridge_messages --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/
@svyatonik
Copy link
Copy Markdown
Contributor Author

/benchmark runtime polkadot pallet_bridge_grandpa

@ghost
Copy link
Copy Markdown

ghost commented Mar 22, 2022

Benchmark Runtime Polkadot Pallet for branch "sv-bridges-finally" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=pallet_bridge_grandpa --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/

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

Results
Pallet: "pallet_bridge_grandpa", Extrinsic: "submit_finality_proof", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgeKusamaGrandpa IsHalted (r:1 w:0)
Storage: BridgeKusamaGrandpa RequestCount (r:1 w:1)
Storage: BridgeKusamaGrandpa BestFinalized (r:1 w:1)
Storage: BridgeKusamaGrandpa ImportedHeaders (r:1 w:2)
Storage: BridgeKusamaGrandpa CurrentAuthoritySet (r:1 w:0)
Storage: BridgeKusamaGrandpa ImportedHashesPointer (r:1 w:1)
Storage: BridgeKusamaGrandpa ImportedHashes (r:1 w:1)

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

Model:
Time ~=    94.73
    + p    46.94
    + v    1.389
              µs

Reads = 7 + (0 * p) + (0 * v)
Writes = 6 + (0 * p) + (0 * v)

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

Data points distribution:
    p     v   mean µs  sigma µs       %
    1  1000      1523     14.31    0.9%
   21  1000      2457     8.247    0.3%
   41  1000      3408     10.38    0.3%
   61  1000      4334     17.31    0.3%
   81  1000      5286     15.44    0.2%
  101  1000      6278     17.31    0.2%
  121  1000      7136     19.58    0.2%
  141  1000      8090     19.34    0.2%
  161  1000      9015     40.44    0.4%
  181  1000      9996     20.11    0.2%
  201  1000     10950     24.52    0.2%
  221  1000     11840     29.79    0.2%
  241  1000     12790     32.05    0.2%
  261  1000     13750     32.27    0.2%
  281  1000     14680     32.05    0.2%
  301  1000     15630     36.94    0.2%
  321  1000     16560     24.48    0.1%
  341  1000     17510     47.97    0.2%
  361  1000     18460     49.88    0.2%
  381  1000     19360     45.58    0.2%
  401  1000     20300     26.24    0.1%
  421  1000     21290     56.69    0.2%
  441  1000     22190     31.66    0.1%
  461  1000     23110     40.63    0.1%
  481  1000     24000     41.32    0.1%
  501  1000     24970     40.96    0.1%
  521  1000     25950     63.88    0.2%
  541  1000     26900     32.99    0.1%
  561  1000     27820     35.61    0.1%
  581  1000     28710     27.62    0.0%
  601  1000     29630     27.14    0.0%
  621  1000     30620     62.88    0.2%
  641  1000     31490     44.52    0.1%
  661  1000     32500     28.09    0.0%
  681  1000     33450     52.05    0.1%
  701  1000     34330     35.92    0.1%
  721  1000     35310     57.16    0.1%
  741  1000     36220     58.77    0.1%
  761  1000     37180     69.45    0.1%
  781  1000     38100     55.07    0.1%
  801  1000     39070     78.49    0.2%
  821  1000     39980     44.54    0.1%
  841  1000     41000     34.02    0.0%
  861  1000     41880     76.57    0.1%
  881  1000     42870     31.12    0.0%
  901  1000     43770     28.97    0.0%
  921  1000     44740     64.68    0.1%
  941  1000     45710     53.96    0.1%
  961  1000     46630     24.33    0.0%
  981  1000     47580     66.62    0.1%
 1001  1000     48560     51.84    0.1%
 1021  1000     49450     44.47    0.0%
 1024     1     48080     69.28    0.1%
 1024    20     48180        40    0.0%
 1024    39     48210      71.7    0.1%
 1024    58     48250     83.74    0.1%
 1024    77     48230     42.18    0.0%
 1024    96     48350     82.52    0.1%
 1024   115     48330     71.84    0.1%
 1024   134     48350     62.26    0.1%
 1024   153     48320     58.81    0.1%
 1024   172     48440     52.65    0.1%
 1024   191     48440     56.32    0.1%
 1024   210     48490     47.01    0.0%
 1024   229     48460     60.34    0.1%
 1024   248     48530     42.41    0.0%
 1024   267     48460     42.93    0.0%
 1024   286     48590        72    0.1%
 1024   305     48560     55.94    0.1%
 1024   324     48670     90.47    0.1%
 1024   343     48620        73    0.1%
 1024   362     48700     35.54    0.0%
 1024   381     48740     46.41    0.0%
 1024   400     48720     49.04    0.1%
 1024   419     48730     63.74    0.1%
 1024   438     48790     40.72    0.0%
 1024   457     48780     45.03    0.0%
 1024   476     48820     46.53    0.0%
 1024   495     48830      41.1    0.0%
 1024   514     48890     51.12    0.1%
 1024   533     48880     34.02    0.0%
 1024   552     48890     49.99    0.1%
 1024   571     48960     99.75    0.2%
 1024   590     48940     74.21    0.1%
 1024   609     48980      45.5    0.0%
 1024   628     49030     36.15    0.0%
 1024   647     49030     52.09    0.1%
 1024   666     49050      32.6    0.0%
 1024   685     49120     77.48    0.1%
 1024   704     49160     63.64    0.1%
 1024   723     49160     61.05    0.1%
 1024   742     49180     63.42    0.1%
 1024   761     49220     44.61    0.0%
 1024   780     49280     39.59    0.0%
 1024   799     49290     52.03    0.1%
 1024   818     49270     89.84    0.1%
 1024   837     49270     43.08    0.0%
 1024   856     49300     31.15    0.0%
 1024   875     49360     53.59    0.1%
 1024   894     49480     31.25    0.0%
 1024   913     49470     39.13    0.0%
 1024   932     49480     56.63    0.1%
 1024   951     49520     51.77    0.1%
 1024   970     49470      59.3    0.1%
 1024   989     49530     32.12    0.0%

Quality and confidence:
param     error
p         0.007
v         0.007

Model:
Time ~=    82.91
    + p    46.95
    + v    1.396
              µs

Reads = 7 + (0 * p) + (0 * v)
Writes = 6 + (0 * p) + (0 * v)


…-- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=pallet_bridge_grandpa --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/
@svyatonik
Copy link
Copy Markdown
Contributor Author

/benchmark runtime kusama pallet_bridge_grandpa

@ghost
Copy link
Copy Markdown

ghost commented Mar 23, 2022

Benchmark Runtime Kusama Pallet for branch "sv-bridges-finally" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_bridge_grandpa --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/

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

Results
Pallet: "pallet_bridge_grandpa", Extrinsic: "submit_finality_proof", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotGrandpa IsHalted (r:1 w:0)
Storage: BridgePolkadotGrandpa RequestCount (r:1 w:1)
Storage: BridgePolkadotGrandpa BestFinalized (r:1 w:1)
Storage: BridgePolkadotGrandpa ImportedHeaders (r:1 w:2)
Storage: BridgePolkadotGrandpa CurrentAuthoritySet (r:1 w:0)
Storage: BridgePolkadotGrandpa ImportedHashesPointer (r:1 w:1)
Storage: BridgePolkadotGrandpa ImportedHashes (r:1 w:1)

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

Model:
Time ~=    85.68
    + p    46.66
    + v    1.319
              µs

Reads = 7 + (0 * p) + (0 * v)
Writes = 6 + (0 * p) + (0 * v)

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

Data points distribution:
    p     v   mean µs  sigma µs       %
    1  1000      1449     9.694    0.6%
   21  1000      2369     8.376    0.3%
   41  1000      3311     7.576    0.2%
   61  1000      4237     16.55    0.3%
   81  1000      5171     12.28    0.2%
  101  1000      6197     17.49    0.2%
  121  1000      7055     21.23    0.3%
  141  1000      7965     10.74    0.1%
  161  1000      8914     21.06    0.2%
  181  1000      9864     19.81    0.2%
  201  1000     10820     30.17    0.2%
  221  1000     11690     15.66    0.1%
  241  1000     12640     26.36    0.2%
  261  1000     13590     25.99    0.1%
  281  1000     14520     36.03    0.2%
  301  1000     15470     35.35    0.2%
  321  1000     16370      26.3    0.1%
  341  1000     17310     30.56    0.1%
  361  1000     18240     39.31    0.2%
  381  1000     19160     21.94    0.1%
  401  1000     20120     36.85    0.1%
  421  1000     21040     38.11    0.1%
  441  1000     21970     33.33    0.1%
  461  1000     22920      37.9    0.1%
  481  1000     23840     38.91    0.1%
  501  1000     24830     56.91    0.2%
  521  1000     25780     36.72    0.1%
  541  1000     26610     22.77    0.0%
  561  1000     27550     43.44    0.1%
  581  1000     28530     39.55    0.1%
  601  1000     29420     39.28    0.1%
  621  1000     30350     34.07    0.1%
  641  1000     31370     106.9    0.3%
  661  1000     32190     40.92    0.1%
  681  1000     33200     54.64    0.1%
  701  1000     34140     57.53    0.1%
  721  1000     35080     42.75    0.1%
  741  1000     35990     66.01    0.1%
  761  1000     36920     53.87    0.1%
  781  1000     37830     43.74    0.1%
  801  1000     38760     62.56    0.1%
  821  1000     39720     44.41    0.1%
  841  1000     40630     35.15    0.0%
  861  1000     41590     49.64    0.1%
  881  1000     42460      29.6    0.0%
  901  1000     43430     43.71    0.1%
  921  1000     44440     48.34    0.1%
  941  1000     45360     66.01    0.1%
  961  1000     46330     54.68    0.1%
  981  1000     47190        61    0.1%
 1001  1000     48110     36.65    0.0%
 1021  1000     49090     68.72    0.1%
 1024     1     47840     22.09    0.0%
 1024    20     47900     42.08    0.0%
 1024    39     47880     31.62    0.0%
 1024    58     47940     66.96    0.1%
 1024    77     47930      42.8    0.0%
 1024    96     48040     58.91    0.1%
 1024   115     48020     64.23    0.1%
 1024   134     48130     52.06    0.1%
 1024   153     48060     55.49    0.1%
 1024   172     48070     28.97    0.0%
 1024   191     48230     52.63    0.1%
 1024   210     48190     58.28    0.1%
 1024   229     48190     49.38    0.1%
 1024   248     48270        64    0.1%
 1024   267     48230     65.85    0.1%
 1024   286     48240     62.52    0.1%
 1024   305     48320     49.59    0.1%
 1024   324     48280      53.4    0.1%
 1024   343     48340     28.19    0.0%
 1024   362     48400     56.69    0.1%
 1024   381     48440      48.9    0.1%
 1024   400     48420     87.54    0.1%
 1024   419     48480     79.15    0.1%
 1024   438     48540     63.78    0.1%
 1024   457     48490     54.01    0.1%
 1024   476     48520     38.96    0.0%
 1024   495     48550     36.14    0.0%
 1024   514     48590     35.03    0.0%
 1024   533     48590     40.05    0.0%
 1024   552     48600      54.5    0.1%
 1024   571     48650     59.16    0.1%
 1024   590     48760     39.03    0.0%
 1024   609     48800     68.25    0.1%
 1024   628     48730      73.5    0.1%
 1024   647     48730     67.06    0.1%
 1024   666     48750     51.23    0.1%
 1024   685     48680     50.08    0.1%
 1024   704     48840     50.64    0.1%
 1024   723     48790     52.42    0.1%
 1024   742     48860     46.26    0.0%
 1024   761     48940     57.57    0.1%
 1024   780     48930     29.43    0.0%
 1024   799     48970     40.24    0.0%
 1024   818     48950     31.77    0.0%
 1024   837     49030     74.11    0.1%
 1024   856     49000     53.53    0.1%
 1024   875     48960     49.72    0.1%
 1024   894     49080     43.89    0.0%
 1024   913     49100     78.47    0.1%
 1024   932     49090     67.14    0.1%
 1024   951     49100     68.37    0.1%
 1024   970     49120     48.65    0.0%
 1024   989     49200     36.81    0.0%

Quality and confidence:
param     error
p         0.007
v         0.007

Model:
Time ~=    93.16
    + p    46.68
    + v    1.308
              µs

Reads = 7 + (0 * p) + (0 * v)
Writes = 6 + (0 * p) + (0 * v)


Parity Bot added 2 commits March 23, 2022 05:39
…-- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_bridge_grandpa --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/
@svyatonik
Copy link
Copy Markdown
Contributor Author

/benchmark runtime kusama pallet_bridge_messages

@ghost
Copy link
Copy Markdown

ghost commented Mar 23, 2022

Benchmark Runtime Kusama Pallet for branch "sv-bridges-finally" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_bridge_messages --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/

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

Results
Pallet: "pallet_bridge_messages", Extrinsic: "send_minimal_message_worst_case", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotMessages OutboundLanes (r:1 w:1)
Storage: unknown [0x3a143f4abdba538105373c7cdb014a50] (r:1 w:0)
Storage: unknown [0x8626edfd24ecc30ca2c42535541fa3a7] (r:1 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: unknown [0x51f1dbb0462eff18ec87eafdf9569989] (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: BridgePolkadotMessages OutboundMessages (r:0 w:9)

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

Model:
Time ~=    45.68
              µs

Reads = 8
Writes = 12

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

Model:
Time ~=    45.68
              µs

Reads = 8
Writes = 12

Pallet: "pallet_bridge_messages", Extrinsic: "send_1_kb_message_worst_case", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotMessages OutboundLanes (r:1 w:1)
Storage: unknown [0x3a143f4abdba538105373c7cdb014a50] (r:1 w:0)
Storage: unknown [0x8626edfd24ecc30ca2c42535541fa3a7] (r:1 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: unknown [0x51f1dbb0462eff18ec87eafdf9569989] (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: BridgePolkadotMessages OutboundMessages (r:0 w:9)

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

Model:
Time ~=    48.21
              µs

Reads = 8
Writes = 12

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

Model:
Time ~=    48.21
              µs

Reads = 8
Writes = 12

Pallet: "pallet_bridge_messages", Extrinsic: "send_16_kb_message_worst_case", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotMessages OutboundLanes (r:1 w:1)
Storage: unknown [0x3a143f4abdba538105373c7cdb014a50] (r:1 w:0)
Storage: unknown [0x8626edfd24ecc30ca2c42535541fa3a7] (r:1 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: unknown [0x51f1dbb0462eff18ec87eafdf9569989] (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: BridgePolkadotMessages OutboundMessages (r:0 w:9)

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

Model:
Time ~=    67.69
              µs

Reads = 8
Writes = 12

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

Model:
Time ~=    67.69
              µs

Reads = 8
Writes = 12

Pallet: "pallet_bridge_messages", Extrinsic: "maximal_increase_message_fee", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotMessages OutboundLanes (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: BridgePolkadotMessages OutboundMessages (r:1 w:1)

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

Model:
Time ~=     3777
              µs

Reads = 5
Writes = 3

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

Model:
Time ~=     3777
              µs

Reads = 5
Writes = 3

Pallet: "pallet_bridge_messages", Extrinsic: "increase_message_fee", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotMessages OutboundLanes (r:1 w:0)
Storage: System Account (r:2 w:2)
Storage: BridgePolkadotMessages OutboundMessages (r:1 w:1)

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

Model:
Time ~=        0
    + i    0.001
              µs

Reads = 5 + (0 * i)
Writes = 3 + (0 * i)

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

Data points distribution:
    i   mean µs  sigma µs       %
    0     30.21     0.428    1.4%
52428     102.6     0.245    0.2%
104856     167.1     0.505    0.3%
157284     229.8     2.512    1.0%
209712     292.7     0.548    0.1%
262140     354.9     0.718    0.2%
314568     421.2     2.633    0.6%
366996       488     10.79    2.2%
419424     545.9     4.716    0.8%
471852     617.1      12.9    2.0%
524280     668.3     1.058    0.1%
576708       744     11.29    1.5%
629136     798.4     1.179    0.1%
681564     865.7     7.367    0.8%
733992     931.3      9.72    1.0%
786420      1006     12.11    1.2%
838848      1064     2.253    0.2%
891276      1152     12.26    1.0%
943704      1230     16.02    1.3%
996132      1288      2.61    0.2%
1048560      1379     10.78    0.7%
1100988      1443      10.5    0.7%
1153416      1526     11.89    0.7%
1205844      1608     13.83    0.8%
1258272      1683     14.78    0.8%
1310700      1803     11.36    0.6%
1363128      1853     15.69    0.8%
1415556      1932     18.19    0.9%
1467984      1999     8.678    0.4%
1520412      2077     14.25    0.6%
1572840      2241     14.07    0.6%
1625268      2223     10.41    0.4%
1677696      2312     8.006    0.3%
1730124      2408     6.942    0.2%
1782552      2484     8.572    0.3%
1834980      2548     10.68    0.4%
1887408      2645     12.11    0.4%
1939836      2697     13.19    0.4%
1992264      2796     13.65    0.4%
2044692      2864     17.93    0.6%
2097120      2953     5.974    0.2%
2149548      3050     16.27    0.5%
2201976      3108     19.73    0.6%
2254404      3196     11.81    0.3%
2306832      3265     9.904    0.3%
2359260      3372     11.55    0.3%
2411688      3442     12.17    0.3%
2464116      3538     13.01    0.3%
2516544      3601     14.33    0.3%
2568972      3691     17.02    0.4%
2621400      3762      13.6    0.3%

Quality and confidence:
param     error
i             0

Model:
Time ~=        0
    + i    0.001
              µs

Reads = 5 + (0 * i)
Writes = 3 + (0 * i)

Pallet: "pallet_bridge_messages", Extrinsic: "receive_single_message_proof", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgePolkadotMessages InboundLanes (r:1 w:1)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)

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

Model:
Time ~=    77.85
              µs

Reads = 4
Writes = 1

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

Model:
Time ~=    77.85
              µs

Reads = 4
Writes = 1

Pallet: "pallet_bridge_messages", Extrinsic: "receive_two_messages_proof", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgePolkadotMessages InboundLanes (r:1 w:1)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)

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

Model:
Time ~=    136.6
              µs

Reads = 4
Writes = 1

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

Model:
Time ~=    136.6
              µs

Reads = 4
Writes = 1

Pallet: "pallet_bridge_messages", Extrinsic: "receive_single_message_proof_with_outbound_lane_state", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgePolkadotMessages InboundLanes (r:1 w:1)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)

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

Model:
Time ~=    83.19
              µs

Reads = 4
Writes = 1

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

Model:
Time ~=    83.19
              µs

Reads = 4
Writes = 1

Pallet: "pallet_bridge_messages", Extrinsic: "receive_single_message_proof_1_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgePolkadotMessages InboundLanes (r:1 w:1)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)

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

Model:
Time ~=    83.73
              µs

Reads = 4
Writes = 1

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

Model:
Time ~=    83.73
              µs

Reads = 4
Writes = 1

Pallet: "pallet_bridge_messages", Extrinsic: "receive_single_message_proof_16_kb", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgePolkadotMessages InboundLanes (r:1 w:1)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)

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

Model:
Time ~=    157.9
              µs

Reads = 4
Writes = 1

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

Model:
Time ~=    157.9
              µs

Reads = 4
Writes = 1

Pallet: "pallet_bridge_messages", Extrinsic: "receive_single_prepaid_message_proof", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgePolkadotMessages InboundLanes (r:1 w:1)

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

Model:
Time ~=    75.79
              µs

Reads = 3
Writes = 1

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

Model:
Time ~=    75.79
              µs

Reads = 3
Writes = 1

Pallet: "pallet_bridge_messages", Extrinsic: "receive_delivery_proof_for_single_message", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgePolkadotMessages OutboundLanes (r:1 w:1)
Storage: BridgePolkadotMessages OutboundMessages (r:1 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: System Account (r:2 w:2)

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

Model:
Time ~=    47.67
              µs

Reads = 7
Writes = 3

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

Model:
Time ~=    47.67
              µs

Reads = 7
Writes = 3

Pallet: "pallet_bridge_messages", Extrinsic: "receive_delivery_proof_for_two_messages_by_single_relayer", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgePolkadotMessages OutboundLanes (r:1 w:1)
Storage: BridgePolkadotMessages OutboundMessages (r:2 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: System Account (r:2 w:2)

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

Model:
Time ~=    50.39
              µs

Reads = 8
Writes = 3

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

Model:
Time ~=    50.39
              µs

Reads = 8
Writes = 3

Pallet: "pallet_bridge_messages", Extrinsic: "receive_delivery_proof_for_two_messages_by_two_relayers", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: BridgePolkadotMessages PalletOperatingMode (r:1 w:0)
Storage: BridgePolkadotGrandpa ImportedHeaders (r:1 w:0)
Storage: BridgePolkadotMessages OutboundLanes (r:1 w:1)
Storage: BridgePolkadotMessages OutboundMessages (r:2 w:0)
Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
Storage: System Account (r:3 w:3)

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

Model:
Time ~=    64.45
              µs

Reads = 9
Writes = 4

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

Model:
Time ~=    64.45
              µs

Reads = 9
Writes = 4


Parity Bot and others added 3 commits March 23, 2022 09:31
…-- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_bridge_messages --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/
@gavofyork
Copy link
Copy Markdown
Member

So this isn’t quite about allowing the Kusama Council to spend Kusama’s DOT. And it’s certainly not about allowing any individual council member to spend the DOT. Rather it’s about allowing the Kusama treasury to own DOT. In the light of Gov2, which will be rolled out imminently this distinction is especially important since there will not be a council if/when it gets deployed.

@svyatonik
Copy link
Copy Markdown
Contributor Author

svyatonik commented Apr 11, 2022

So this isn’t quite about allowing the Kusama Council to spend Kusama’s DOT. Rather it’s about allowing the Kusama treasury to own DOT.

Ok, I may be wrong here as I've already lost origins of this requirement. But it is what we/I've been working here so far. Possibly, it was just one possible implementations:

  1. Kusama council is responsible for approving/rejecting treasury funds spending requests. I.e. it kinda "controls" treasury;
  2. we are "adding DOTs to Kusama treasury" by allowing council to control DOTs on Polkadot through the bridge.

The original idea was to have some kind of wrapped DOTs on Kusama (iirc some pallet that implements Currency trait or just some of its APIs and sends bridge messages when is called) was dropped in favor of this ^^^ at some point.

And it’s certainly not about allowing any individual council member to spend the DOT.

Yes - that's what I'm unsure about. The options are to change it to majority or complete council. But it depends on whether all this schema works (where council directly controls DOTs over the bridge) for you.

In the light of Gov2, which will be rolled out imminently this distinction is especially important since there will not be a council if/when it gets deployed.

If there won't be a council or any other group (read: dispatch origin) that we may grant control over bridged DOTs, then we'll need to be able to process spend-treasury-DOTs referenda somehow, right? If we'll keep this control-DOTs-over-bridge concept, then there's a problem even at first glance. Right now we're storing weight and spec_version with the encoded call in the bridge message and while referendum is active (which I suppose takes some time), the message could "spoil" by the time it'll be dispatched. This could happen if bridged runtime (Polkadot in our case) is upgraded because of weight and version mismatch. I guess XCM could help here, but its integration isn't even started. We can add other intermediate stable format for that that will only support Balances::transfer calls, though.


In any case, the future of this PR isn't clear to me. Shall we introduce some minor fixes and make it work with majority/complete council approval (mean: governance v1)? Shall we postpone bridge and start adapting it for governance v2? Do we need to change the way how Kusama council/members can control DOTs - i.e. wDOTs instead of control-DOTs-over-bridge?

@svyatonik
Copy link
Copy Markdown
Contributor Author

the decision is to deploy XCM bridge (either relay or para) instead. closing

@svyatonik svyatonik closed this Apr 15, 2022
@bkchr bkchr deleted the sv-bridges-finally branch April 16, 2022 10:09
@louismerlin louismerlin removed the D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited. label Oct 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants