From 235e3cbf0a152616d2de2a786a9affe87e6fdc97 Mon Sep 17 00:00:00 2001 From: Xavier Lau Date: Mon, 22 Mar 2021 13:40:45 +0800 Subject: [PATCH] Substrate Updates (#513) * anchor rococo-v1.0 * companion: for #substrate-7997 * cargo fmt * companion: for #substrate-7951 * companion: for #substrate-7994 * companion: for #substrate-8012 * companion: for #substrate-8082 * companion: for #substrate-8080 * companion: for #substrate-8076 * companion: for #substrate-8079 * companion: for #substrate-8127 * companion: for #substrate-8124 * companion: for #substrate-8042 * update dependencies * EVM Deps Updates (#536) * Update Parity Common (#532) * try update deps - part 1 * try update deps - part 2 * update codec version * add missing feature * add missing feature * update dependencies * try update deps - part 3 & migrate mock to `construct_runtime` * update format * companion for #substrate-8128 - part 1 * companion for #substrate-8128 - part 2 * migrate mock to `construct_runtime` * try update deps - part 4 * companion for #substrate-8128 - part 3 * migrate mock to `construct_runtime` * migrate mock to `construct_runtime` * update format * resolve conflicts * remove test env * companion for #substrate-8128 * update dvm deps * companion for #substrate-7127 * fix compile * companion for #substrate-8038 * companion for #substrate-8155 * companion for #substrate-7517 * companion for #substrate-7909 * companion for #substrate-8148 * update foramt * companion for #substrate-8123 * update format * companion for #substrate-8211 * companion for #substrate-8244 * companion for #substrate-8272 * companion for #substrate-8277 * companion for #substrate-8272 * companion for #substrate-8275 * companion for #substrate-7994 - part 2 * companion for #substrate-8076 * update dependencies * update `RuntimeApiCollection` * migrate ALL mock to `construct_runtime`!! * update pallet order * try resolve deps problem for Darwinia PC2 * simplify runtime & spec * use darwinia-network/substrate * initialize council & techcomm members * update genesis evm accounts Co-authored-by: bear <2630582710@qq.com> --- .../alerting-rules/alerting-rules.yaml | 7 + .../substrate-dashboard.json | 1548 ------------ .../substrate-networking.json | 98 +- .../substrate-service-tasks.json | 41 +- Cargo.lock | 2200 +++++++++-------- bin/node/cli/Cargo.toml | 95 +- bin/node/cli/src/chain_spec.rs | 329 +-- bin/node/cli/src/cli.rs | 5 + bin/node/cli/src/command.rs | 14 + bin/node/cli/src/rpc.rs | 2 +- bin/node/cli/src/service.rs | 31 +- bin/node/primitives/Cargo.toml | 4 +- bin/node/runtime/pangolin/Cargo.toml | 95 +- bin/node/runtime/pangolin/src/babe.rs | 5 +- bin/node/runtime/pangolin/src/democracy.rs | 2 +- .../src/election_provider_multi_phase.rs | 44 + bin/node/runtime/pangolin/src/grandpa.rs | 3 +- bin/node/runtime/pangolin/src/im_online.rs | 1 + bin/node/runtime/pangolin/src/lib.rs | 104 +- bin/node/runtime/pangolin/src/staking.rs | 1 + client/cli/Cargo.toml | 8 +- client/cli/src/lib.rs | 29 - client/dvm/consensus/Cargo.toml | 26 +- client/dvm/consensus/src/lib.rs | 4 +- client/dvm/db/Cargo.toml | 14 +- client/dvm/mapping-sync/Cargo.toml | 10 +- client/dvm/rpc/Cargo.toml | 30 +- frame/balances/Cargo.toml | 17 +- frame/balances/rpc/Cargo.toml | 8 +- frame/balances/rpc/runtime-api/Cargo.toml | 6 +- frame/balances/src/lib.rs | 8 +- frame/balances/src/tests_local.rs | 4 +- frame/balances/src/weights.rs | 2 +- frame/bridge/crab/backing/Cargo.toml | 8 +- frame/bridge/crab/issuing/Cargo.toml | 10 +- frame/bridge/crab/issuing/src/mock.rs | 76 +- frame/bridge/ethereum/backing/Cargo.toml | 26 +- frame/bridge/ethereum/backing/src/lib.rs | 36 +- frame/bridge/ethereum/backing/src/mock.rs | 172 +- .../backing/src/test_with_linear_relay.rs | 8 +- .../ethereum/backing/src/test_with_relay.rs | 8 +- frame/bridge/ethereum/linear-relay/Cargo.toml | 33 +- frame/bridge/ethereum/linear-relay/src/lib.rs | 15 +- .../bridge/ethereum/linear-relay/src/mock.rs | 69 +- frame/bridge/ethereum/relay/Cargo.toml | 22 +- frame/bridge/ethereum/relay/src/mock.rs | 103 +- frame/bridge/relay-authorities/Cargo.toml | 14 +- frame/bridge/relay-authorities/src/mock.rs | 12 +- frame/bridge/relayer-game/Cargo.toml | 17 +- frame/bridge/relayer-game/src/lib.rs | 59 +- frame/bridge/relayer-game/src/mock.rs | 72 +- frame/bridge/tron/backing/Cargo.toml | 8 +- frame/claims/Cargo.toml | 15 +- frame/claims/src/lib.rs | 10 +- frame/democracy/Cargo.toml | 20 +- frame/democracy/src/tests.rs | 77 +- frame/democracy/src/vote.rs | 2 +- frame/democracy/src/weights.rs | 2 +- frame/dvm-dynamic-fee/Cargo.toml | 20 +- frame/dvm/Cargo.toml | 40 +- frame/dvm/rpc/Cargo.toml | 14 +- frame/dvm/rpc/runtime-api/Cargo.toml | 16 +- frame/dvm/src/lib.rs | 1 + frame/dvm/src/mock.rs | 57 +- frame/dvm/src/tests.rs | 9 +- frame/elections-phragmen/Cargo.toml | 19 +- frame/elections-phragmen/src/lib.rs | 54 +- frame/elections-phragmen/src/weights.rs | 2 +- frame/evm/Cargo.toml | 29 +- .../precompile/contracts/blake2/Cargo.toml | 6 +- .../evm/precompile/contracts/bn128/Cargo.toml | 8 +- .../precompile/contracts/dispatch/Cargo.toml | 14 +- .../precompile/contracts/ed25519/Cargo.toml | 10 +- .../evm/precompile/contracts/empty/Cargo.toml | 2 +- .../evm/precompile/contracts/kton/Cargo.toml | 36 +- .../precompile/contracts/modexp/Cargo.toml | 8 +- .../precompile/contracts/simple/Cargo.toml | 8 +- .../precompile/contracts/withdraw/Cargo.toml | 20 +- frame/evm/src/lib.rs | 4 +- frame/evm/src/runner/stack.rs | 32 +- frame/evm/src/tests.rs | 64 +- frame/header-mmr/Cargo.toml | 15 +- frame/header-mmr/rpc/Cargo.toml | 8 +- frame/header-mmr/rpc/runtime-api/Cargo.toml | 8 +- frame/header-mmr/src/lib.rs | 6 +- frame/staking/Cargo.toml | 36 +- frame/staking/rpc/Cargo.toml | 8 +- frame/staking/rpc/runtime-api/Cargo.toml | 6 +- frame/staking/src/inflation.rs | 7 +- frame/staking/src/lib.rs | 337 ++- frame/staking/src/mock.rs | 24 +- frame/staking/src/offchain_election.rs | 26 +- frame/staking/src/substrate_tests.rs | 114 +- frame/staking/src/weights.rs | 220 +- frame/support/Cargo.toml | 10 +- frame/support/src/testing.rs | 20 - frame/treasury/Cargo.toml | 16 +- frame/treasury/src/mock.rs | 62 +- frame/treasury/src/tests.rs | 4 +- frame/treasury/src/weights.rs | 2 +- frame/vesting/Cargo.toml | 16 +- frame/vesting/src/lib.rs | 10 +- primitives/consensus/Cargo.toml | 22 +- primitives/consensus/src/lib.rs | 6 +- primitives/ethereum-primitives/Cargo.toml | 52 +- primitives/ethereum-primitives/src/header.rs | 12 +- primitives/evm/Cargo.toml | 10 +- primitives/merkle-patricia-trie/Cargo.toml | 21 +- primitives/merkle-patricia-trie/src/proof.rs | 2 +- primitives/merkle-patricia-trie/src/tests.rs | 2 +- primitives/merkle-patricia-trie/src/trie.rs | 26 +- primitives/relay/Cargo.toml | 8 +- primitives/rpc/Cargo.toml | 2 +- 113 files changed, 3118 insertions(+), 4162 deletions(-) delete mode 100644 .maintain/monitoring/grafana-dashboards/substrate-dashboard.json create mode 100644 bin/node/runtime/pangolin/src/election_provider_multi_phase.rs diff --git a/.maintain/monitoring/alerting-rules/alerting-rules.yaml b/.maintain/monitoring/alerting-rules/alerting-rules.yaml index 46ca9ae89e..d6ec1f5f54 100644 --- a/.maintain/monitoring/alerting-rules/alerting-rules.yaml +++ b/.maintain/monitoring/alerting-rules/alerting-rules.yaml @@ -108,6 +108,13 @@ groups: annotations: message: 'The node {{ $labels.instance }} has less than 3 peers for more than 15 minutes' + - alert: NoIncomingConnection + expr: increase(polkadot_sub_libp2p_incoming_connections_total[20m]) == 0 + labels: + severity: warning + annotations: + message: 'The node {{ $labels.instance }} has not received any new incoming + TCP connection in the past 20 minutes. Is it connected to the Internet?' ############################################################################## # System diff --git a/.maintain/monitoring/grafana-dashboards/substrate-dashboard.json b/.maintain/monitoring/grafana-dashboards/substrate-dashboard.json deleted file mode 100644 index f5d6a201c2..0000000000 --- a/.maintain/monitoring/grafana-dashboards/substrate-dashboard.json +++ /dev/null @@ -1,1548 +0,0 @@ -{ - "annotations": { - "list": [ - { - "$$hashKey": "object:15", - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "iteration": 1586424254170, - "links": [ - { - "icon": "external link", - "tags": [], - "targetBlank": true, - "title": "With love from ColmenaLabs", - "tooltip": "", - "type": "link", - "url": "https://colmenalabs.org" - }, - { - "icon": "external link", - "tags": [], - "targetBlank": true, - "title": "Polkastats.io", - "tooltip": "", - "type": "link", - "url": "https://polkastats.io" - } - ], - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 0, - "y": 0 - }, - "hiddenSeries": false, - "id": 8, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate([[metric_namespace]]_block_height{status=\"finalized\",instance=\"[[instance]]\",network=\"[[network]]\"}[10m])/rate([[metric_namespace]]_block_height{status=\"finalized\",instance=\"[[instance]]\",network=\"[[network]]\"}[1m])", - "intervalFactor": 1, - "legendFormat": "rate[10m] / rate[1m]", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Relative Block Production Speed", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 6, - "y": 0 - }, - "hiddenSeries": false, - "id": 15, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "[[metric_namespace]]_sub_libp2p_peers_count{instance=\"[[instance]]\",network=\"[[network]]\"}", - "legendFormat": "{{instance}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Peers count", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "cacheTimeout": null, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 12, - "y": 0 - }, - "hiddenSeries": false, - "id": 17, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pluginVersion": "6.4.1", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "scalar([[metric_namespace]]_block_height{status=\"best\",instance=\"[[instance]]\",network=\"[[network]]\"})-scalar([[metric_namespace]]_block_height{status=\"finalized\",instance=\"[[instance]]\",network=\"[[network]]\"})", - "intervalFactor": 2, - "legendFormat": "[[hostname]]", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Diff -> ( Best Block - Finalized )", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "cacheTimeout": null, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 18, - "y": 0 - }, - "hiddenSeries": false, - "id": 18, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate([[metric_namespace]]_block_height{status=\"finalized\",instance=\"[[instance]]\",network=\"[[network]]\"}[10m])*60", - "intervalFactor": 10, - "legendFormat": "{{instance}} Blocks / minute", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Block rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 0, - "y": 6 - }, - "hiddenSeries": false, - "id": 10, - "interval": "", - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "increase([[metric_namespace]]_block_height{instance=\"[[instance]]\",network=\"[[network]]\",status=~\"finalized|sync_target\"}[1m])", - "intervalFactor": 5, - "legendFormat": "{{status}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Blocks Av per min", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 6, - "y": 6 - }, - "hiddenSeries": false, - "id": 14, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "[[metric_namespace]]_block_height{instance=\"[[instance]]\",network=\"[[network]]\",status=~\"finalized|sync_target\"}", - "legendFormat": "{{instance}} {{status}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Block Finalized", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 12, - "y": 6 - }, - "hiddenSeries": false, - "id": 13, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "[[metric_namespace]]_block_height{status=\"best\",instance=\"[[instance]]\",network=\"[[network]]\"}", - "legendFormat": "{{instance}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Block height", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "Prometheus", - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 18, - "y": 6 - }, - "hiddenSeries": false, - "id": 20, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "data": "", - "expr": "[[metric_namespace]]_ready_transactions_number{instance=\"[[instance]]\",network=\"[[network]]\"}", - "hide": false, - "legendFormat": "{{instance}}", - "refId": "A", - "target": "txcount", - "type": "timeseries" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "TXs Count", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 6, - "y": 12 - }, - "hiddenSeries": false, - "id": 22, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "[[metric_namespace]]_sync_extra_justifications_active{instance=\"[[instance]]\",network=\"[[network]]\"}", - "legendFormat": "{{instance}} active", - "refId": "A" - }, - { - "expr": "[[metric_namespace]]_sync_extra_justifications_failed{instance=\"[[instance]]\",network=\"[[network]]\"}", - "legendFormat": "{{instance}} failed", - "refId": "B" - }, - { - "expr": "[[metric_namespace]]_sync_extra_justifications_importing{instance=\"[[instance]]\",network=\"[[network]]\"}", - "legendFormat": "{{instance}} importing", - "refId": "C" - }, - { - "expr": "[[metric_namespace]]_sync_extra_justifications_pending{instance=\"[[instance]]\",network=\"[[network]]\"}", - "legendFormat": "{{instance}} pending", - "refId": "D" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Sync justifications", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 12, - "y": 12 - }, - "hiddenSeries": false, - "id": 24, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "[[metric_namespace]]_sub_libp2p_connections{instance=\"[[instance]]\",network=\"[[network]]\"}", - "hide": false, - "legendFormat": "{{instance}} connections", - "refId": "A" - }, - { - "expr": "[[metric_namespace]]_sub_libp2p_is_major_syncing{instance=\"[[instance]]\",network=\"[[network]]\"}", - "hide": false, - "legendFormat": "{{instance}} syncing", - "refId": "B" - }, - { - "expr": "[[metric_namespace]]_sub_libp2p_kbuckets_num_nodes{instance=\"[[instance]]\",network=\"[[network]]\"}", - "hide": false, - "legendFormat": "{{instance}} num_nodes", - "refId": "C" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "sub_libp2p", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 18, - "y": 12 - }, - "hiddenSeries": false, - "id": 26, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "[[metric_namespace]]_sub_libp2p_notifications_total{instance=\"[[instance]]\",network=\"[[network]]\",protocol=\"FRNK\",direction=\"in\"}", - "hide": false, - "legendFormat": "{{instance}} FRNK in", - "refId": "A" - }, - { - "expr": "[[metric_namespace]]_sub_libp2p_notifications_total{instance=\"[[instance]]\",network=\"[[network]]\",protocol=\"FRNK\",direction=\"out\"}", - "hide": false, - "legendFormat": "{{instance}} FRNK out", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "libp2p_notifications", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 0, - "y": 18 - }, - "hiddenSeries": false, - "id": 28, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "[[metric_namespace]]_cpu_usage_percentage{instance=\"[[instance]]\",network=\"[[network]]\"}", - "legendFormat": "{{instance}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "CPU usage %", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 6, - "y": 18 - }, - "hiddenSeries": false, - "id": 27, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "[[metric_namespace]]_memory_usage_bytes{instance=\"[[instance]]\",network=\"[[network]]\"}", - "legendFormat": "{{instance}} Mem bytes", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Memory", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 2, - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 12, - "y": 18 - }, - "hiddenSeries": false, - "id": 25, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "[[metric_namespace]]_sub_libp2p_network_per_sec_bytes", - "hide": false, - "legendFormat": "{{instance}}", - "refId": "A" - }, - { - "expr": "[[metric_namespace]]_sub_libp2p_notifications_total", - "hide": true, - "legendFormat": "{{instance}}", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "libp2p_network_per_sec_bytes", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "cacheTimeout": null, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 6, - "x": 18, - "y": 18 - }, - "hiddenSeries": false, - "id": 29, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pluginVersion": "6.5.2", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "[[metric_namespace]]_sub_libp2p_notifications_total{instance=\"[[instance]]\",network=\"[[network]]\",protocol=\"dot1\",direction=\"in\"}", - "hide": false, - "legendFormat": "{{instance}} dot1 in", - "refId": "B" - }, - { - "expr": "[[metric_namespace]]_sub_libp2p_notifications_total{instance=\"[[instance]]\",network=\"[[network]]\",protocol=\"dot2\",direction=\"in\"}", - "hide": false, - "legendFormat": "{{instance}} dot2 in", - "refId": "C" - }, - { - "expr": "[[metric_namespace]]_sub_libp2p_notifications_total{instance=\"[[instance]]\",network=\"[[network]]\",protocol=\"dot2\",direction=\"out\"}", - "hide": false, - "legendFormat": "{{instance}} dot2 out", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "libp2p_notifications", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "5s", - "schemaVersion": 22, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": null, - "current": { - "selected": true, - "text": "substrate", - "value": "substrate" - }, - "hide": 0, - "includeAll": false, - "label": null, - "multi": false, - "name": "metric_namespace", - "options": [ - { - "selected": true, - "text": "substrate", - "value": "substrate" - }, - { - "selected": false, - "text": "polkadot", - "value": "polkadot" - } - ], - "query": "substrate, polkadot", - "skipUrlSync": false, - "type": "custom" - }, - { - "allValue": null, - "current": { - "selected": true, - "text": "dev", - "value": "dev" - }, - "datasource": "Prometheus", - "definition": "label_values(network)", - "hide": 0, - "includeAll": false, - "index": -1, - "label": null, - "multi": false, - "name": "network", - "options": [], - "query": "label_values(network)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": { - "selected": false, - "text": "validator-a:9615", - "value": "validator-a:9615" - }, - "datasource": "Prometheus", - "definition": "label_values(instance)", - "hide": 0, - "includeAll": false, - "index": -1, - "label": null, - "multi": false, - "name": "instance", - "options": [], - "query": "label_values(instance)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, - "timezone": "", - "title": "Substrate Dashboard", - "uid": "ColmenaLabs", - "variables": { - "list": [] - }, - "version": 2 -} diff --git a/.maintain/monitoring/grafana-dashboards/substrate-networking.json b/.maintain/monitoring/grafana-dashboards/substrate-networking.json index c6e734dd5b..4fa00e3b97 100644 --- a/.maintain/monitoring/grafana-dashboards/substrate-networking.json +++ b/.maintain/monitoring/grafana-dashboards/substrate-networking.json @@ -74,7 +74,7 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "iteration": 1610462565248, + "iteration": 1613393276921, "links": [], "panels": [ { @@ -963,7 +963,8 @@ "steppedLine": false, "targets": [ { - "expr": "irate(${metric_namespace}_sub_libp2p_requests_out_started_total{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])", + "expr": "irate(${metric_namespace}_sub_libp2p_requests_out_success_total_sum{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m]) + on(instance) sum(irate(${metric_namespace}_sub_libp2p_requests_out_failure_total{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (instance)", + "hide": false, "interval": "", "legendFormat": "{{instance}}", "refId": "A" @@ -989,6 +990,7 @@ }, "yaxes": [ { + "$$hashKey": "object:209", "format": "reqps", "label": null, "logBase": 1, @@ -997,6 +999,7 @@ "show": true }, { + "$$hashKey": "object:210", "format": "short", "label": null, "logBase": 1, @@ -1032,7 +1035,7 @@ "y": 51 }, "hiddenSeries": false, - "id": 151, + "id": 448, "legend": { "avg": false, "current": false, @@ -1060,9 +1063,11 @@ "steppedLine": false, "targets": [ { - "expr": "irate(${metric_namespace}_sub_libp2p_requests_in_success_total_count{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])", + "expr": "sum(irate(${metric_namespace}_sub_libp2p_requests_out_failure_total{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[$__rate_interval])) by (instance, reason)", + "hide": false, "interval": "", - "legendFormat": "{{instance}}", + "intervalFactor": 1, + "legendFormat": "{{reason}}", "refId": "A" } ], @@ -1070,7 +1075,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Requests served per second", + "title": "Outbound requests failures", "tooltip": { "shared": true, "sort": 2, @@ -1086,6 +1091,7 @@ }, "yaxes": [ { + "$$hashKey": "object:209", "format": "reqps", "label": null, "logBase": 1, @@ -1094,6 +1100,7 @@ "show": true }, { + "$$hashKey": "object:210", "format": "short", "label": null, "logBase": 1, @@ -1227,7 +1234,7 @@ "y": 59 }, "hiddenSeries": false, - "id": 258, + "id": 257, "legend": { "avg": false, "current": false, @@ -1239,7 +1246,7 @@ }, "lines": true, "linewidth": 1, - "nullPointMode": "null", + "nullPointMode": "null as zero", "options": { "alertThreshold": true }, @@ -1255,7 +1262,8 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(0.5, sum(rate(${metric_namespace}_sub_libp2p_requests_in_success_total_bucket{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (instance, le))", + "expr": "histogram_quantile(0.99, sum(rate(${metric_namespace}_sub_libp2p_requests_out_success_total_bucket{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (instance, le)) > 0", + "instant": false, "interval": "", "legendFormat": "{{instance}}", "refId": "A" @@ -1265,7 +1273,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Median request serving time", + "title": "99th percentile request answer time", "tooltip": { "shared": true, "sort": 2, @@ -1324,7 +1332,7 @@ "y": 63 }, "hiddenSeries": false, - "id": 257, + "id": 151, "legend": { "avg": false, "current": false, @@ -1336,7 +1344,7 @@ }, "lines": true, "linewidth": 1, - "nullPointMode": "null as zero", + "nullPointMode": "null", "options": { "alertThreshold": true }, @@ -1352,8 +1360,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(0.99, sum(rate(${metric_namespace}_sub_libp2p_requests_out_success_total_bucket{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (instance, le)) > 0", - "instant": false, + "expr": "irate(${metric_namespace}_sub_libp2p_requests_in_success_total_count{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])", "interval": "", "legendFormat": "{{instance}}", "refId": "A" @@ -1363,7 +1370,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "99th percentile request answer time", + "title": "Requests served per second", "tooltip": { "shared": true, "sort": 2, @@ -1379,7 +1386,7 @@ }, "yaxes": [ { - "format": "s", + "format": "reqps", "label": null, "logBase": 1, "max": null, @@ -1422,7 +1429,7 @@ "y": 67 }, "hiddenSeries": false, - "id": 259, + "id": 449, "legend": { "avg": false, "current": false, @@ -1434,7 +1441,7 @@ }, "lines": true, "linewidth": 1, - "nullPointMode": "null as zero", + "nullPointMode": "null", "options": { "alertThreshold": true }, @@ -1450,9 +1457,11 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(0.99, sum(rate(${metric_namespace}_sub_libp2p_requests_in_success_total_bucket{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (instance, le))", + "expr": "sum(irate(${metric_namespace}_sub_libp2p_requests_in_failure_total{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[$__rate_interval])) by (instance, reason)", + "hide": false, "interval": "", - "legendFormat": "{{instance}}", + "intervalFactor": 1, + "legendFormat": "{{reason}}", "refId": "A" } ], @@ -1460,9 +1469,9 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "99th percentile request serving time", + "title": "Inbound requests failures", "tooltip": { - "shared": false, + "shared": true, "sort": 2, "value_type": "individual" }, @@ -1476,7 +1485,8 @@ }, "yaxes": [ { - "format": "s", + "$$hashKey": "object:209", + "format": "reqps", "label": null, "logBase": 1, "max": null, @@ -1484,6 +1494,7 @@ "show": true }, { + "$$hashKey": "object:210", "format": "short", "label": null, "logBase": 1, @@ -1519,7 +1530,7 @@ "y": 71 }, "hiddenSeries": false, - "id": 287, + "id": 258, "legend": { "avg": false, "current": false, @@ -1531,7 +1542,7 @@ }, "lines": true, "linewidth": 1, - "nullPointMode": "null as zero", + "nullPointMode": "null", "options": { "alertThreshold": true }, @@ -1547,10 +1558,9 @@ "steppedLine": false, "targets": [ { - "expr": "avg(irate(${metric_namespace}_sub_libp2p_requests_out_failure_total{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (reason)", - "instant": false, + "expr": "histogram_quantile(0.5, sum(rate(${metric_namespace}_sub_libp2p_requests_in_success_total_bucket{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (instance, le))", "interval": "", - "legendFormat": "{{reason}}", + "legendFormat": "{{instance}}", "refId": "A" } ], @@ -1558,7 +1568,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Outgoing request failures per second", + "title": "Median request serving time", "tooltip": { "shared": true, "sort": 2, @@ -1574,7 +1584,7 @@ }, "yaxes": [ { - "format": "short", + "format": "s", "label": null, "logBase": 1, "max": null, @@ -1617,7 +1627,7 @@ "y": 75 }, "hiddenSeries": false, - "id": 286, + "id": 259, "legend": { "avg": false, "current": false, @@ -1645,10 +1655,9 @@ "steppedLine": false, "targets": [ { - "expr": "avg(irate(${metric_namespace}_sub_libp2p_requests_in_failure_total{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (reason)", - "instant": false, + "expr": "histogram_quantile(0.99, sum(rate(${metric_namespace}_sub_libp2p_requests_in_success_total_bucket{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (instance, le))", "interval": "", - "legendFormat": "{{reason}}", + "legendFormat": "{{instance}}", "refId": "A" } ], @@ -1656,9 +1665,9 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Ingoing request failures per second", + "title": "99th percentile request serving time", "tooltip": { - "shared": true, + "shared": false, "sort": 2, "value_type": "individual" }, @@ -1672,7 +1681,7 @@ }, "yaxes": [ { - "format": "short", + "format": "s", "label": null, "logBase": 1, "max": null, @@ -1845,7 +1854,7 @@ "lines": true, "linewidth": 1, "maxPerRow": 12, - "nullPointMode": "null as zero", + "nullPointMode": "connected", "options": { "alertThreshold": true }, @@ -1871,7 +1880,7 @@ "steppedLine": false, "targets": [ { - "expr": "avg by (direction) (irate(${metric_namespace}_sub_libp2p_notifications_sizes_count{instance=~\"${nodename}\", protocol=\"${notif_protocol}\"}[$__interval]))", + "expr": "avg by (direction) (irate(${metric_namespace}_sub_libp2p_notifications_sizes_count{instance=~\"${nodename}\", protocol=\"${notif_protocol}\"}[$__rate_interval]))", "interval": "", "legendFormat": "{{direction}}", "refId": "A" @@ -1958,7 +1967,7 @@ "lines": true, "linewidth": 1, "maxPerRow": 12, - "nullPointMode": "null as zero", + "nullPointMode": "connected", "options": { "alertThreshold": true }, @@ -1984,7 +1993,7 @@ "steppedLine": false, "targets": [ { - "expr": "avg(irate(${metric_namespace}_sub_libp2p_notifications_sizes_sum{instance=~\"${nodename}\", protocol=\"${notif_protocol}\"}[$__interval])) by (direction)", + "expr": "avg(irate(${metric_namespace}_sub_libp2p_notifications_sizes_sum{instance=~\"${nodename}\", protocol=\"${notif_protocol}\"}[$__rate_interval])) by (direction)", "instant": false, "interval": "", "legendFormat": "{{direction}}", @@ -2674,7 +2683,7 @@ "allValue": null, "current": {}, "datasource": "$data_source", - "definition": "${metric_namespace}_sub_libp2p_requests_out_started_total{instance=~\"${nodename}\"}", + "definition": "${metric_namespace}_sub_libp2p_requests_in_success_total_count{instance=~\"${nodename}\"}", "error": null, "hide": 2, "includeAll": true, @@ -2682,7 +2691,7 @@ "multi": false, "name": "request_protocol", "options": [], - "query": "${metric_namespace}_sub_libp2p_requests_out_started_total{instance=~\"${nodename}\"}", + "query": "${metric_namespace}_sub_libp2p_requests_in_success_total_count{instance=~\"${nodename}\"}", "refresh": 1, "regex": "/protocol=\"(.*?)\"/", "skipUrlSync": false, @@ -2707,6 +2716,7 @@ "name": "data_source", "options": [], "query": "prometheus", + "queryValue": "", "refresh": 1, "regex": "", "skipUrlSync": false, @@ -2756,5 +2766,5 @@ "timezone": "utc", "title": "Substrate Networking", "uid": "vKVuiD9Zk", - "version": 147 + "version": 154 } diff --git a/.maintain/monitoring/grafana-dashboards/substrate-service-tasks.json b/.maintain/monitoring/grafana-dashboards/substrate-service-tasks.json index 761623daaa..30509cbbce 100644 --- a/.maintain/monitoring/grafana-dashboards/substrate-service-tasks.json +++ b/.maintain/monitoring/grafana-dashboards/substrate-service-tasks.json @@ -37,6 +37,7 @@ "annotations": { "list": [ { + "$$hashKey": "object:326", "builtIn": 1, "datasource": "-- Grafana --", "enable": true, @@ -48,6 +49,7 @@ "type": "dashboard" }, { + "$$hashKey": "object:327", "datasource": "$data_source", "enable": true, "expr": "increase(${metric_namespace}_tasks_ended_total{reason=\"panic\", instance=~\"${nodename}\"}[10m])", @@ -64,6 +66,7 @@ "type": "tags" }, { + "$$hashKey": "object:621", "datasource": "$data_source", "enable": true, "expr": "changes(${metric_namespace}_process_start_time_seconds{instance=~\"${nodename}\"}[10m])", @@ -81,7 +84,7 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "iteration": 1610462629581, + "iteration": 1613393319015, "links": [], "panels": [ { @@ -164,7 +167,7 @@ }, "lines": false, "linewidth": 1, - "nullPointMode": "null as zero", + "nullPointMode": "null", "options": { "alertThreshold": true }, @@ -180,7 +183,7 @@ "steppedLine": false, "targets": [ { - "expr": "irate(${metric_namespace}_tasks_polling_duration_sum{instance=~\"${nodename}\"}[10m])", + "expr": "irate(${metric_namespace}_tasks_polling_duration_sum{instance=~\"${nodename}\"}[$__rate_interval])", "interval": "", "legendFormat": "{{task_name}}", "refId": "A" @@ -206,6 +209,7 @@ }, "yaxes": [ { + "$$hashKey": "object:2721", "format": "percentunit", "label": null, "logBase": 1, @@ -214,6 +218,7 @@ "show": true }, { + "$$hashKey": "object:2722", "format": "short", "label": null, "logBase": 1, @@ -266,7 +271,7 @@ }, "lines": true, "linewidth": 2, - "nullPointMode": "null", + "nullPointMode": "connected", "options": { "alertThreshold": true }, @@ -282,7 +287,7 @@ "steppedLine": true, "targets": [ { - "expr": "irate(${metric_namespace}_tasks_polling_duration_count{instance=~\"${nodename}\"}[10m])", + "expr": "irate(${metric_namespace}_tasks_polling_duration_count{instance=~\"${nodename}\"}[$__rate_interval])", "interval": "", "legendFormat": "{{task_name}}", "refId": "A" @@ -308,6 +313,7 @@ }, "yaxes": [ { + "$$hashKey": "object:2571", "format": "cps", "label": null, "logBase": 1, @@ -316,6 +322,7 @@ "show": true }, { + "$$hashKey": "object:2572", "format": "short", "label": null, "logBase": 1, @@ -382,7 +389,7 @@ "steppedLine": true, "targets": [ { - "expr": "irate(${metric_namespace}_tasks_spawned_total{instance=~\"${nodename}\"}[10m])", + "expr": "irate(${metric_namespace}_tasks_spawned_total{instance=~\"${nodename}\"}[$__rate_interval])", "interval": "", "legendFormat": "{{task_name}}", "refId": "A" @@ -408,6 +415,7 @@ }, "yaxes": [ { + "$$hashKey": "object:771", "format": "short", "label": null, "logBase": 10, @@ -416,6 +424,7 @@ "show": true }, { + "$$hashKey": "object:772", "format": "short", "label": null, "logBase": 1, @@ -466,7 +475,7 @@ }, "lines": true, "linewidth": 1, - "nullPointMode": "null as zero", + "nullPointMode": "connected", "options": { "alertThreshold": true }, @@ -508,6 +517,7 @@ }, "yaxes": [ { + "$$hashKey": "object:919", "format": "short", "label": null, "logBase": 10, @@ -516,6 +526,7 @@ "show": true }, { + "$$hashKey": "object:920", "format": "short", "label": null, "logBase": 1, @@ -585,7 +596,7 @@ "steppedLine": true, "targets": [ { - "expr": "irate(${metric_namespace}_tasks_polling_duration_bucket{instance=~\"${nodename}\", le=\"+Inf\"}[10m])\n - ignoring(le)\n irate(${metric_namespace}_tasks_polling_duration_bucket{instance=~\"${nodename}\", le=\"1.024\"}[10m]) > 0", + "expr": "irate(${metric_namespace}_tasks_polling_duration_bucket{instance=~\"${nodename}\", le=\"+Inf\"}[$__rate_interval])\n - ignoring(le)\n irate(${metric_namespace}_tasks_polling_duration_bucket{instance=~\"${nodename}\", le=\"1.024\"}[$__rate_interval]) > 0", "interval": "", "legendFormat": "{{task_name}}", "refId": "A" @@ -611,6 +622,7 @@ }, "yaxes": [ { + "$$hashKey": "object:3040", "decimals": null, "format": "cps", "label": "Calls to `Future::poll`/second", @@ -620,6 +632,7 @@ "show": true }, { + "$$hashKey": "object:3041", "format": "short", "label": null, "logBase": 1, @@ -683,7 +696,7 @@ }, "lines": true, "linewidth": 1, - "nullPointMode": "null", + "nullPointMode": "connected", "options": { "alertThreshold": true }, @@ -725,6 +738,7 @@ }, "yaxes": [ { + "$$hashKey": "object:626", "format": "short", "label": null, "logBase": 1, @@ -733,6 +747,7 @@ "show": true }, { + "$$hashKey": "object:627", "format": "short", "label": null, "logBase": 1, @@ -782,7 +797,7 @@ }, "lines": true, "linewidth": 1, - "nullPointMode": "null", + "nullPointMode": "connected", "options": { "alertThreshold": true }, @@ -798,7 +813,7 @@ "steppedLine": false, "targets": [ { - "expr": "irate(${metric_namespace}_unbounded_channel_len{instance=~\"${nodename}\", action = \"send\"}[10m])", + "expr": "irate(${metric_namespace}_unbounded_channel_len{instance=~\"${nodename}\", action = \"send\"}[$__rate_interval])", "interval": "", "legendFormat": "{{entity}}", "refId": "B" @@ -824,6 +839,7 @@ }, "yaxes": [ { + "$$hashKey": "object:626", "format": "cps", "label": null, "logBase": 1, @@ -832,6 +848,7 @@ "show": true }, { + "$$hashKey": "object:627", "format": "short", "label": null, "logBase": 1, @@ -938,5 +955,5 @@ "timezone": "utc", "title": "Substrate Service Tasks", "uid": "3LA6XNqZz", - "version": 59 + "version": 60 } diff --git a/Cargo.lock b/Cargo.lock index 6f7c92afc5..f9a1245dfe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,7 +18,7 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" dependencies = [ - "gimli 0.23.0", + "gimli", ] [[package]] @@ -387,6 +387,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base-x" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" + [[package]] name = "base58" version = "0.1.0" @@ -447,12 +453,14 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bitvec" -version = "0.17.4" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" +checksum = "1f682656975d3a682daff957be4ddeb65d6ad656737cd821f2d00685ae466af1" dependencies = [ - "either", + "funty", "radium", + "tap", + "wyz", ] [[package]] @@ -487,6 +495,32 @@ dependencies = [ "constant_time_eq", ] +[[package]] +name = "blake2s_simd" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq", +] + +[[package]] +name = "blake3" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9ff35b701f3914bdb8fad3368d822c766ef2858b2583198e41639b936f09d3f" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "cc", + "cfg-if 0.1.10", + "constant_time_eq", + "crypto-mac 0.8.0", + "digest 0.9.0", +] + [[package]] name = "block-buffer" version = "0.7.3" @@ -580,12 +614,6 @@ version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" -[[package]] -name = "byte-slice-cast" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0a5e3906bcbf133e33c1d4d95afc664ad37fbdb9f6568d8043e7ea8c27d93d3" - [[package]] name = "byte-slice-cast" version = "1.0.0" @@ -730,6 +758,17 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "cid" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff0e3bc0b6446b3f9663c1a6aba6ef06c5aeaa1bc92bd18077be337198ab9768" +dependencies = [ + "multibase", + "multihash", + "unsigned-varint 0.5.1", +] + [[package]] name = "cipher" version = "0.2.5" @@ -813,6 +852,16 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +[[package]] +name = "cpp_demangle" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44919ecaf6f99e8e737bc239408931c9a01e9a6c74814fee8242dd2506b65390" +dependencies = [ + "cfg-if 1.0.0", + "glob", +] + [[package]] name = "cpuid-bool" version = "0.1.2" @@ -827,25 +876,25 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "cranelift-bforest" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dcc286b052ee24a1e5a222e7c1125e6010ad35b0f248709b9b3737a8fedcfdf" +checksum = "4066fd63b502d73eb8c5fa6bcab9c7962b05cd580f6b149ee83a8e730d8ce7fb" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9badfe36176cb653506091693bc2bb1970c9bddfcd6ec7fac404f7eaec6f38" +checksum = "1a54e4beb833a3c873a18a8fe735d73d732044004c7539a072c8faa35ccb0c60" dependencies = [ "byteorder", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli 0.21.0", + "gimli", "log", "regalloc", "serde", @@ -856,9 +905,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3f460031861e4f4ad510be62b2ae50bba6cc886b598a36f9c0a970feab9598" +checksum = "c54cac7cacb443658d8f0ff36a3545822613fa202c946c0891897843bc933810" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -866,24 +915,24 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ad12409e922e7697cd0bdc7dc26992f64a77c31880dfe5e3c7722f4710206d" +checksum = "a109760aff76788b2cdaeefad6875a73c2b450be13906524f6c2a81e05b8d83c" [[package]] name = "cranelift-entity" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97cdc58972ea065d107872cfb9079f4c92ade78a8af85aaff519a65b5d13f71" +checksum = "3b044234aa32531f89a08b487630ddc6744696ec04c8123a1ad388de837f5de3" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef419efb4f94ecc02e5d9fbcc910d2bb7f0040e2de570e63a454f883bc891d6" +checksum = "5452b3e4e97538ee5ef2cc071301c69a86c7adf2770916b9d04e9727096abd93" dependencies = [ "cranelift-codegen", "log", @@ -893,9 +942,9 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e69d44d59826eef6794066ac2c0f4ad3975f02d97030c60dbc04e3886adf36e" +checksum = "f68035c10b2e80f26cc29c32fa824380877f38483504c2a47b54e7da311caaf3" dependencies = [ "cranelift-codegen", "raw-cpuid", @@ -904,17 +953,19 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "979df666b1304624abe99738e9e0e7c7479ee5523ba4b8b237df9ff49996acbb" +checksum = "a530eb9d1c95b3309deb24c3d179d8b0ba5837ed98914a429787c395f614949d" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", + "itertools 0.9.0", "log", "serde", + "smallvec 1.6.1", "thiserror", - "wasmparser 0.59.0", + "wasmparser", ] [[package]] @@ -1167,13 +1218,14 @@ dependencies = [ "darwinia-support", "frame-support", "frame-system", + "log", "pallet-transaction-payment", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1184,7 +1236,7 @@ dependencies = [ "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-api", "sp-blockchain", "sp-runtime", @@ -1195,7 +1247,7 @@ name = "darwinia-balances-rpc-runtime-api" version = "2.0.0" dependencies = [ "darwinia-support", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-api", "sp-runtime", @@ -1211,13 +1263,14 @@ dependencies = [ "frame-support", "frame-system", "libsecp256k1", - "parity-scale-codec 1.3.7", + "log", + "parity-scale-codec", "serde", "serde_json", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1238,7 +1291,7 @@ version = "2.0.0" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-runtime", ] @@ -1251,7 +1304,7 @@ dependencies = [ "darwinia-support", "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "serde_json", "sp-io", @@ -1268,12 +1321,12 @@ dependencies = [ "frame-system", "hex-literal", "pallet-scheduler", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", "sp-storage", "substrate-test-utils", ] @@ -1287,13 +1340,14 @@ dependencies = [ "frame-support", "frame-system", "hex-literal", - "parity-scale-codec 1.3.7", + "log", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-npos-elections", "sp-runtime", - "sp-std 2.0.1", + "sp-std", "substrate-test-utils", ] @@ -1313,17 +1367,19 @@ dependencies = [ "ethereum-primitives", "frame-support", "frame-system", + "log", "pallet-session", "pallet-timestamp", - "parity-scale-codec 1.3.7", - "rlp 0.4.4", + "parity-scale-codec", + "rlp", "serde", "serde_json", "sp-core", + "sp-election-providers", "sp-io", "sp-runtime", "sp-staking", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1334,17 +1390,18 @@ dependencies = [ "darwinia-balances", "darwinia-support", "ethereum-primitives", - "ethereum-types 0.8.0", + "ethereum-types", "frame-support", "frame-system", - "parity-scale-codec 1.3.7", - "rlp 0.4.4", + "log", + "parity-scale-codec", + "rlp", "serde", "serde_json", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1359,17 +1416,17 @@ dependencies = [ "darwinia-relayer-game", "darwinia-support", "ethereum-primitives", - "ethereum-types 0.8.0", + "ethereum-types", "frame-support", "frame-system", - "parity-scale-codec 1.3.7", - "rlp 0.4.4", + "parity-scale-codec", + "rlp", "serde", "serde_json", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1384,16 +1441,17 @@ dependencies = [ "evm-runtime", "frame-support", "frame-system", + "log", "pallet-timestamp", - "parity-scale-codec 1.3.7", - "primitive-types 0.8.0", - "rlp 0.5.0", + "parity-scale-codec", + "primitive-types", + "rlp", "serde", "sha3 0.8.2", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1435,7 +1493,7 @@ dependencies = [ "dp-evm", "evm", "frame-support", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-core", "sp-io", ] @@ -1467,19 +1525,19 @@ dependencies = [ "darwinia-evm", "dp-evm", "ethabi", - "ethereum-types 0.8.0", + "ethereum-types", "evm", "frame-support", "frame-system", "hex", "pallet-timestamp", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "ripemd160", - "sha3 0.8.2", + "sha3 0.9.1", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1515,12 +1573,12 @@ dependencies = [ "frame-support", "frame-system", "pallet-timestamp", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "ripemd160", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1534,13 +1592,14 @@ dependencies = [ "darwinia-support", "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "log", + "parity-scale-codec", "serde", "serde_json", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1551,7 +1610,7 @@ dependencies = [ "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-api", "sp-blockchain", "sp-runtime", @@ -1562,11 +1621,11 @@ name = "darwinia-header-mmr-rpc-runtime-api" version = "2.0.0" dependencies = [ "darwinia-support", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-api", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1579,12 +1638,12 @@ dependencies = [ "darwinia-support", "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1592,9 +1651,9 @@ name = "darwinia-relay-primitives" version = "2.0.0" dependencies = [ "frame-support", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1607,12 +1666,13 @@ dependencies = [ "env_logger 0.8.3", "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "log", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1624,22 +1684,24 @@ dependencies = [ "darwinia-support", "frame-support", "frame-system", + "log", "pallet-authorship", "pallet-session", "pallet-timestamp", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "rand_chacha 0.2.2", "serde", "sp-arithmetic", "sp-core", + "sp-election-providers", "sp-io", "sp-npos-elections", "sp-runtime", "sp-staking", - "sp-std 2.0.1", + "sp-std", "sp-storage", "sp-tracing", - "static_assertions 1.1.0", + "static_assertions", "substrate-fixed", "substrate-test-utils", ] @@ -1652,7 +1714,7 @@ dependencies = [ "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-api", "sp-blockchain", "sp-runtime", @@ -1663,7 +1725,7 @@ name = "darwinia-staking-rpc-runtime-api" version = "2.0.0" dependencies = [ "darwinia-support", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-api", "sp-runtime", @@ -1675,11 +1737,11 @@ version = "2.0.0" dependencies = [ "ethereum-primitives", "frame-support", - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "num-traits", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1690,12 +1752,12 @@ dependencies = [ "darwinia-support", "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", "sp-storage", ] @@ -1705,7 +1767,7 @@ version = "2.0.0" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-runtime", ] @@ -1720,12 +1782,12 @@ dependencies = [ "frame-support", "frame-system", "hex-literal", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", "sp-storage", ] @@ -1735,6 +1797,26 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" +[[package]] +name = "data-encoding-macro" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a94feec3d2ba66c0b6621bca8bc6f68415b1e5c69af3586fdd0af9fd9f29b17" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f83e699727abca3c56e187945f303389590305ab2f0185ea445aa66e8d5f2a" +dependencies = [ + "data-encoding", + "syn", +] + [[package]] name = "dc-consensus" version = "2.0.0" @@ -1745,7 +1827,7 @@ dependencies = [ "dvm-rpc-runtime-api", "futures 0.3.13", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sc-client-api", "sp-api", "sp-block-builder", @@ -1764,7 +1846,7 @@ version = "2.0.0" dependencies = [ "kvdb", "kvdb-rocksdb", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "sp-core", "sp-database", @@ -1803,7 +1885,7 @@ dependencies = [ "dvm-rpc-core", "dvm-rpc-runtime-api", "ethereum", - "ethereum-types 0.10.0", + "ethereum-types", "futures 0.3.13", "jsonrpc-core", "jsonrpc-core-client", @@ -1811,9 +1893,9 @@ dependencies = [ "jsonrpc-pubsub", "libsecp256k1", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "rand 0.7.3", - "rlp 0.5.0", + "rlp", "sc-client-api", "sc-network", "sc-rpc", @@ -1858,21 +1940,21 @@ dependencies = [ [[package]] name = "directories" -version = "2.0.2" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" +checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f" dependencies = [ - "cfg-if 0.1.10", "dirs-sys", ] [[package]] -name = "directories" -version = "3.0.1" +name = "directories-next" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" dependencies = [ - "dirs-sys", + "cfg-if 1.0.0", + "dirs-sys-next", ] [[package]] @@ -1882,7 +1964,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" dependencies = [ "libc", - "redox_users", + "redox_users 0.3.5", + "winapi 0.3.9", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users 0.4.0", "winapi 0.3.9", ] @@ -1901,18 +1994,18 @@ name = "dp-evm" version = "2.0.0" dependencies = [ "evm", - "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 1.3.7", + "impl-trait-for-tuples", + "parity-scale-codec", "serde", "sp-core", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "dp-rpc" version = "2.0.0" dependencies = [ - "ethereum-types 0.10.0", + "ethereum-types", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -1931,12 +2024,12 @@ name = "dp_consensus" version = "2.0.0" dependencies = [ "ethereum", - "parity-scale-codec 1.3.7", - "rlp 0.5.0", + "parity-scale-codec", + "rlp", "sha3 0.8.2", "sp-core", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -1973,7 +2066,7 @@ dependencies = [ "pallet-transaction-payment-rpc", "pallet-transaction-payment-rpc-runtime-api", "pangolin-runtime", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sc-authority-discovery", "sc-basic-authorship", "sc-chain-spec", @@ -2015,6 +2108,7 @@ dependencies = [ "substrate-frame-rpc-system", "substrate-prometheus-endpoint", "tokio 0.3.7", + "try-runtime-cli", ] [[package]] @@ -2031,12 +2125,12 @@ version = "2.0.0" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", "sp-inherents", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -2053,20 +2147,20 @@ dependencies = [ "dp_consensus", "dvm-rpc-runtime-api", "ethereum", - "ethereum-types 0.10.0", + "ethereum-types", "evm", "frame-support", "frame-system", "libsecp256k1", "pallet-timestamp", - "parity-scale-codec 1.3.7", - "rlp 0.5.0", + "parity-scale-codec", + "rlp", "serde", - "sha3 0.8.2", + "sha3 0.9.1", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -2077,15 +2171,15 @@ dependencies = [ "dp-evm", "dp-rpc", "ethereum", - "ethereum-types 0.10.0", + "ethereum-types", "jsonrpc-core", "jsonrpc-derive", "jsonrpc-pubsub", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-api", "sp-core", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -2095,13 +2189,13 @@ dependencies = [ "darwinia-evm", "dp-evm", "ethereum", - "ethereum-types 0.10.0", - "parity-scale-codec 1.3.7", + "ethereum-types", + "parity-scale-codec", "sp-api", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -2244,85 +2338,61 @@ dependencies = [ [[package]] name = "ethabi" -version = "9.0.1" -source = "git+https://github.com/darwinia-network/ethabi.git?branch=with_no_std#a37eab192664dbf2dbdc8d7fd4141142e9a9eeec" +version = "13.0.0" +source = "git+https://github.com/darwinia-network/ethabi.git?branch=xavier-no-std#baacf174d5c2f12122c4ee3fe31506fb52069983" dependencies = [ - "ethereum-types 0.8.0", - "rustc-hex", + "anyhow", + "ethereum-types", + "hex", "serde", - "serde_derive", "serde_json", - "sp-std 2.0.0-rc2", - "tiny-keccak 1.5.0", + "sha3 0.9.1", + "thiserror", + "uint", ] [[package]] name = "ethash" version = "0.4.0" -source = "git+https://github.com/darwinia-network/ethash?tag=v1.0.0#cd3918410be0484e436cab68ba803fe95fc905b5" +source = "git+https://github.com/darwinia-network/rust-ethash#9014d7649c19800f3b37944a23dd499d207cf881" dependencies = [ "byteorder", - "ethereum-types 0.8.0", - "primitive-types 0.6.2", - "rlp 0.4.4", + "ethereum-types", + "primitive-types", + "rlp", "sha3 0.9.1", ] [[package]] name = "ethbloom" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3932e82d64d347a045208924002930dc105a138995ccdc1479d0f05f0359f17c" -dependencies = [ - "crunchy", - "fixed-hash 0.3.2", - "impl-rlp 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "impl-serde 0.2.3", - "tiny-keccak 1.5.0", -] - -[[package]] -name = "ethbloom" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/parity-common.git#12a86aa8af8ff5ccd5c953074aa893c716cf85b5" -dependencies = [ - "crunchy", - "fixed-hash 0.5.2", - "impl-codec 0.4.2 (git+https://github.com/darwinia-network/parity-common.git)", - "impl-rlp 0.2.1 (git+https://github.com/darwinia-network/parity-common.git)", - "impl-serde 0.3.0", - "tiny-keccak 2.0.2", -] - -[[package]] -name = "ethbloom" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a621dcebea74f2a6f2002d0a885c81ccf6cbdf86760183316a7722b5707ca4" +checksum = "779864b9c7f7ead1f092972c3257496c6a84b46dba2ce131dd8a282cb2cc5972" dependencies = [ "crunchy", - "fixed-hash 0.7.0", - "impl-codec 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "impl-rlp 0.3.0", - "impl-serde 0.3.1", - "tiny-keccak 2.0.2", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "tiny-keccak", ] [[package]] name = "ethereum" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8603f637f22e3ab9aff8466b37850cd7ea2ae52034b07e41fdc82f1f68dfa2c" +checksum = "567ce064a8232c16e2b2c2173a936b91fbe35c2f2c5278871f5a1a31688b42e9" dependencies = [ - "ethereum-types 0.10.0", + "ethereum-types", + "funty", "hash-db", "hash256-std-hasher", - "parity-scale-codec 1.3.7", - "rlp 0.5.0", - "rlp-derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec", + "rlp", + "rlp-derive", "serde", "sha3 0.9.1", - "triehash 0.8.4", + "triehash", ] [[package]] @@ -2331,77 +2401,40 @@ version = "2.0.0" dependencies = [ "array-bytes", "ethash", - "ethbloom 0.8.1", - "ethereum-types 0.8.0", - "fixed-hash 0.5.2", + "ethbloom", + "ethereum-types", + "fixed-hash", "frame-support", - "impl-codec 0.4.2 (git+https://github.com/darwinia-network/parity-common.git)", - "impl-rlp 0.2.1 (git+https://github.com/darwinia-network/parity-common.git)", + "impl-codec", + "impl-rlp", "keccak-hash", "keccak-hasher", "merkle-patricia-trie", - "parity-scale-codec 1.3.7", - "primitive-types 0.6.2", - "rlp 0.4.4", - "rlp-derive 0.1.0 (git+https://github.com/darwinia-network/parity-common.git)", + "parity-scale-codec", + "primitive-types", + "rlp", + "rlp-derive", "serde", "serde_json", "sp-io", "sp-runtime", - "sp-std 2.0.1", - "triehash 0.8.2", -] - -[[package]] -name = "ethereum-types" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b054df51e53f253837ea422681215b42823c02824bde982699d0dceecf6165a1" -dependencies = [ - "crunchy", - "ethbloom 0.6.4", - "ethereum-types-serialize", - "fixed-hash 0.3.2", - "serde", - "uint 0.5.0", -] - -[[package]] -name = "ethereum-types" -version = "0.8.0" -source = "git+https://github.com/darwinia-network/parity-common.git#12a86aa8af8ff5ccd5c953074aa893c716cf85b5" -dependencies = [ - "ethbloom 0.8.1", - "fixed-hash 0.5.2", - "impl-codec 0.4.2 (git+https://github.com/darwinia-network/parity-common.git)", - "impl-rlp 0.2.1 (git+https://github.com/darwinia-network/parity-common.git)", - "impl-serde 0.3.0", - "primitive-types 0.6.2", - "uint 0.8.2", + "sp-std", + "triehash", ] [[package]] name = "ethereum-types" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05dc5f0df4915fa6dff7f975a8366ecfaaa8959c74235469495153e7bb1b280e" -dependencies = [ - "ethbloom 0.10.0", - "fixed-hash 0.7.0", - "impl-codec 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "impl-rlp 0.3.0", - "impl-serde 0.3.1", - "primitive-types 0.8.0", - "uint 0.9.0", -] - -[[package]] -name = "ethereum-types-serialize" -version = "0.2.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1873d77b32bc1891a79dad925f2acbc318ee942b38b9110f9dbc5fbeffcea350" +checksum = "f64b5df66a228d85e4b17e5d6c6aa43b0310898ffe8a85988c4c032357aaabfd" dependencies = [ - "serde", + "ethbloom", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "primitive-types", + "uint", ] [[package]] @@ -2412,52 +2445,53 @@ checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" [[package]] name = "evm" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b46f945d7548bea2affc1a48168f6d7e832bae914e0d90627a2ea2a7ba63001" +checksum = "0467250a12bb144ad7b2f41e03e8675e38b971ab73f6d42ede6b78af07657e7b" dependencies = [ "ethereum", "evm-core", "evm-gasometer", "evm-runtime", "log", - "parity-scale-codec 1.3.7", - "primitive-types 0.8.0", - "rlp 0.5.0", + "parity-scale-codec", + "primitive-types", + "rlp", "serde", "sha3 0.8.2", ] [[package]] name = "evm-core" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc372feb219651f8ae872e6ec0f84b346053c058bd0e8408b1f44a2a796bfecd" +checksum = "2f0db0394d7b497bf97be3d9ece9c828f8b7670a065fc9f3106c9598cce6556d" dependencies = [ - "parity-scale-codec 1.3.7", - "primitive-types 0.8.0", + "funty", + "parity-scale-codec", + "primitive-types", "serde", ] [[package]] name = "evm-gasometer" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5737059b7a570b3e28a0126b02e0e36e218cc828b29dddbbae73d0b97fce1e0a" +checksum = "c617616408f87be6826bda72cee7625aa8cbc09b759f05b1dccd329fb61b2077" dependencies = [ "evm-core", "evm-runtime", - "primitive-types 0.8.0", + "primitive-types", ] [[package]] name = "evm-runtime" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95726118dbc5f76ed1ee300e685950e58e52a1c4db454a7635aba636c7002186" +checksum = "8447504daa86bc5a7ae982b9b5c53225aa0ebcfba636b785cf0f53406eaa4d87" dependencies = [ "evm-core", - "primitive-types 0.8.0", + "primitive-types", "sha3 0.8.2", ] @@ -2534,41 +2568,17 @@ dependencies = [ [[package]] name = "finality-grandpa" -version = "0.12.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8feb87a63249689640ac9c011742c33139204e3c134293d3054022276869133b" +checksum = "c6447e2f8178843749e8c8003206def83ec124a7859475395777a28b5338647c" dependencies = [ "either", "futures 0.3.13", - "futures-timer 2.0.2", + "futures-timer 3.0.2", "log", "num-traits", - "parity-scale-codec 1.3.7", - "parking_lot 0.9.0", -] - -[[package]] -name = "fixed-hash" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1a683d1234507e4f3bf2736eeddf0de1dc65996dc0164d57eba0a74bcf29489" -dependencies = [ - "byteorder", - "heapsize", - "rand 0.5.6", - "rustc-hex", - "static_assertions 0.2.5", -] - -[[package]] -name = "fixed-hash" -version = "0.5.2" -source = "git+https://github.com/darwinia-network/parity-common.git#12a86aa8af8ff5ccd5c953074aa893c716cf85b5" -dependencies = [ - "byteorder", - "rand 0.7.3", - "rustc-hex", - "static_assertions 1.1.0", + "parity-scale-codec", + "parking_lot 0.11.1", ] [[package]] @@ -2580,7 +2590,7 @@ dependencies = [ "byteorder", "rand 0.8.3", "rustc-hex", - "static_assertions 1.1.0", + "static_assertions", ] [[package]] @@ -2610,10 +2620,10 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", ] [[package]] @@ -2628,62 +2638,63 @@ dependencies = [ [[package]] name = "frame-benchmarking" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.1.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", "linregress", - "parity-scale-codec 1.3.7", - "paste", + "log", + "parity-scale-codec", + "paste 1.0.5", "sp-api", "sp-io", "sp-runtime", "sp-runtime-interface", - "sp-std 2.0.1", + "sp-std", "sp-storage", ] [[package]] name = "frame-executive" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", "sp-tracing", ] [[package]] name = "frame-metadata" -version = "12.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "13.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "frame-support" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "bitflags", "frame-metadata", "frame-support-procedural", - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "log", "once_cell", - "parity-scale-codec 1.3.7", - "paste", + "parity-scale-codec", + "paste 1.0.5", "serde", "smallvec 1.6.1", "sp-arithmetic", @@ -2691,15 +2702,16 @@ dependencies = [ "sp-inherents", "sp-io", "sp-runtime", + "sp-staking", "sp-state-machine", - "sp-std 2.0.1", + "sp-std", "sp-tracing", ] [[package]] name = "frame-support-procedural" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2710,8 +2722,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2722,8 +2734,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "proc-macro2", "quote", @@ -2732,27 +2744,40 @@ dependencies = [ [[package]] name = "frame-system" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", - "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 1.3.7", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", "sp-version", ] [[package]] name = "frame-system-rpc-runtime-api" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" +dependencies = [ + "parity-scale-codec", + "sp-api", +] + +[[package]] +name = "frame-try-runtime" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "frame-support", + "parity-scale-codec", "sp-api", + "sp-runtime", + "sp-std", ] [[package]] @@ -2767,6 +2792,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -2789,6 +2824,12 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + [[package]] name = "futures" version = "0.1.31" @@ -3021,21 +3062,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" dependencies = [ "fallible-iterator", "indexmap", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" - [[package]] name = "glob" version = "0.3.0" @@ -3136,15 +3171,6 @@ dependencies = [ "ahash", ] -[[package]] -name = "heapsize" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "heck" version = "0.3.2" @@ -3416,36 +3442,11 @@ dependencies = [ [[package]] name = "impl-codec" -version = "0.4.2" -source = "git+https://github.com/darwinia-network/parity-common.git#12a86aa8af8ff5ccd5c953074aa893c716cf85b5" -dependencies = [ - "parity-scale-codec 1.3.7", -] - -[[package]] -name = "impl-codec" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be51a921b067b0eaca2fad532d9400041561aa922221cc65f95a85641c6bf53" -dependencies = [ - "parity-scale-codec 1.3.7", -] - -[[package]] -name = "impl-rlp" -version = "0.2.1" -source = "git+https://github.com/darwinia-network/parity-common.git#12a86aa8af8ff5ccd5c953074aa893c716cf85b5" -dependencies = [ - "rlp 0.4.4", -] - -[[package]] -name = "impl-rlp" -version = "0.2.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5" +checksum = "df170efa359aebdd5cb7fe78edcc67107748e4737bdca8a8fb40d15ea7a877ed" dependencies = [ - "rlp 0.4.6", + "parity-scale-codec", ] [[package]] @@ -3454,46 +3455,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" dependencies = [ - "rlp 0.5.0", + "rlp", ] [[package]] name = "impl-serde" -version = "0.2.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e3cae7e99c7ff5a995da2cf78dd0a5383740eda71d98cf7b1910c301ac69b8" -dependencies = [ - "serde", -] - -[[package]] -name = "impl-serde" -version = "0.3.0" -source = "git+https://github.com/darwinia-network/parity-common.git#12a86aa8af8ff5ccd5c953074aa893c716cf85b5" -dependencies = [ - "serde", -] - -[[package]] -name = "impl-serde" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b47ca4d2b6931707a55fce5cf66aff80e2178c8b63bbb4ecb5695cbc870ddf6f" +checksum = "b47ca4d2b6931707a55fce5cf66aff80e2178c8b63bbb4ecb5695cbc870ddf6f" dependencies = [ "serde", ] -[[package]] -name = "impl-trait-for-tuples" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef5550a42e3740a0e71f909d4c861056a284060af885ae7aa6242820f920d9d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "impl-trait-for-tuples" version = "0.2.1" @@ -3565,15 +3538,6 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" -[[package]] -name = "itertools" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.9.0" @@ -3738,6 +3702,67 @@ dependencies = [ "slab", ] +[[package]] +name = "jsonrpsee-http-client" +version = "0.2.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f1d8440e2617bdebdf45114e90f65aed3f14bf73e23d874dde8e4b764676fe9" +dependencies = [ + "async-trait", + "futures 0.3.13", + "hyper 0.13.10", + "jsonrpsee-types", + "jsonrpsee-utils", + "log", + "serde", + "serde_json", + "thiserror", + "unicase", + "url 2.2.1", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.2.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cb3f732ccbeafd15cefb59c7c7b5ac6c553c2653613b63e5e7feb7f06a219e9" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.2.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a8cd20c190e75dc56f7543b9d5713c3186351b301b5507ea6b85d8c403aac78" +dependencies = [ + "async-trait", + "futures 0.3.13", + "log", + "serde", + "serde_json", + "smallvec 1.6.1", + "thiserror", +] + +[[package]] +name = "jsonrpsee-utils" +version = "0.2.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51670a3b56e5fb0d325920ce317c76184b8afabfd7bc5009831229cfef0732b" +dependencies = [ + "futures 0.3.13", + "globset", + "hyper 0.13.10", + "jsonrpsee-types", + "lazy_static", + "log", + "unicase", +] + [[package]] name = "keccak" version = "0.1.0" @@ -3746,11 +3771,12 @@ checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" [[package]] name = "keccak-hash" -version = "0.4.1" -source = "git+https://github.com/darwinia-network/parity-common.git#12a86aa8af8ff5ccd5c953074aa893c716cf85b5" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae0386ec98c26dd721aaa3412bf3a817156ff3ee7cb6959503f8d1095f4ccc51" dependencies = [ - "primitive-types 0.6.2", - "tiny-keccak 2.0.2", + "primitive-types", + "tiny-keccak", ] [[package]] @@ -3761,7 +3787,7 @@ checksum = "711adba9940a039f4374fc5724c0a5eaca84a2d558cce62256bfe26f0dbef05e" dependencies = [ "hash-db", "hash256-std-hasher", - "tiny-keccak 2.0.2", + "tiny-keccak", ] [[package]] @@ -3785,9 +3811,9 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92312348daade49976a6dc59263ad39ed54f840aacb5664874f7c9aa16e5f848" +checksum = "8891bd853eff90e33024195d79d578dc984c82f9e0715fcd2b525a0c19d52811" dependencies = [ "parity-util-mem", "smallvec 1.6.1", @@ -3795,9 +3821,9 @@ dependencies = [ [[package]] name = "kvdb-memorydb" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "986052a8d16c692eaebe775391f9a3ac26714f3907132658500b601dec94c8c2" +checksum = "30a0da8e08caf08d384a620ec19bb6c9b85c84137248e202617fb91881f25912" dependencies = [ "kvdb", "parity-util-mem", @@ -3806,9 +3832,9 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d92c36be64baba5ea549116ff0d7ffd445456a7be8aaee21ec05882b980cd11" +checksum = "34446c373ccc494c2124439281c198c7636ccdc2752c06722bbffd56d459c1e4" dependencies = [ "fs-swap", "kvdb", @@ -3845,9 +3871,9 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" [[package]] name = "libc" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a" +checksum = "538c092e5586f4cdd7dd8078c4a79220e3e168880218124dcbce860f0ea938c6" [[package]] name = "libloading" @@ -3867,16 +3893,15 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libp2p" -version = "0.34.0" +version = "0.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5133112ce42be9482f6a87be92a605dd6bbc9e93c297aee77d172ff06908f3a" +checksum = "adc225a49973cf9ab10d0cdd6a4b8f0cda299df9b760824bbb623f15f8f0c95a" dependencies = [ "atomic", "bytes 1.0.1", "futures 0.3.13", "lazy_static", "libp2p-core", - "libp2p-core-derive", "libp2p-deflate", "libp2p-dns", "libp2p-floodsub", @@ -3891,6 +3916,7 @@ dependencies = [ "libp2p-pnet", "libp2p-request-response", "libp2p-swarm", + "libp2p-swarm-derive", "libp2p-tcp", "libp2p-uds", "libp2p-wasm-ext", @@ -3924,7 +3950,7 @@ dependencies = [ "parity-multiaddr", "parking_lot 0.11.1", "pin-project 1.0.5", - "prost 0.7.0", + "prost", "prost-build", "rand 0.7.3", "ring", @@ -3937,16 +3963,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-core-derive" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4bc40943156e42138d22ed3c57ff0e1a147237742715937622a99b10fbe0156" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "libp2p-deflate" version = "0.27.1" @@ -3981,7 +3997,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost 0.7.0", + "prost", "prost-build", "rand 0.7.3", "smallvec 1.6.1", @@ -3989,11 +4005,11 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12451ba9493e87c91baf2a6dffce9ddf1fbc807a0861532d7cf477954f8ebbee" +checksum = "502dc5fcbfec4aa1c63ef3f7307ffe20e90c1a1387bf23ed0bec087f2dde58a1" dependencies = [ - "asynchronous-codec 0.5.0", + "asynchronous-codec 0.6.0", "base64 0.13.0", "byteorder", "bytes 1.0.1", @@ -4003,13 +4019,13 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost 0.7.0", + "prost", "prost-build", "rand 0.7.3", "regex", "sha2 0.9.3", "smallvec 1.6.1", - "unsigned-varint 0.6.0", + "unsigned-varint 0.7.0", "wasm-timer", ] @@ -4023,7 +4039,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost 0.7.0", + "prost", "prost-build", "smallvec 1.6.1", "wasm-timer", @@ -4044,12 +4060,12 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost 0.7.0", + "prost", "prost-build", "rand 0.7.3", "sha2 0.9.3", "smallvec 1.6.1", - "uint 0.9.0", + "uint", "unsigned-varint 0.7.0", "void", "wasm-timer", @@ -4106,12 +4122,12 @@ dependencies = [ "lazy_static", "libp2p-core", "log", - "prost 0.7.0", + "prost", "prost-build", "rand 0.7.3", "sha2 0.9.3", "snow", - "static_assertions 1.1.0", + "static_assertions", "x25519-dalek", "zeroize", ] @@ -4142,7 +4158,7 @@ dependencies = [ "futures 0.3.13", "libp2p-core", "log", - "prost 0.7.0", + "prost", "prost-build", "unsigned-varint 0.7.0", "void", @@ -4198,6 +4214,16 @@ dependencies = [ "wasm-timer", ] +[[package]] +name = "libp2p-swarm-derive" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c564ebaa36a64839f51eaddb0243aaaa29ce64affb56129193cc3248b72af273" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "libp2p-tcp" version = "0.27.1" @@ -4419,13 +4445,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] -name = "memmap" -version = "0.7.0" +name = "memmap2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" +checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6" dependencies = [ "libc", - "winapi 0.3.9", ] [[package]] @@ -4448,9 +4473,9 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cbd2a22f201c03cc1706a727842490abfea17b7b53260358239828208daba3c" +checksum = "814bbecfc0451fc314eeea34f05bbcd5b98a7ad7af37faee088b86a1e633f1d4" dependencies = [ "hash-db", "hashbrown", @@ -4469,13 +4494,13 @@ version = "2.0.0" dependencies = [ "array-bytes", "criterion", - "ethereum-types 0.5.2", + "ethereum-types", "hashbrown", "hex", "keccak-hash", - "rand 0.7.3", - "rlp 0.4.4", - "sp-std 2.0.1", + "rand 0.8.3", + "rlp", + "sp-std", "uuid", ] @@ -4603,16 +4628,31 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +[[package]] +name = "multibase" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b78c60039650ff12e140ae867ef5299a58e19dded4d334c849dc7177083667e2" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + [[package]] name = "multihash" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dac63698b887d2d929306ea48b63760431ff8a24fac40ddb22f9c7f49fb7cab" dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", "digest 0.9.0", "generic-array 0.14.4", "multihash-derive", "sha2 0.9.3", + "sha3 0.9.1", "unsigned-varint 0.5.1", ] @@ -4632,9 +4672,9 @@ dependencies = [ [[package]] name = "multimap" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "multistream-select" @@ -4842,19 +4882,12 @@ dependencies = [ [[package]] name = "object" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cbca9424c482ee628fa549d9c812e2cd22f1180b9222c9200fdfa6eb31aecb2" - -[[package]] -name = "object" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" +checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" dependencies = [ "crc32fast", "indexmap", - "wasmparser 0.57.0", ] [[package]] @@ -4907,100 +4940,122 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", "pallet-session", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-application-crypto", "sp-authority-discovery", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-authorship" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", - "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 1.3.7", + "impl-trait-for-tuples", + "parity-scale-codec", "sp-authorship", "sp-inherents", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-babe" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "pallet-authorship", "pallet-session", "pallet-timestamp", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-application-crypto", "sp-consensus-babe", "sp-consensus-vrf", - "sp-inherents", "sp-io", "sp-runtime", "sp-session", "sp-staking", - "sp-std 2.0.1", + "sp-std", "sp-timestamp", ] [[package]] name = "pallet-balances" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "log", + "parity-scale-codec", "serde", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-collective" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "log", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", +] + +[[package]] +name = "pallet-election-provider-multi-phase" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" +dependencies = [ + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "serde", + "sp-arithmetic", + "sp-election-providers", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-std", + "static_assertions", ] [[package]] name = "pallet-grandpa" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "pallet-authorship", "pallet-session", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-application-crypto", "sp-core", @@ -5008,237 +5063,240 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-identity" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "enumflags2", "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-im-online" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", + "log", "pallet-authorship", - "pallet-session", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-application-crypto", "sp-core", "sp-io", "sp-runtime", "sp-staking", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-membership" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-multisig" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-offences" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", + "log", "pallet-balances", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-runtime", "sp-staking", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-proxy" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-randomness-collective-flip" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "safe-mix", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-recovery" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "enumflags2", "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-scheduler" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "log", + "parity-scale-codec", "serde", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-session" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", - "impl-trait-for-tuples 0.1.3", + "impl-trait-for-tuples", "pallet-timestamp", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", "sp-session", "sp-staking", - "sp-std 2.0.1", + "sp-std", "sp-trie", ] [[package]] name = "pallet-society" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "rand_chacha 0.2.2", "serde", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-sudo" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-timestamp" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 1.3.7", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", "serde", "sp-inherents", "sp-runtime", - "sp-std 2.0.1", + "sp-std", "sp-timestamp", ] [[package]] name = "pallet-transaction-payment" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "smallvec 1.6.1", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "pallet-transaction-payment-rpc" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-api", "sp-blockchain", "sp-core", @@ -5248,28 +5306,28 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "pallet-transaction-payment", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-api", "sp-runtime", ] [[package]] name = "pallet-utility" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] @@ -5306,10 +5364,13 @@ dependencies = [ "frame-support", "frame-system", "frame-system-rpc-runtime-api", + "frame-try-runtime", + "log", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", "pallet-collective", + "pallet-election-provider-multi-phase", "pallet-grandpa", "pallet-identity", "pallet-im-online", @@ -5327,7 +5388,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-utility", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "smallvec 1.6.1", "sp-api", @@ -5342,25 +5403,28 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 2.0.1", + "sp-std", "sp-transaction-pool", "sp-version", - "static_assertions 1.1.0", + "static_assertions", "substrate-wasm-builder", ] [[package]] name = "parity-db" -version = "0.1.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00d595e372d119261593297debbe4193811a4dc811d2a1ccbb8caaa6666ad7ab" +checksum = "495197c078e54b8735181aa35c00a327f7f3a3cc00a1ee8c95926dd010f0ec6b" dependencies = [ "blake2-rfc", "crc32fast", + "fs2", + "hex", "libc", "log", - "memmap", - "parking_lot 0.10.2", + "memmap2", + "parking_lot 0.11.1", + "rand 0.8.3", ] [[package]] @@ -5376,24 +5440,11 @@ dependencies = [ "multihash", "percent-encoding 2.1.0", "serde", - "static_assertions 1.1.0", + "static_assertions", "unsigned-varint 0.7.0", "url 2.2.1", ] -[[package]] -name = "parity-scale-codec" -version = "1.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b26b16c7687c3075982af47719e481815df30bc544f7a6690763a25ca16e9d" -dependencies = [ - "arrayvec 0.5.2", - "bitvec", - "byte-slice-cast 0.3.5", - "parity-scale-codec-derive 1.2.3", - "serde", -] - [[package]] name = "parity-scale-codec" version = "2.0.1" @@ -5401,20 +5452,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cd3dab59b5cf4bc81069ade0fc470341a1ef3ad5fa73e5a8943bed2ec12b2e8" dependencies = [ "arrayvec 0.5.2", - "byte-slice-cast 1.0.0", - "parity-scale-codec-derive 2.0.1", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c41512944b1faff334a5f1b9447611bf4ef40638ccb6328173dacefb338e878c" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "bitvec", + "byte-slice-cast", + "parity-scale-codec-derive", + "serde", ] [[package]] @@ -5456,16 +5497,16 @@ dependencies = [ [[package]] name = "parity-util-mem" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f17f15cb05897127bf36a240085a1f0bbef7bce3024849eccf7f93f6171bc27" +checksum = "664a8c6b8e62d8f9f2f937e391982eb433ab285b4cd9545b342441e04a906e42" dependencies = [ "cfg-if 1.0.0", "hashbrown", - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "parity-util-mem-derive", "parking_lot 0.11.1", - "primitive-types 0.8.0", + "primitive-types", "smallvec 1.6.1", "winapi 0.3.9", ] @@ -5605,6 +5646,12 @@ dependencies = [ "proc-macro-hack", ] +[[package]] +name = "paste" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" + [[package]] name = "paste-impl" version = "0.1.18" @@ -5742,9 +5789,9 @@ checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "platforms" -version = "0.2.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e" +checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" [[package]] name = "plotters" @@ -5816,27 +5863,15 @@ checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "primitive-types" -version = "0.6.2" -source = "git+https://github.com/darwinia-network/parity-common.git#12a86aa8af8ff5ccd5c953074aa893c716cf85b5" -dependencies = [ - "fixed-hash 0.5.2", - "impl-codec 0.4.2 (git+https://github.com/darwinia-network/parity-common.git)", - "impl-rlp 0.2.1 (git+https://github.com/darwinia-network/parity-common.git)", - "impl-serde 0.3.0", - "uint 0.8.2", -] - -[[package]] -name = "primitive-types" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3824ae2c5e27160113b9e029a10ec9e3f0237bad8029f69c7724393c9fdefd8" +checksum = "2415937401cb030a2a0a4d922483f945fa068f52a7dbb22ce0fe5f2b6f6adace" dependencies = [ - "fixed-hash 0.7.0", - "impl-codec 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "impl-rlp 0.3.0", - "impl-serde 0.3.1", - "uint 0.9.0", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "uint", ] [[package]] @@ -5895,11 +5930,11 @@ dependencies = [ [[package]] name = "prometheus" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d70cf4412832bcac9cffe27906f4a66e450d323525e977168c70d1b36120ae" +checksum = "c8425533e7122f0c3cc7a37e6244b16ad3a2cc32ae7ac6276e2a75da0d9c200d" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "fnv", "lazy_static", "parking_lot 0.11.1", @@ -5907,16 +5942,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "prost" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" -dependencies = [ - "bytes 0.5.6", - "prost-derive 0.6.1", -] - [[package]] name = "prost" version = "0.7.0" @@ -5924,7 +5949,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" dependencies = [ "bytes 1.0.1", - "prost-derive 0.7.0", + "prost-derive", ] [[package]] @@ -5939,25 +5964,12 @@ dependencies = [ "log", "multimap", "petgraph", - "prost 0.7.0", + "prost", "prost-types", "tempfile", "which 4.0.2", ] -[[package]] -name = "prost-derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" -dependencies = [ - "anyhow", - "itertools 0.8.2", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "prost-derive" version = "0.7.0" @@ -5978,7 +5990,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" dependencies = [ "bytes 1.0.1", - "prost 0.7.0", + "prost", +] + +[[package]] +name = "psm" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3abf49e5417290756acfd26501536358560c4a5cc4a0934d390939acb3e7083a" +dependencies = [ + "cc", ] [[package]] @@ -6020,9 +6041,9 @@ dependencies = [ [[package]] name = "radium" -version = "0.3.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" [[package]] name = "rand" @@ -6177,9 +6198,9 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "7.0.4" +version = "8.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beb71f708fe39b2c5e98076204c3cc094ee5a4c12c4cdb119a2b72dc34164f41" +checksum = "1fdf7d9dbd43f3d81d94a49c1c3df73cc2b3827995147e6cf7f89d4ec5483e73" dependencies = [ "bitflags", "cc", @@ -6252,6 +6273,16 @@ dependencies = [ "rust-argon2", ] +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.2", + "redox_syscall 0.2.5", +] + [[package]] name = "ref-cast" version = "1.0.6" @@ -6274,9 +6305,9 @@ dependencies = [ [[package]] name = "regalloc" -version = "0.0.27" +version = "0.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ba8aaf5fe7cf307c6dbdaeed85478961d29e25e3bee5169e11b92fa9f027a8" +checksum = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5" dependencies = [ "log", "rustc-hash", @@ -6322,6 +6353,22 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "remote-externalities" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" +dependencies = [ + "env_logger 0.8.3", + "hex-literal", + "jsonrpsee-http-client", + "jsonrpsee-proc-macros", + "jsonrpsee-types", + "log", + "parity-scale-codec", + "sp-core", + "sp-io", +] + [[package]] name = "remove_dir_all" version = "0.5.3" @@ -6363,23 +6410,6 @@ dependencies = [ "opaque-debug 0.3.0", ] -[[package]] -name = "rlp" -version = "0.4.4" -source = "git+https://github.com/darwinia-network/parity-common.git#12a86aa8af8ff5ccd5c953074aa893c716cf85b5" -dependencies = [ - "rustc-hex", -] - -[[package]] -name = "rlp" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1190dcc8c3a512f1eef5d09bb8c84c7f39e1054e174d1795482e18f5272f2e73" -dependencies = [ - "rustc-hex", -] - [[package]] name = "rlp" version = "0.5.0" @@ -6390,16 +6420,6 @@ dependencies = [ "rustc-hex", ] -[[package]] -name = "rlp-derive" -version = "0.1.0" -source = "git+https://github.com/darwinia-network/parity-common.git#12a86aa8af8ff5ccd5c953074aa893c716cf85b5" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "rlp-derive" version = "0.1.0" @@ -6516,7 +6536,7 @@ checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ "futures 0.3.13", "pin-project 0.4.27", - "static_assertions 1.1.0", + "static_assertions", ] [[package]] @@ -6554,8 +6574,8 @@ dependencies = [ [[package]] name = "sc-authority-discovery" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "async-trait", "derive_more", @@ -6564,8 +6584,8 @@ dependencies = [ "futures-timer 3.0.2", "libp2p", "log", - "parity-scale-codec 1.3.7", - "prost 0.7.0", + "parity-scale-codec", + "prost", "prost-build", "rand 0.7.3", "sc-client-api", @@ -6582,13 +6602,13 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sc-block-builder", "sc-client-api", "sc-proposer-metrics", @@ -6605,15 +6625,14 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sc-client-api", "sp-api", "sp-block-builder", "sp-blockchain", - "sp-consensus", "sp-core", "sp-inherents", "sp-runtime", @@ -6622,11 +6641,11 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 1.3.7", + "impl-trait-for-tuples", + "parity-scale-codec", "sc-chain-spec-derive", "sc-consensus-babe", "sc-consensus-epochs", @@ -6643,8 +6662,8 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6654,8 +6673,8 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "chrono", "fdlimit", @@ -6664,7 +6683,7 @@ dependencies = [ "libp2p", "log", "names", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "rand 0.7.3", "regex", "rpassword", @@ -6692,8 +6711,8 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "derive_more", "fnv", @@ -6702,7 +6721,7 @@ dependencies = [ "kvdb", "lazy_static", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "sc-executor", "sp-api", @@ -6715,7 +6734,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-state-machine", - "sp-std 2.0.1", + "sp-std", "sp-storage", "sp-transaction-pool", "sp-trie", @@ -6726,8 +6745,8 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "blake2-rfc", "hash-db", @@ -6737,7 +6756,7 @@ dependencies = [ "linked-hash-map", "log", "parity-db", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parity-util-mem", "parking_lot 0.11.1", "sc-client-api", @@ -6756,8 +6775,8 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "sc-client-api", "sp-blockchain", @@ -6767,8 +6786,8 @@ dependencies = [ [[package]] name = "sc-consensus-babe" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "derive_more", "fork-tree", @@ -6779,7 +6798,7 @@ dependencies = [ "num-bigint 0.2.6", "num-rational 0.2.4", "num-traits", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "pdqselect", "rand 0.7.3", @@ -6798,6 +6817,7 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-consensus-babe", + "sp-consensus-slots", "sp-consensus-vrf", "sp-core", "sp-inherents", @@ -6812,8 +6832,8 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "derive_more", "futures 0.3.13", @@ -6836,11 +6856,11 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "fork-tree", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "sc-client-api", "sp-blockchain", @@ -6849,13 +6869,13 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "sc-client-api", "sc-telemetry", @@ -6875,8 +6895,8 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "log", "sc-client-api", @@ -6889,14 +6909,14 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "derive_more", "lazy_static", "libsecp256k1", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parity-wasm 0.41.0", "parking_lot 0.11.1", "sc-executor-common", @@ -6918,11 +6938,11 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "derive_more", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parity-wasm 0.41.0", "sp-allocator", "sp-core", @@ -6934,11 +6954,11 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sc-executor-common", "sp-allocator", "sp-core", @@ -6949,11 +6969,11 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parity-wasm 0.41.0", "pwasm-utils", "sc-executor-common", @@ -6967,19 +6987,20 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "derive_more", + "dyn-clone", "finality-grandpa", "fork-tree", "futures 0.3.13", "futures-timer 3.0.2", "linked-hash-map", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", - "pin-project 0.4.27", + "pin-project 1.0.5", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -7005,8 +7026,8 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "derive_more", "finality-grandpa", @@ -7016,7 +7037,7 @@ dependencies = [ "jsonrpc-derive", "jsonrpc-pubsub", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sc-client-api", "sc-finality-grandpa", "sc-rpc", @@ -7029,28 +7050,29 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-warp-sync" -version = "0.8.0" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "derive_more", "futures 0.3.13", "log", "num-traits", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", - "prost 0.6.1", + "prost", "sc-client-api", "sc-finality-grandpa", "sc-network", "sc-service", "sp-blockchain", + "sp-finality-grandpa", "sp-runtime", ] [[package]] name = "sc-informant" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "ansi_term 0.12.1", "futures 0.3.13", @@ -7067,8 +7089,8 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "async-trait", "derive_more", @@ -7087,12 +7109,12 @@ dependencies = [ [[package]] name = "sc-light" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "hash-db", "lazy_static", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "sc-client-api", "sc-executor", @@ -7106,8 +7128,8 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "async-std", "async-trait", @@ -7115,6 +7137,7 @@ dependencies = [ "bitflags", "bs58", "bytes 1.0.1", + "cid", "derive_more", "either", "erased-serde", @@ -7130,10 +7153,10 @@ dependencies = [ "log", "lru", "nohash-hasher", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", - "pin-project 0.4.27", - "prost 0.7.0", + "pin-project 1.0.5", + "prost", "prost-build", "rand 0.7.3", "sc-block-builder", @@ -7158,8 +7181,8 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", @@ -7174,8 +7197,8 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "bytes 0.5.6", "fnv", @@ -7185,7 +7208,7 @@ dependencies = [ "hyper-rustls", "log", "num_cpus", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "rand 0.7.3", "sc-client-api", @@ -7201,8 +7224,8 @@ dependencies = [ [[package]] name = "sc-peerset" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "futures 0.3.13", "libp2p", @@ -7214,8 +7237,8 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7223,15 +7246,15 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "futures 0.3.13", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "sc-block-builder", "sc-client-api", @@ -7257,8 +7280,8 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "derive_more", "futures 0.3.13", @@ -7267,7 +7290,7 @@ dependencies = [ "jsonrpc-derive", "jsonrpc-pubsub", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "serde", "serde_json", @@ -7281,8 +7304,8 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "futures 0.1.31", "jsonrpc-core", @@ -7299,10 +7322,10 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "directories 3.0.1", + "directories", "exit-future", "futures 0.1.31", "futures 0.3.13", @@ -7312,10 +7335,10 @@ dependencies = [ "jsonrpc-pubsub", "lazy_static", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parity-util-mem", "parking_lot 0.11.1", - "pin-project 0.4.27", + "pin-project 1.0.5", "rand 0.7.3", "sc-block-builder", "sc-chain-spec", @@ -7362,11 +7385,11 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parity-util-mem", "parity-util-mem-derive", "parking_lot 0.11.1", @@ -7377,8 +7400,8 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" -version = "0.8.0" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -7397,15 +7420,15 @@ dependencies = [ [[package]] name = "sc-telemetry" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "chrono", "futures 0.3.13", "libp2p", "log", "parking_lot 0.11.1", - "pin-project 0.4.27", + "pin-project 1.0.5", "rand 0.7.3", "serde", "serde_json", @@ -7419,8 +7442,8 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "ansi_term 0.12.1", "atty", @@ -7447,8 +7470,8 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" -version = "2.0.0" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7458,8 +7481,8 @@ dependencies = [ [[package]] name = "sc-transaction-graph" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "derive_more", "futures 0.3.13", @@ -7480,14 +7503,14 @@ dependencies = [ [[package]] name = "sc-transaction-pool" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "futures 0.3.13", "futures-diagnose", "intervalier", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parity-util-mem", "parking_lot 0.11.1", "sc-client-api", @@ -7815,7 +7838,7 @@ dependencies = [ "approx", "num-complex 0.2.4", "num-traits", - "paste", + "paste 0.1.18", ] [[package]] @@ -7886,36 +7909,37 @@ dependencies = [ [[package]] name = "sp-allocator" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "log", "sp-core", - "sp-std 2.0.1", + "sp-std", "sp-wasm-interface", "thiserror", ] [[package]] name = "sp-api" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "hash-db", - "parity-scale-codec 1.3.7", + "log", + "parity-scale-codec", "sp-api-proc-macro", "sp-core", "sp-runtime", "sp-state-machine", - "sp-std 2.0.1", + "sp-std", "sp-version", "thiserror", ] [[package]] name = "sp-api-proc-macro" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "blake2-rfc", "proc-macro-crate", @@ -7926,73 +7950,73 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-core", "sp-io", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-arithmetic" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "integer-sqrt", "num-traits", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-debug-derive", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-authority-discovery" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-api", "sp-application-crypto", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-authorship" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-block-builder" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-api", "sp-inherents", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-blockchain" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "futures 0.3.13", "log", "lru", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "sp-api", "sp-consensus", @@ -8004,8 +8028,8 @@ dependencies = [ [[package]] name = "sp-chain-spec" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "serde", "serde_json", @@ -8013,14 +8037,14 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", "libp2p", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "serde", "sp-api", @@ -8028,7 +8052,7 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std 2.0.1", + "sp-std", "sp-trie", "sp-utils", "sp-version", @@ -8039,11 +8063,11 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "merlin", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-api", "sp-application-crypto", "sp-consensus", @@ -8053,35 +8077,36 @@ dependencies = [ "sp-inherents", "sp-keystore", "sp-runtime", - "sp-std 2.0.1", + "sp-std", "sp-timestamp", ] [[package]] name = "sp-consensus-slots" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", + "sp-arithmetic", "sp-runtime", ] [[package]] name = "sp-consensus-vrf" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", "schnorrkel", "sp-core", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-core" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "base58", "blake2-rfc", @@ -8092,16 +8117,16 @@ dependencies = [ "hash-db", "hash256-std-hasher", "hex", - "impl-serde 0.3.1", + "impl-serde", "lazy_static", "libsecp256k1", "log", "merlin", "num-traits", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parity-util-mem", "parking_lot 0.11.1", - "primitive-types 0.8.0", + "primitive-types", "rand 0.7.3", "regex", "schnorrkel", @@ -8111,12 +8136,12 @@ dependencies = [ "sp-debug-derive", "sp-externalities", "sp-runtime-interface", - "sp-std 2.0.1", + "sp-std", "sp-storage", "substrate-bip39", "thiserror", "tiny-bip39", - "tiny-keccak 2.0.2", + "tiny-keccak", "twox-hash", "wasmi", "zeroize", @@ -8124,8 +8149,8 @@ dependencies = [ [[package]] name = "sp-database" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -8133,71 +8158,82 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "sp-election-providers" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" +dependencies = [ + "parity-scale-codec", + "sp-arithmetic", + "sp-npos-elections", + "sp-std", +] + [[package]] name = "sp-externalities" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "environmental", - "parity-scale-codec 1.3.7", - "sp-std 2.0.1", + "parity-scale-codec", + "sp-std", "sp-storage", ] [[package]] name = "sp-finality-grandpa" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "finality-grandpa", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-api", "sp-application-crypto", "sp-core", "sp-keystore", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-inherents" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "sp-core", - "sp-std 2.0.1", + "sp-std", "thiserror", ] [[package]] name = "sp-io" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "futures 0.3.13", "hash-db", "libsecp256k1", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "sp-core", "sp-externalities", "sp-keystore", "sp-runtime-interface", "sp-state-machine", - "sp-std 2.0.1", + "sp-std", "sp-tracing", "sp-trie", "sp-wasm-interface", @@ -8207,8 +8243,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "lazy_static", "sp-core", @@ -8218,14 +8254,14 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.8.0" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "async-trait", "derive_more", "futures 0.3.13", "merlin", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "schnorrkel", "serde", @@ -8235,21 +8271,21 @@ dependencies = [ [[package]] name = "sp-npos-elections" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-arithmetic", "sp-core", "sp-npos-elections-compact", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-npos-elections-compact" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8259,8 +8295,8 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "sp-api", "sp-core", @@ -8269,16 +8305,16 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "backtrace", ] [[package]] name = "sp-rpc" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "serde", "sp-core", @@ -8286,46 +8322,46 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "either", "hash256-std-hasher", - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parity-util-mem", - "paste", + "paste 1.0.5", "rand 0.7.3", "serde", "sp-application-crypto", "sp-arithmetic", "sp-core", "sp-io", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-runtime-interface" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 1.3.7", - "primitive-types 0.8.0", + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", - "sp-std 2.0.1", + "sp-std", "sp-storage", "sp-tracing", "sp-wasm-interface", - "static_assertions 1.1.0", + "static_assertions", ] [[package]] name = "sp-runtime-interface-proc-macro" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "Inflector", "proc-macro-crate", @@ -8336,8 +8372,8 @@ dependencies = [ [[package]] name = "sp-serializer" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "serde", "serde_json", @@ -8345,43 +8381,43 @@ dependencies = [ [[package]] name = "sp-session" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-api", "sp-core", "sp-runtime", "sp-staking", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-staking" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-state-machine" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "hash-db", "log", "num-traits", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "parking_lot 0.11.1", "rand 0.7.3", "smallvec 1.6.1", "sp-core", "sp-externalities", "sp-panic-handler", - "sp-std 2.0.1", + "sp-std", "sp-trie", "thiserror", "trie-db", @@ -8390,62 +8426,57 @@ dependencies = [ [[package]] name = "sp-std" -version = "2.0.0-rc2" -source = "git+https://github.com/darwinia-network/substrate.git?branch=darwinia-develop#45b9f0a9cbf901abaa9f1fca5fe8baeed029133d" - -[[package]] -name = "sp-std" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" [[package]] name = "sp-storage" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "impl-serde 0.3.1", - "parity-scale-codec 1.3.7", + "impl-serde", + "parity-scale-codec", "ref-cast", "serde", "sp-debug-derive", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-tasks" -version = "2.0.0" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "log", "sp-core", "sp-externalities", "sp-io", "sp-runtime-interface", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-timestamp" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 1.3.7", + "impl-trait-for-tuples", + "parity-scale-codec", "sp-api", "sp-inherents", "sp-runtime", - "sp-std 2.0.1", + "sp-std", "wasm-timer", ] [[package]] name = "sp-tracing" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "log", - "parity-scale-codec 1.3.7", - "sp-std 2.0.1", + "parity-scale-codec", + "sp-std", "tracing", "tracing-core", "tracing-subscriber", @@ -8453,13 +8484,13 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "derive_more", "futures 0.3.13", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "serde", "sp-api", "sp-blockchain", @@ -8469,22 +8500,22 @@ dependencies = [ [[package]] name = "sp-trie" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "hash-db", "memory-db", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sp-core", - "sp-std 2.0.1", + "sp-std", "trie-db", "trie-root", ] [[package]] name = "sp-utils" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "futures 0.3.13", "futures-core", @@ -8495,24 +8526,24 @@ dependencies = [ [[package]] name = "sp-version" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "impl-serde 0.3.1", - "parity-scale-codec 1.3.7", + "impl-serde", + "parity-scale-codec", "serde", "sp-runtime", - "sp-std 2.0.1", + "sp-std", ] [[package]] name = "sp-wasm-interface" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ - "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 1.3.7", - "sp-std 2.0.1", + "impl-trait-for-tuples", + "parity-scale-codec", + "sp-std", "wasmi", ] @@ -8528,12 +8559,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "static_assertions" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" - [[package]] name = "static_assertions" version = "1.1.0" @@ -8600,18 +8625,18 @@ dependencies = [ [[package]] name = "strum" -version = "0.16.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6138f8f88a16d90134763314e3fc76fa3ed6a7db4725d6acf9a3ef95a3188d22" +checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.16.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0054a7df764039a6cd8592b9de84be4bec368ff081d203a7d5371cbfa8e65c81" +checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" dependencies = [ "heck", "proc-macro2", @@ -8647,8 +8672,8 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "platforms", ] @@ -8658,14 +8683,14 @@ name = "substrate-fixed" version = "0.5.6" source = "git+https://github.com/encointer/substrate-fixed?branch=master#b33d186888c60f38adafcfc0ec3a21aab263aef1" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec", "typenum", ] [[package]] name = "substrate-frame-rpc-system" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.13", @@ -8673,7 +8698,7 @@ dependencies = [ "jsonrpc-core-client", "jsonrpc-derive", "log", - "parity-scale-codec 1.3.7", + "parity-scale-codec", "sc-client-api", "sc-rpc-api", "serde", @@ -8687,8 +8712,8 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "async-std", "derive_more", @@ -8701,8 +8726,8 @@ dependencies = [ [[package]] name = "substrate-test-utils" -version = "2.0.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "futures 0.3.13", "substrate-test-utils-derive", @@ -8711,8 +8736,8 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" -version = "0.8.1" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "proc-macro-crate", "quote", @@ -8721,8 +8746,8 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "3.0.0" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.2.1-darwinia#466ac62ecd1f096606691f0ed24a0851cc7a2ac1" +version = "4.0.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" dependencies = [ "ansi_term 0.12.1", "atty", @@ -8775,11 +8800,17 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "target-lexicon" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" +checksum = "422045212ea98508ae3d28025bc5aaa2bd4a9cdaecd442a08da2ee620ee9ea95" [[package]] name = "tempfile" @@ -8880,15 +8911,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "tiny-keccak" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d8a021c69bb74a44ccedb824a046447e2c84a01df9e5c20779750acb38e11b2" -dependencies = [ - "crunchy", -] - [[package]] name = "tiny-keccak" version = "2.0.2" @@ -9333,15 +9355,6 @@ dependencies = [ "hash-db", ] -[[package]] -name = "triehash" -version = "0.8.2" -source = "git+https://github.com/darwinia-network/parity-common.git#12a86aa8af8ff5ccd5c953074aa893c716cf85b5" -dependencies = [ - "hash-db", - "rlp 0.4.4", -] - [[package]] name = "triehash" version = "0.8.4" @@ -9349,7 +9362,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" dependencies = [ "hash-db", - "rlp 0.5.0", + "rlp", ] [[package]] @@ -9358,6 +9371,28 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +[[package]] +name = "try-runtime-cli" +version = "0.9.0" +source = "git+https://github.com/darwinia-network/substrate.git?tag=rococo-v1.1#645299e8b23ec5fa52935b1a6edbf36886e80141" +dependencies = [ + "frame-try-runtime", + "log", + "parity-scale-codec", + "remote-externalities", + "sc-cli", + "sc-client-api", + "sc-executor", + "sc-service", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-externalities", + "sp-runtime", + "sp-state-machine", + "structopt", +] + [[package]] name = "twox-hash" version = "1.6.0" @@ -9365,8 +9400,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ "cfg-if 0.1.10", - "rand 0.7.3", - "static_assertions 1.1.0", + "rand 0.5.6", + "static_assertions", ] [[package]] @@ -9381,29 +9416,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" -[[package]] -name = "uint" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "082df6964410f6aa929a61ddfafc997e4f32c62c22490e439ac351cec827f436" -dependencies = [ - "byteorder", - "crunchy", - "heapsize", - "rustc-hex", -] - -[[package]] -name = "uint" -version = "0.8.2" -source = "git+https://github.com/darwinia-network/parity-common.git#12a86aa8af8ff5ccd5c953074aa893c716cf85b5" -dependencies = [ - "byteorder", - "crunchy", - "rustc-hex", - "static_assertions 1.1.0", -] - [[package]] name = "uint" version = "0.9.0" @@ -9413,7 +9425,7 @@ dependencies = [ "byteorder", "crunchy", "hex", - "static_assertions 1.1.0", + "static_assertions", ] [[package]] @@ -9746,33 +9758,31 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.57.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32fddd575d477c6e9702484139cf9f23dcd554b06d185ed0f56c857dd3a47aa6" - -[[package]] -name = "wasmparser" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a950e6a618f62147fd514ff445b2a0b53120d382751960797f85f058c7eda9b9" +checksum = "89a30c99437829ede826802bfcf28500cf58df00e66cb9114df98813bc145ff1" [[package]] name = "wasmtime" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd3c4f449382779ef6e0a7c3ec6752ae614e20a42e4100000c3efdc973100e2" +checksum = "7426055cb92bd9a1e9469b48154d8d6119cd8c498c8b70284e420342c05dc45d" dependencies = [ "anyhow", "backtrace", - "cfg-if 0.1.10", - "lazy_static", + "bincode", + "cfg-if 1.0.0", + "cpp_demangle", + "indexmap", "libc", "log", "region", "rustc-demangle", + "serde", "smallvec 1.6.1", "target-lexicon", - "wasmparser 0.59.0", + "wasmparser", + "wasmtime-cache", "wasmtime-environ", "wasmtime-jit", "wasmtime-profiling", @@ -9781,74 +9791,101 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "wasmtime-cache" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c01d9287e36921e46f5887a47007824ae5dbb9b7517a2d565660ab4471478709" +dependencies = [ + "anyhow", + "base64 0.13.0", + "bincode", + "directories-next", + "errno", + "file-per-thread-logger", + "libc", + "log", + "serde", + "sha2 0.9.3", + "toml", + "winapi 0.3.9", + "zstd", +] + +[[package]] +name = "wasmtime-cranelift" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4134ed3a4316cd0de0e546c6004850afe472b0fa3fcdc2f2c15f8d449562d962" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-wasm", + "wasmtime-environ", +] + [[package]] name = "wasmtime-debug" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e634af9067a3af6cf2c7d33dc3b84767ddaf5d010ba68e80eecbcea73d4a349" +checksum = "e91fa931df6dd8af2b02606307674d3bad23f55473d5f4c809dddf7e4c4dc411" dependencies = [ "anyhow", - "gimli 0.21.0", + "gimli", "more-asserts", - "object 0.20.0", + "object 0.22.0", "target-lexicon", "thiserror", - "wasmparser 0.59.0", + "wasmparser", "wasmtime-environ", ] [[package]] name = "wasmtime-environ" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f85619a94ee4034bd5bb87fc3dcf71fd2237b81c840809da1201061eec9ab3" +checksum = "a1098871dc3120aaf8190d79153e470658bb79f63ee9ca31716711e123c28220" dependencies = [ "anyhow", - "base64 0.12.3", - "bincode", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "cranelift-codegen", "cranelift-entity", - "cranelift-frontend", "cranelift-wasm", - "directories 2.0.2", - "errno", - "file-per-thread-logger", + "gimli", "indexmap", - "libc", "log", "more-asserts", - "rayon", "serde", - "sha2 0.8.2", "thiserror", - "toml", - "wasmparser 0.59.0", - "winapi 0.3.9", - "zstd", + "wasmparser", ] [[package]] name = "wasmtime-jit" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e914c013c7a9f15f4e429d5431f2830fb8adb56e40567661b69c5ec1d645be23" +checksum = "738bfcd1561ede8bb174215776fd7d9a95d5f0a47ca3deabe0282c55f9a89f68" dependencies = [ + "addr2line", "anyhow", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "cranelift-codegen", "cranelift-entity", "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.21.0", + "gimli", "log", "more-asserts", - "object 0.20.0", + "object 0.22.0", + "rayon", "region", + "serde", "target-lexicon", "thiserror", - "wasmparser 0.59.0", + "wasmparser", + "wasmtime-cranelift", "wasmtime-debug", "wasmtime-environ", "wasmtime-obj", @@ -9859,13 +9896,13 @@ dependencies = [ [[package]] name = "wasmtime-obj" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e81d8e02e9bc9fe2da9b6d48bbc217f96e089f7df613f11a28a3958abc44641e" +checksum = "3e96d77f1801131c5e86d93e42a3cf8a35402107332c202c245c83f34888a906" dependencies = [ "anyhow", "more-asserts", - "object 0.20.0", + "object 0.22.0", "target-lexicon", "wasmtime-debug", "wasmtime-environ", @@ -9873,16 +9910,16 @@ dependencies = [ [[package]] name = "wasmtime-profiling" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8d4d1af8dd5f7096cfcc89dd668d358e52980c38cce199643372ffd6590e27" +checksum = "60bb672c9d894776d7b9250dd9b4fe890f8760201ee4f53e5f2da772b6c4debb" dependencies = [ "anyhow", - "cfg-if 0.1.10", - "gimli 0.21.0", + "cfg-if 1.0.0", + "gimli", "lazy_static", "libc", - "object 0.19.0", + "object 0.22.0", "scroll", "serde", "target-lexicon", @@ -9892,19 +9929,20 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a25f140bbbaadb07c531cba99ce1a966dba216138dc1b2a0ddecec851a01a93" +checksum = "a978086740949eeedfefcee667b57a9e98d9a7fc0de382fcfa0da30369e3530d" dependencies = [ "backtrace", "cc", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "indexmap", "lazy_static", "libc", "log", - "memoffset 0.5.6", + "memoffset 0.6.1", "more-asserts", + "psm", "region", "thiserror", "wasmtime-environ", @@ -10039,6 +10077,12 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" + [[package]] name = "x25519-dalek" version = "1.1.0" @@ -10061,7 +10105,7 @@ dependencies = [ "nohash-hasher", "parking_lot 0.11.1", "rand 0.7.3", - "static_assertions 1.1.0", + "static_assertions", ] [[package]] diff --git a/bin/node/cli/Cargo.toml b/bin/node/cli/Cargo.toml index ca185ef1b4..4bb04dbc47 100644 --- a/bin/node/cli/Cargo.toml +++ b/bin/node/cli/Cargo.toml @@ -17,7 +17,7 @@ name = "drml" [dependencies] # crates array-bytes = { version = "1.1.0" } -codec = { package = "parity-scale-codec", version = "1.3.7" } +codec = { package = "parity-scale-codec", version = "2.0.1" } futures = { version = "0.3.13" } jsonrpc-core = { version = "15.1.0" } jsonrpc-pubsub = { version = "15.1.0" } @@ -47,52 +47,53 @@ dvm-ethereum = { path = "../../../frame/dvm" } dvm-rpc-runtime-api = { path = "../../../frame/dvm/rpc/runtime-api" } pangolin-runtime = { path = "../runtime/pangolin" } # substrate -frame-system-rpc-runtime-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-im-online = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-transaction-payment-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-authority-discovery = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-basic-authorship = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-chain-spec = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-cli = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-consensus = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-consensus-babe = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-consensus-babe-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-consensus-epochs = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-consensus-slots = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-executor = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-finality-grandpa = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-finality-grandpa-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-finality-grandpa-warp-sync = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-keystore = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-network = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-service = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-sync-state-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-telemetry = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-authority-discovery = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-block-builder = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-consensus = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-consensus-babe = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-finality-grandpa = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-inherents = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-keystore = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-offchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-session = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-trie = { features = ["memory-tracker"], git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -substrate-frame-rpc-system = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -substrate-prometheus-endpoint = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-system-rpc-runtime-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-im-online = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-transaction-payment-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-authority-discovery = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-basic-authorship = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-chain-spec = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-cli = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-consensus = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-consensus-babe = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-consensus-babe-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-consensus-epochs = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-consensus-slots = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-executor = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-finality-grandpa = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-finality-grandpa-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-finality-grandpa-warp-sync = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-keystore = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-network = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-service = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-sync-state-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-telemetry = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-authority-discovery = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-block-builder = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-consensus = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-consensus-babe = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-finality-grandpa = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-inherents = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-keystore = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-offchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-session = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-trie = { features = ["memory-tracker"], git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +substrate-frame-rpc-system = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +substrate-prometheus-endpoint = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +try-runtime-cli = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [build-dependencies] # substrate -substrate-build-script-utils = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +substrate-build-script-utils = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = [ @@ -112,3 +113,9 @@ cli = [ db = ["sc-service/db"] full-node = [] wasmtime = ["sc-cli/wasmtime"] +# Enable features that allow the runtime to be tried and debugged. Name might be subject to change +# in the near future. +try-runtime = [ + "pangolin-runtime/try-runtime", + "try-runtime-cli", +] diff --git a/bin/node/cli/src/chain_spec.rs b/bin/node/cli/src/chain_spec.rs index 6310841007..28b5c33307 100644 --- a/bin/node/cli/src/chain_spec.rs +++ b/bin/node/cli/src/chain_spec.rs @@ -17,14 +17,14 @@ // along with Darwinia. If not, see . // --- std --- -use std::collections::BTreeMap; +use std::{collections::BTreeMap, marker::PhantomData}; // --- substrate --- use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use sc_service::{ChainType, Properties}; use sc_telemetry::TelemetryEndpoints; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_babe::AuthorityId as BabeId; -use sp_core::{sr25519, Pair, Public, H160}; +use sp_core::{sr25519, Pair, Public}; use sp_finality_grandpa::AuthorityId as GrandpaId; use sp_runtime::{ traits::{IdentifyAccount, Verify}, @@ -35,14 +35,32 @@ use darwinia_claims::ClaimsList; use darwinia_ethereum_relay::DagsMerkleRootsLoader as DagsMerkleRootsLoaderR; use darwinia_evm::GenesisAccount; use drml_primitives::*; -use pangolin_runtime::{constants::COIN, BalancesConfig as RingConfig, *}; +use pangolin_runtime::constants::COIN; -pub type PangolinChainSpec = sc_service::GenericChainSpec; +pub type PangolinChainSpec = sc_service::GenericChainSpec; type AccountPublic = ::Signer; const PANGOLIN_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; +const COLLECTIVE_MEMBER: &'static str = + "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"; + +const TOKEN_REDEEM_ADDRESS: &'static str = "0x49262B932E439271d05634c32978294C7Ea15d0C"; +const DEPOSIT_REDEEM_ADDRESS: &'static str = "0x6EF538314829EfA8386Fc43386cB13B4e0A67D1e"; +const SET_AUTHORITIES_ADDRESS: &'static str = "0xE4A2892599Ad9527D76Ce6E26F93620FA7396D85"; +const RING_TOKEN_ADDRESS: &'static str = "0xb52FBE2B925ab79a821b261C82c5Ba0814AAA5e0"; +const KTON_TOKEN_ADDRESS: &'static str = "0x1994100c58753793D52c6f457f189aa3ce9cEe94"; +const ETHEREUM_RELAY_AUTHORITY: &'static str = + "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"; +const ETHEREUM_RELAY_AUTHORITY_SIGNER: &'static str = "0x6aA70f55E5D770898Dd45aa1b7078b8A80AAbD6C"; + +const EVM_ACCOUNTS: [&'static str; 3] = [ + "0x68898db1012808808c903f390909c52d9f706749", + "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b", + "0xB90168C8CBcd351D069ffFdA7B71cd846924d551", +]; + pub fn pangolin_config() -> Result { PangolinChainSpec::from_json_bytes(&include_bytes!("../../../res/pangolin/pangolin.json")[..]) } @@ -52,8 +70,8 @@ pub fn pangolin_session_keys( grandpa: GrandpaId, im_online: ImOnlineId, authority_discovery: AuthorityDiscoveryId, -) -> SessionKeys { - SessionKeys { +) -> pangolin_runtime::SessionKeys { + pangolin_runtime::SessionKeys { babe, grandpa, im_online, @@ -121,23 +139,13 @@ pub fn pangolin_build_spec_config() -> PangolinChainSpec { ) } -fn pangolin_build_spec_genesis() -> GenesisConfig { +fn pangolin_build_spec_genesis() -> pangolin_runtime::GenesisConfig { const ROOT: &'static str = "0x72819fbc1b93196fa230243947c1726cbea7e33044c7eb6f736ff345561f9e4c"; const GENESIS_VALIDATOR: &'static str = "Alice"; const GENESIS_VALIDATOR_STASH: &'static str = "Alice//stash"; const GENESIS_VALIDATOR_BOND: Balance = COIN; - const GENESIS_EVM_ACCOUNT: &'static str = "0x68898db1012808808c903f390909c52d9f706749"; - const GENESIS_ETHEREUM_RELAY_AUTHORITY_SIGNER: &'static str = - "0x6aA70f55E5D770898Dd45aa1b7078b8A80AAbD6C"; - - const TOKEN_REDEEM_ADDRESS: &'static str = "0x49262B932E439271d05634c32978294C7Ea15d0C"; - const DEPOSIT_REDEEM_ADDRESS: &'static str = "0x6EF538314829EfA8386Fc43386cB13B4e0A67D1e"; - const SET_AUTHORITIES_ADDRESS: &'static str = "0xE4A2892599Ad9527D76Ce6E26F93620FA7396D85"; - const RING_TOKEN_ADDRESS: &'static str = "0xb52FBE2B925ab79a821b261C82c5Ba0814AAA5e0"; - const KTON_TOKEN_ADDRESS: &'static str = "0x1994100c58753793D52c6f457f189aa3ce9cEe94"; let root = AccountId::from(array_bytes::hex2array_unchecked!(ROOT, 32)); - let evm = array_bytes::hex2array_unchecked!(GENESIS_EVM_ACCOUNT, 20).into(); let initial_authorities = vec![get_authority_keys_from_seed(GENESIS_VALIDATOR)]; let endowed_accounts = vec![ (root.clone(), 1 << 56), @@ -146,72 +154,75 @@ fn pangolin_build_spec_genesis() -> GenesisConfig { GENESIS_VALIDATOR_BOND, ), ]; - let mut evm_accounts = BTreeMap::new(); + let evm_accounts = { + let mut map = BTreeMap::new(); - evm_accounts.insert( - evm, - GenesisAccount { - nonce: 0.into(), - balance: 20_000_000_000_000_000_000_000_000u128.into(), - storage: BTreeMap::new(), - code: vec![], - }, - ); + for account in EVM_ACCOUNTS.iter() { + map.insert( + array_bytes::hex2array_unchecked!(account, 20).into(), + GenesisAccount { + nonce: 0.into(), + balance: 20_000_000_000_000_000_000_000_000u128.into(), + storage: BTreeMap::new(), + code: vec![], + }, + ); + } + + map + }; - GenesisConfig { - frame_system: Some(SystemConfig { - code: wasm_binary_unwrap().to_vec(), + pangolin_runtime::GenesisConfig { + frame_system: pangolin_runtime::SystemConfig { + code: pangolin_runtime::wasm_binary_unwrap().to_vec(), changes_trie_config: Default::default(), - }), - pallet_babe: Some(Default::default()), - darwinia_balances_Instance0: Some(RingConfig { balances: endowed_accounts }), - darwinia_balances_Instance1: Some(Default::default()), - darwinia_staking: Some(StakingConfig { + }, + pallet_babe: Default::default(), + darwinia_balances_Instance0: pangolin_runtime::BalancesConfig { balances: endowed_accounts }, + darwinia_balances_Instance1: Default::default(), + darwinia_staking: pangolin_runtime::StakingConfig { minimum_validator_count: 1, validator_count: 7, stakers: initial_authorities .iter() .cloned() - .map(|x| (x.0, x.1, GENESIS_VALIDATOR_BOND, StakerStatus::Validator)) + .map(|x| (x.0, x.1, GENESIS_VALIDATOR_BOND, pangolin_runtime::StakerStatus::Validator)) .collect(), slash_reward_fraction: Perbill::from_percent(10), payout_fraction: Perbill::from_percent(50), ..Default::default() - }), - pallet_session: Some(SessionConfig { + }, + pallet_session: pangolin_runtime::SessionConfig { keys: initial_authorities .iter() .cloned() .map(|x| (x.0.clone(), x.0, pangolin_session_keys(x.2, x.3, x.4, x.5))) .collect(), - }), - pallet_grandpa: Some(Default::default()), - pallet_im_online: Some(Default::default()), - pallet_authority_discovery: Some(Default::default()), - darwinia_democracy: Some(Default::default()), - pallet_collective_Instance0: Some(Default::default()), - pallet_collective_Instance1: Some(Default::default()), - darwinia_elections_phragmen: Some(Default::default()), - pallet_membership_Instance0: Some(Default::default()), - darwinia_claims: Some(Default::default()), - darwinia_vesting: Some(Default::default()), - pallet_sudo: Some(SudoConfig { key: root.clone() }), - darwinia_crab_issuing: Some(CrabIssuingConfig { + }, + pallet_grandpa: Default::default(), + pallet_im_online: Default::default(), + pallet_authority_discovery: Default::default(), + darwinia_democracy: Default::default(), + pallet_collective_Instance0: pangolin_runtime::CouncilConfig { + phantom: PhantomData::, + members: vec![array_bytes::hex2array_unchecked!(COLLECTIVE_MEMBER, 32).into()] + }, + pallet_collective_Instance1: pangolin_runtime::TechnicalCommitteeConfig { + phantom: PhantomData::, + members: vec![array_bytes::hex2array_unchecked!(COLLECTIVE_MEMBER, 32).into()] + }, + darwinia_elections_phragmen: Default::default(), + pallet_membership_Instance0: Default::default(), + darwinia_claims: Default::default(), + darwinia_vesting: Default::default(), + pallet_sudo: pangolin_runtime::SudoConfig { key: root.clone() }, + darwinia_crab_issuing: pangolin_runtime::CrabIssuingConfig { total_mapped_ring: 1 << 56 - }), - darwinia_crab_backing: Some(CrabBackingConfig { + }, + darwinia_crab_backing: pangolin_runtime::CrabBackingConfig { backed_ring: 1 << 56 - }), - darwinia_ethereum_backing: Some(EthereumBackingConfig { - token_redeem_address: array_bytes::hex2array_unchecked!(TOKEN_REDEEM_ADDRESS, 20).into(), - deposit_redeem_address: array_bytes::hex2array_unchecked!(DEPOSIT_REDEEM_ADDRESS, 20).into(), - set_authorities_address: array_bytes::hex2array_unchecked!(SET_AUTHORITIES_ADDRESS, 20).into(), - ring_token_address: array_bytes::hex2array_unchecked!(RING_TOKEN_ADDRESS, 20).into(), - kton_token_address: array_bytes::hex2array_unchecked!(KTON_TOKEN_ADDRESS, 20).into(), - ring_locked: 1 << 56, - kton_locked: 1 << 56, - }), - darwinia_ethereum_relay: Some(EthereumRelayConfig { + }, + darwinia_ethereum_relay: pangolin_runtime::EthereumRelayConfig { genesis_header_info: ( vec![0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33, 29, 204, 77, 232, 222, 199, 93, 122, 171, 133, 181, 103, 182, 204, 212, 26, 211, 18, 69, 27, 148, 138, 116, 19, 240, 161, 66, 253, 64, 212, 147, 71, 128, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 33, 123, 11, 188, 251, 114, 226, 213, 126, 40, 243, 60, 179, 97, 185, 152, 53, 19, 23, 119, 85, 220, 63, 51, 206, 62, 112, 34, 237, 98, 183, 123, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 132, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 136, 0, 0, 0, 0, 0, 0, 0, 66, 1, 65, 148, 16, 35, 104, 9, 35, 224, 254, 77, 116, 163, 75, 218, 200, 20, 31, 37, 64, 227, 174, 144, 98, 55, 24, 228, 125, 102, 209, 202, 74, 45], b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".into() @@ -221,18 +232,31 @@ fn pangolin_build_spec_genesis() -> GenesisConfig { "DAG_MERKLE_ROOTS_PATH", ), ..Default::default() - }), - darwinia_tron_backing: Some(TronBackingConfig { + }, + darwinia_ethereum_backing: pangolin_runtime::EthereumBackingConfig { + token_redeem_address: array_bytes::hex2array_unchecked!(TOKEN_REDEEM_ADDRESS, 20).into(), + deposit_redeem_address: array_bytes::hex2array_unchecked!(DEPOSIT_REDEEM_ADDRESS, 20).into(), + set_authorities_address: array_bytes::hex2array_unchecked!(SET_AUTHORITIES_ADDRESS, 20).into(), + ring_token_address: array_bytes::hex2array_unchecked!(RING_TOKEN_ADDRESS, 20).into(), + kton_token_address: array_bytes::hex2array_unchecked!(KTON_TOKEN_ADDRESS, 20).into(), + ring_locked: 1 << 56, + kton_locked: 1 << 56, + }, + darwinia_relay_authorities_Instance0: pangolin_runtime::EthereumRelayAuthoritiesConfig { + authorities: vec![( + array_bytes::hex2array_unchecked!(ETHEREUM_RELAY_AUTHORITY, 32).into(), + array_bytes::hex2array_unchecked!(ETHEREUM_RELAY_AUTHORITY_SIGNER, 20).into(), + 1 + )] + }, + darwinia_tron_backing: pangolin_runtime::TronBackingConfig { backed_ring: 1 << 56, backed_kton: 1 << 56, - }), - darwinia_evm: Some(EVMConfig { + }, + darwinia_evm: pangolin_runtime::EVMConfig { accounts: evm_accounts, - }), - dvm_ethereum: Some(Default::default()), - darwinia_relay_authorities_Instance0: Some(EthereumRelayAuthoritiesConfig { - authorities: vec![(root, array_bytes::hex2array_unchecked!(GENESIS_ETHEREUM_RELAY_AUTHORITY_SIGNER, 20).into(), 1)] - }), + }, + dvm_ethereum: Default::default(), } } @@ -242,26 +266,6 @@ pub fn pangolin_development_config() -> PangolinChainSpec { "pangolin_dev", ChainType::Development, || { - let initial_evm_account = vec![ - array_bytes::hex2array_unchecked!("0x6be02d1d3665660d22ff9624b7be0551ee1ac91b", 20) - .into(), - array_bytes::hex2array_unchecked!("0xB90168C8CBcd351D069ffFdA7B71cd846924d551", 20) - .into(), - ]; - let mut evm_accounts = BTreeMap::new(); - - for account_id in initial_evm_account.iter() { - evm_accounts.insert( - *account_id, - GenesisAccount { - nonce: 0.into(), - balance: 123_456_789_000_000_000_000_090u128.into(), - storage: BTreeMap::new(), - code: vec![], - }, - ); - } - pangolin_development_genesis( vec![get_authority_keys_from_seed("Alice")], get_account_id_from_seed::("Alice"), @@ -271,7 +275,6 @@ pub fn pangolin_development_config() -> PangolinChainSpec { get_account_id_from_seed::("Alice//stash"), get_account_id_from_seed::("Bob//stash"), ], - evm_accounts, ) }, vec![], @@ -293,96 +296,101 @@ fn pangolin_development_genesis( )>, root_key: AccountId, mut endowed_accounts: Vec, - evm_accounts: BTreeMap, -) -> GenesisConfig { - const GENESIS_ETHEREUM_RELAY_AUTHORITY_SIGNER: &'static str = - "0x6aA70f55E5D770898Dd45aa1b7078b8A80AAbD6C"; - - const TOKEN_REDEEM_ADDRESS: &'static str = "0x49262B932E439271d05634c32978294C7Ea15d0C"; - const DEPOSIT_REDEEM_ADDRESS: &'static str = "0x6EF538314829EfA8386Fc43386cB13B4e0A67D1e"; - const SET_AUTHORITIES_ADDRESS: &'static str = "0xE4A2892599Ad9527D76Ce6E26F93620FA7396D85"; - const RING_TOKEN_ADDRESS: &'static str = "0xb52FBE2B925ab79a821b261C82c5Ba0814AAA5e0"; - const KTON_TOKEN_ADDRESS: &'static str = "0x1994100c58753793D52c6f457f189aa3ce9cEe94"; - +) -> pangolin_runtime::GenesisConfig { initial_authorities.iter().for_each(|x| { if !endowed_accounts.contains(&x.0) { endowed_accounts.push(x.0.clone()) } }); - GenesisConfig { - frame_system: Some(SystemConfig { - code: wasm_binary_unwrap().to_vec(), + let evm_accounts = { + let mut map = BTreeMap::new(); + + for account in EVM_ACCOUNTS.iter() { + map.insert( + array_bytes::hex2array_unchecked!(account, 20).into(), + GenesisAccount { + nonce: 0.into(), + balance: 123_456_789_000_000_000_000_090u128.into(), + storage: BTreeMap::new(), + code: vec![], + }, + ); + } + + map + }; + + pangolin_runtime::GenesisConfig { + frame_system: pangolin_runtime::SystemConfig { + code: pangolin_runtime::wasm_binary_unwrap().to_vec(), changes_trie_config: Default::default(), - }), - pallet_babe: Some(Default::default()), - darwinia_balances_Instance0: Some(RingConfig { + }, + pallet_babe: Default::default(), + darwinia_balances_Instance0: pangolin_runtime::BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, 1 << 56)) .collect(), - }), - darwinia_balances_Instance1: Some(KtonConfig { + }, + darwinia_balances_Instance1: pangolin_runtime::KtonConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, 1 << 56)) .collect(), - }), - darwinia_staking: Some(StakingConfig { + }, + darwinia_staking: pangolin_runtime::StakingConfig { minimum_validator_count: 1, validator_count: 2, stakers: initial_authorities .iter() .cloned() - .map(|x| (x.0, x.1, 1 << 56, StakerStatus::Validator)) + .map(|x| (x.0, x.1, 1 << 56, pangolin_runtime::StakerStatus::Validator)) .collect(), invulnerables: initial_authorities.iter().cloned().map(|x| x.0).collect(), force_era: darwinia_staking::Forcing::ForceAlways, slash_reward_fraction: Perbill::from_percent(10), payout_fraction: Perbill::from_percent(50), ..Default::default() - }), - pallet_session: Some(SessionConfig { + }, + pallet_session: pangolin_runtime::SessionConfig { keys: initial_authorities .iter() .cloned() .map(|x| (x.0.clone(), x.0, pangolin_session_keys(x.2, x.3, x.4, x.5))) .collect(), - }), - pallet_grandpa: Some(Default::default()), - pallet_im_online: Some(Default::default()), - pallet_authority_discovery: Some(Default::default()), - darwinia_democracy: Some(Default::default()), - pallet_collective_Instance0: Some(Default::default()), - pallet_collective_Instance1: Some(Default::default()), - darwinia_elections_phragmen: Some(Default::default()), - pallet_membership_Instance0: Some(Default::default()), - darwinia_claims: Some(ClaimsConfig { + }, + pallet_grandpa: Default::default(), + pallet_im_online: Default::default(), + pallet_authority_discovery: Default::default(), + darwinia_democracy: Default::default(), + pallet_collective_Instance0: pangolin_runtime::CouncilConfig { + phantom: PhantomData::, + members: vec![array_bytes::hex2array_unchecked!(COLLECTIVE_MEMBER, 32).into()] + }, + pallet_collective_Instance1: pangolin_runtime::TechnicalCommitteeConfig { + phantom: PhantomData::, + members: vec![array_bytes::hex2array_unchecked!(COLLECTIVE_MEMBER, 32).into()] + }, + darwinia_elections_phragmen: Default::default(), + pallet_membership_Instance0: Default::default(), + darwinia_claims: pangolin_runtime::ClaimsConfig { claims_list: ClaimsList::from_file( "bin/res/claims-list.json", "CLAIMS_LIST_PATH", ), - }), - darwinia_vesting: Some(Default::default()), - pallet_sudo: Some(SudoConfig { key: root_key.clone() }), - darwinia_crab_issuing: Some(CrabIssuingConfig { + }, + darwinia_vesting: Default::default(), + pallet_sudo: pangolin_runtime::SudoConfig { key: root_key.clone() }, + darwinia_crab_issuing: pangolin_runtime::CrabIssuingConfig { total_mapped_ring: 1 << 56 - }), - darwinia_crab_backing: Some(CrabBackingConfig { + }, + darwinia_crab_backing: pangolin_runtime::CrabBackingConfig { backed_ring: 1 << 56 - }), - darwinia_ethereum_backing: Some(EthereumBackingConfig { - token_redeem_address: array_bytes::hex2array_unchecked!(TOKEN_REDEEM_ADDRESS, 20).into(), - deposit_redeem_address: array_bytes::hex2array_unchecked!(DEPOSIT_REDEEM_ADDRESS, 20).into(), - set_authorities_address: array_bytes::hex2array_unchecked!(SET_AUTHORITIES_ADDRESS, 20).into(), - ring_token_address: array_bytes::hex2array_unchecked!(RING_TOKEN_ADDRESS, 20).into(), - kton_token_address: array_bytes::hex2array_unchecked!(KTON_TOKEN_ADDRESS, 20).into(), - ring_locked: 1 << 56, - kton_locked: 1 << 56, - }), - darwinia_ethereum_relay: Some(EthereumRelayConfig { + }, + darwinia_ethereum_relay: pangolin_runtime::EthereumRelayConfig { genesis_header_info: ( vec![0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33, 29, 204, 77, 232, 222, 199, 93, 122, 171, 133, 181, 103, 182, 204, 212, 26, 211, 18, 69, 27, 148, 138, 116, 19, 240, 161, 66, 253, 64, 212, 147, 71, 128, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 33, 123, 11, 188, 251, 114, 226, 213, 126, 40, 243, 60, 179, 97, 185, 152, 53, 19, 23, 119, 85, 220, 63, 51, 206, 62, 112, 34, 237, 98, 183, 123, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 132, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 136, 0, 0, 0, 0, 0, 0, 0, 66, 1, 65, 148, 16, 35, 104, 9, 35, 224, 254, 77, 116, 163, 75, 218, 200, 20, 31, 37, 64, 227, 174, 144, 98, 55, 24, 228, 125, 102, 209, 202, 74, 45], b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".into() @@ -392,17 +400,30 @@ fn pangolin_development_genesis( "DAG_MERKLE_ROOTS_PATH", ), ..Default::default() - }), - darwinia_tron_backing: Some(TronBackingConfig { + }, + darwinia_ethereum_backing: pangolin_runtime::EthereumBackingConfig { + token_redeem_address: array_bytes::hex2array_unchecked!(TOKEN_REDEEM_ADDRESS, 20).into(), + deposit_redeem_address: array_bytes::hex2array_unchecked!(DEPOSIT_REDEEM_ADDRESS, 20).into(), + set_authorities_address: array_bytes::hex2array_unchecked!(SET_AUTHORITIES_ADDRESS, 20).into(), + ring_token_address: array_bytes::hex2array_unchecked!(RING_TOKEN_ADDRESS, 20).into(), + kton_token_address: array_bytes::hex2array_unchecked!(KTON_TOKEN_ADDRESS, 20).into(), + ring_locked: 1 << 56, + kton_locked: 1 << 56, + }, + darwinia_relay_authorities_Instance0: pangolin_runtime::EthereumRelayAuthoritiesConfig { + authorities: vec![( + array_bytes::hex2array_unchecked!(ETHEREUM_RELAY_AUTHORITY, 32).into(), + array_bytes::hex2array_unchecked!(ETHEREUM_RELAY_AUTHORITY_SIGNER, 20).into(), + 1 + )] + }, + darwinia_tron_backing: pangolin_runtime::TronBackingConfig { backed_ring: 1 << 56, backed_kton: 1 << 56, - }), - darwinia_evm: Some(EVMConfig { + }, + darwinia_evm: pangolin_runtime::EVMConfig { accounts: evm_accounts, - }), - dvm_ethereum: Some(Default::default()), - darwinia_relay_authorities_Instance0: Some(EthereumRelayAuthoritiesConfig { - authorities: vec![(root_key, array_bytes::hex2array_unchecked!(GENESIS_ETHEREUM_RELAY_AUTHORITY_SIGNER, 20).into(), 1)] - }), + }, + dvm_ethereum: Default::default(), } } diff --git a/bin/node/cli/src/cli.rs b/bin/node/cli/src/cli.rs index b2fd8cc490..fdc7ba2629 100644 --- a/bin/node/cli/src/cli.rs +++ b/bin/node/cli/src/cli.rs @@ -98,4 +98,9 @@ pub enum Subcommand { /// Sign a message, with a given (secret) key. Sign(SignCmd), + + /// Try some experimental command on the runtime. This includes migration and runtime-upgrade + /// testing. + #[cfg(feature = "try-runtime")] + TryRuntime(try_runtime_cli::TryRuntimeCmd), } diff --git a/bin/node/cli/src/command.rs b/bin/node/cli/src/command.rs index 86ef0aae8f..c7172c47cc 100644 --- a/bin/node/cli/src/command.rs +++ b/bin/node/cli/src/command.rs @@ -191,5 +191,19 @@ pub fn run() -> sc_cli::Result<()> { Some(Subcommand::Sign(cmd)) => cmd.run(), Some(Subcommand::Verify(cmd)) => cmd.run(), Some(Subcommand::Vanity(cmd)) => cmd.run(), + #[cfg(feature = "try-runtime")] + Some(Subcommand::TryRuntime(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + // we don't need any of the components of new_partial, just a runtime, or a task + // manager to do `async_run`. + let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry); + let task_manager = + sc_service::TaskManager::new(config.task_executor.clone(), registry) + .map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?; + + Ok((cmd.run::(config), task_manager)) + }) + } } } diff --git a/bin/node/cli/src/rpc.rs b/bin/node/cli/src/rpc.rs index 41777b44bb..0b09b69792 100644 --- a/bin/node/cli/src/rpc.rs +++ b/bin/node/cli/src/rpc.rs @@ -132,7 +132,7 @@ where C::Api: darwinia_header_mmr_rpc::HeaderMMRRuntimeApi, C::Api: darwinia_staking_rpc::StakingRuntimeApi, C::Api: dvm_rpc_runtime_api::EthereumRuntimeRPCApi, - ::Error: std::fmt::Debug, + // ::Error: std::fmt::Debug, P: 'static + Sync + Send + sp_transaction_pool::TransactionPool, SC: 'static + sp_consensus::SelectChain, B: 'static + Send + Sync + sc_client_api::Backend, diff --git a/bin/node/cli/src/service.rs b/bin/node/cli/src/service.rs index dc551bc476..ae975e5bc6 100644 --- a/bin/node/cli/src/service.rs +++ b/bin/node/cli/src/service.rs @@ -93,7 +93,7 @@ native_executor_instance!( /// A set of APIs that darwinia-like runtimes must implement. pub trait RuntimeApiCollection: - sp_api::ApiExt + sp_api::ApiExt + sp_api::Metadata + sp_authority_discovery::AuthorityDiscoveryApi + sp_block_builder::BlockBuilder @@ -115,7 +115,7 @@ where impl RuntimeApiCollection for Api where Api: sp_transaction_pool::runtime_api::TaggedTransactionQueue - + sp_api::ApiExt + + sp_api::ApiExt + sp_api::Metadata + sp_authority_discovery::AuthorityDiscoveryApi + sp_block_builder::BlockBuilder @@ -140,7 +140,7 @@ pub trait DRMLClient: + Send + Sync + sc_client_api::BlockchainEvents - + sp_api::CallApiAt + + sp_api::CallApiAt + sp_api::ProvideRuntimeApi + sp_blockchain::HeaderBackend where @@ -156,7 +156,7 @@ where Client: Sized + Send + Sync - + sp_api::CallApiAt + + sp_api::CallApiAt + sp_api::ProvideRuntimeApi + sp_blockchain::HeaderBackend + sc_client_api::BlockchainEvents, @@ -222,7 +222,6 @@ fn new_partial( BabeLink, ), GrandpaSharedVoterState, - Option, PendingTransactions, Arc>, Option, @@ -246,7 +245,7 @@ where set_prometheus_registry(config)?; let inherent_data_providers = InherentDataProviders::new(); - let (client, backend, keystore_container, task_manager, telemetry_span) = + let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::(&config)?; let client = Arc::new(client); let select_chain = LongestChain::new(backend.clone()); @@ -284,7 +283,7 @@ where client.clone(), select_chain.clone(), inherent_data_providers.clone(), - &task_manager.spawn_handle(), + &task_manager.spawn_essential_handle(), config.prometheus_registry(), CanAuthorWithNativeVersion::new(client.executor().clone()), )?; @@ -355,7 +354,6 @@ where rpc_extensions_builder, import_setup, rpc_setup, - telemetry_span, pending_transactions, frontier_backend, filter_pool, @@ -410,7 +408,6 @@ where rpc_extensions_builder, import_setup, rpc_setup, - telemetry_span, pending_transactions, frontier_backend, filter_pool, @@ -443,6 +440,7 @@ where &config, task_manager.spawn_handle(), backend.clone(), + import_setup.1.shared_authority_set().clone(), ), ); @@ -467,6 +465,8 @@ where ); } + let telemetry_span = TelemetrySpan::new(); + let _telemetry_span_entered = telemetry_span.enter(); let (rpc_handlers, telemetry_connection_notifier) = sc_service::spawn_tasks(SpawnTasksParams { config, @@ -494,9 +494,9 @@ where task_manager: &mut task_manager, on_demand: None, remote_blockchain: None, - telemetry_span, network_status_sinks, system_rpc_tx, + telemetry_span: Some(telemetry_span.clone()), })?; let (block_import, link_half, babe_link) = import_setup; @@ -541,7 +541,7 @@ where name: Some(name), observer_enabled: false, keystore, - is_authority: role.is_network_authority(), + is_authority: role.is_authority(), }; let enable_grandpa = !disable_grandpa; @@ -649,7 +649,7 @@ where { set_prometheus_registry(&mut config)?; - let (client, backend, keystore_container, mut task_manager, on_demand, telemetry_span) = + let (client, backend, keystore_container, mut task_manager, on_demand) = sc_service::new_light_parts::(&config)?; config @@ -685,7 +685,7 @@ where client.clone(), select_chain.clone(), inherent_data_providers.clone(), - &task_manager.spawn_handle(), + &task_manager.spawn_essential_handle(), config.prometheus_registry(), NeverCanAuthor, )?; @@ -717,7 +717,8 @@ where pool: transaction_pool.clone(), }; let rpc_extension = rpc::create_light(light_deps); - + let telemetry_span = TelemetrySpan::new(); + let _telemetry_span_entered = telemetry_span.enter(); let (rpc_handlers, telemetry_connection_notifier) = sc_service::spawn_tasks(SpawnTasksParams { on_demand: Some(on_demand), @@ -732,7 +733,7 @@ where network, network_status_sinks, system_rpc_tx, - telemetry_span, + telemetry_span: Some(telemetry_span.clone()), })?; network_starter.start_network(); diff --git a/bin/node/primitives/Cargo.toml b/bin/node/primitives/Cargo.toml index efabacaacc..90e717009e 100644 --- a/bin/node/primitives/Cargo.toml +++ b/bin/node/primitives/Cargo.toml @@ -11,8 +11,8 @@ version = "2.0.0" [dependencies] # substrate -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/bin/node/runtime/pangolin/Cargo.toml b/bin/node/runtime/pangolin/Cargo.toml index f4655dc2e5..eb4a82e74d 100644 --- a/bin/node/runtime/pangolin/Cargo.toml +++ b/bin/node/runtime/pangolin/Cargo.toml @@ -11,7 +11,8 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +log = { version = "0.4.14" } serde = { version = "1.0.124", optional = true } smallvec = { version = "1.6.1" } static_assertions = { version = "1.1.0" } @@ -43,54 +44,57 @@ dvm-ethereum = { default-features = false, path = "../../ dvm-rpc-runtime-api = { default-features = false, path = "../../../../frame/dvm/rpc/runtime-api" } ethereum-primitives = { default-features = false, path = "../../../../primitives/ethereum-primitives" } # substrate -frame-executive = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-authority-discovery = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-authorship = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-babe = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-collective = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-grandpa = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-identity = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-im-online = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-membership = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-multisig = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-offences = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-proxy = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-recovery = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-scheduler = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-session = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-society = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-sudo = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-timestamp = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-transaction-payment = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-utility = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-application-crypto = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-authority-discovery = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-block-builder = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-consensus-babe = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-inherents = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-offchain = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-session = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-staking = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-transaction-pool = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-version = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-executive = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-try-runtime = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-authority-discovery = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-authorship = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-babe = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-collective = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-election-provider-multi-phase = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-grandpa = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-identity = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-im-online = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-membership = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-multisig = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-offences = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-proxy = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-recovery = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-scheduler = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-session = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-society = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-sudo = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-timestamp = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-transaction-payment = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-utility = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-application-crypto = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-authority-discovery = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-block-builder = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-consensus-babe = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-inherents = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-offchain = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-session = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-staking = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-transaction-pool = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-version = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [build-dependencies] # substrate -substrate-wasm-builder = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +substrate-wasm-builder = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] -std = [ + +std = [ "codec/std", "serde", "darwinia-balances/std", @@ -127,6 +131,7 @@ std = [ "pallet-authorship/std", "pallet-babe/std", "pallet-collective/std", + "pallet-election-provider-multi-phase/std", "pallet-grandpa/std", "pallet-identity/std", "pallet-im-online/std", @@ -161,4 +166,8 @@ std = [ "sp-version/std", ] +try-runtime = [ + "frame-executive/try-runtime", + "frame-try-runtime", +] with-tracing = ["frame-executive/with-tracing"] diff --git a/bin/node/runtime/pangolin/src/babe.rs b/bin/node/runtime/pangolin/src/babe.rs index 3788b74374..07ccf752c9 100644 --- a/bin/node/runtime/pangolin/src/babe.rs +++ b/bin/node/runtime/pangolin/src/babe.rs @@ -8,6 +8,8 @@ use crate::*; frame_support::parameter_types! { pub const EpochDuration: u64 = BLOCKS_PER_SESSION as _; pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; + pub const ReportLongevity: u64 = + BondingDurationInEra::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get(); } impl Config for Runtime { type EpochDuration = EpochDuration; @@ -20,6 +22,7 @@ impl Config for Runtime { KeyTypeId, AuthorityId, )>>::IdentificationTuple; - type HandleEquivocation = EquivocationHandler; + type HandleEquivocation = + EquivocationHandler; type WeightInfo = (); } diff --git a/bin/node/runtime/pangolin/src/democracy.rs b/bin/node/runtime/pangolin/src/democracy.rs index dc438aae5f..659e21fe2a 100644 --- a/bin/node/runtime/pangolin/src/democracy.rs +++ b/bin/node/runtime/pangolin/src/democracy.rs @@ -50,7 +50,7 @@ impl Config for Runtime { >; type BlacklistOrigin = EnsureRoot; // Any single technical committee member may veto a coming council proposal, however they can - // only do it once and it lasts only for the cooloff period. + // only do it once and it lasts only for the cool-off period. type VetoOrigin = EnsureMember; type CooloffPeriod = CooloffPeriod; type PreimageByteDeposit = PreimageByteDeposit; diff --git a/bin/node/runtime/pangolin/src/election_provider_multi_phase.rs b/bin/node/runtime/pangolin/src/election_provider_multi_phase.rs new file mode 100644 index 0000000000..4111819696 --- /dev/null +++ b/bin/node/runtime/pangolin/src/election_provider_multi_phase.rs @@ -0,0 +1,44 @@ +// --- substrate --- +use frame_support::weights::{constants::BlockExecutionWeight, DispatchClass, Weight}; +use pallet_election_provider_multi_phase::{weights::SubstrateWeight, Config}; +use sp_runtime::transaction_validity::TransactionPriority; +// --- darwinia --- +use crate::*; +use darwinia_staking::CompactAssignments; + +frame_support::parameter_types! { + // phase durations. 1/4 of the last session for each. + pub const SignedPhase: u32 = BLOCKS_PER_SESSION / 4; + pub const UnsignedPhase: u32 = BLOCKS_PER_SESSION / 4; + + // fallback: no need to do on-chain phragmen initially. + pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy = + pallet_election_provider_multi_phase::FallbackStrategy::Nothing; + + pub SolutionImprovementThreshold: Perbill = Perbill::from_rational_approximation(1u32, 10_000); + + // miner configs + pub const MultiPhaseUnsignedPriority: TransactionPriority = StakingUnsignedPriority::get() - 1u64; + pub const MinerMaxIterations: u32 = 10; + pub MinerMaxWeight: Weight = RuntimeBlockWeights::get() + .get(DispatchClass::Normal) + .max_extrinsic.expect("Normal extrinsics have a weight limit configured; qed") + .saturating_sub(BlockExecutionWeight::get()); +} + +impl Config for Runtime { + type Event = Event; + type Currency = Balances; + type SignedPhase = SignedPhase; + type UnsignedPhase = UnsignedPhase; + type SolutionImprovementThreshold = MinSolutionScoreBump; + type MinerMaxIterations = MinerMaxIterations; + type MinerMaxWeight = MinerMaxWeight; + type MinerTxPriority = MultiPhaseUnsignedPriority; + type DataProvider = Staking; + type OnChainAccuracy = Perbill; + type CompactSolution = CompactAssignments; + type Fallback = Fallback; + type WeightInfo = SubstrateWeight; + type BenchmarkingConfig = (); +} diff --git a/bin/node/runtime/pangolin/src/grandpa.rs b/bin/node/runtime/pangolin/src/grandpa.rs index ea085947e6..8ee80331d6 100644 --- a/bin/node/runtime/pangolin/src/grandpa.rs +++ b/bin/node/runtime/pangolin/src/grandpa.rs @@ -15,6 +15,7 @@ impl Config for Runtime { AuthorityId, )>>::IdentificationTuple; type KeyOwnerProofSystem = Historical; - type HandleEquivocation = EquivocationHandler; + type HandleEquivocation = + EquivocationHandler; type WeightInfo = (); } diff --git a/bin/node/runtime/pangolin/src/im_online.rs b/bin/node/runtime/pangolin/src/im_online.rs index 17ade2c5dc..72202983de 100644 --- a/bin/node/runtime/pangolin/src/im_online.rs +++ b/bin/node/runtime/pangolin/src/im_online.rs @@ -11,6 +11,7 @@ frame_support::parameter_types! { impl Config for Runtime { type AuthorityId = AuthorityId; type Event = Event; + type ValidatorSet = Historical; type SessionDuration = SessionDuration; type ReportUnresponsiveness = Offences; type UnsignedPriority = ImOnlineUnsignedPriority; diff --git a/bin/node/runtime/pangolin/src/lib.rs b/bin/node/runtime/pangolin/src/lib.rs index d953b8c070..c4491e9e53 100644 --- a/bin/node/runtime/pangolin/src/lib.rs +++ b/bin/node/runtime/pangolin/src/lib.rs @@ -222,6 +222,9 @@ pub use transaction_payment::*; pub mod authorship; pub use authorship::*; +pub mod election_provider_multi_phase; +pub use election_provider_multi_phase::*; + pub mod staking; pub use staking::*; @@ -243,6 +246,9 @@ pub use im_online::*; pub mod authority_discovery; pub use authority_discovery::*; +pub mod header_mmr; +pub use header_mmr::*; + pub mod democracy; pub use democracy::*; @@ -288,9 +294,6 @@ pub use proxy::*; pub mod multisig; pub use multisig::*; -pub mod header_mmr; -pub use header_mmr::*; - pub mod crab_issuing; pub use crab_issuing::*; @@ -320,17 +323,13 @@ pub use dvm::*; // --- darwinia --- pub use constants::*; -use darwinia_evm::{Account as EVMAccount, FeeCalculator}; pub use darwinia_staking::StakerStatus; -pub use drml_primitives::*; -pub use impls::*; pub use wasm::*; // --- crates --- use codec::{Decode, Encode}; // --- substrate --- use frame_support::{ - debug, traits::{KeyOwnerProofSystem, Randomness}, weights::constants::ExtrinsicBaseWeight, }; @@ -354,10 +353,12 @@ use sp_version::NativeVersion; use sp_version::RuntimeVersion; // --- darwinia --- use darwinia_balances_rpc_runtime_api::RuntimeDispatchInfo as BalancesRuntimeDispatchInfo; -use darwinia_evm::Runner; +use darwinia_evm::{Account as EVMAccount, FeeCalculator, Runner}; use darwinia_header_mmr_rpc_runtime_api::RuntimeDispatchInfo as HeaderMMRRuntimeDispatchInfo; use darwinia_staking_rpc_runtime_api::RuntimeDispatchInfo as StakingRuntimeDispatchInfo; +use drml_primitives::*; use dvm_rpc_runtime_api::TransactionStatus; +use impls::*; /// The address format for describing accounts. type Address = MultiAddress; @@ -383,6 +384,7 @@ type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllModules, + // (), // CustomOnRuntimeUpgrade, >; /// The payload being signed in transactions. @@ -422,7 +424,7 @@ frame_support::construct_runtime! { RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage} = 1, // Must be before session. - Babe: pallet_babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned} = 2, + Babe: pallet_babe::{Module, Call, Storage, Config, ValidateUnsigned} = 2, Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent} = 3, Balances: darwinia_balances::::{Module, Call, Storage, Config, Event} = 4, @@ -431,65 +433,65 @@ frame_support::construct_runtime! { // Consensus support. Authorship: pallet_authorship::{Module, Call, Storage, Inherent} = 7, - Staking: darwinia_staking::{Module, Call, Storage, Config, Event, ValidateUnsigned} = 8, - Offences: pallet_offences::{Module, Call, Storage, Event} = 9, - Historical: pallet_session_historical::{Module} = 10, - Session: pallet_session::{Module, Call, Storage, Config, Event} = 11, - Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned} = 12, - ImOnline: pallet_im_online::{Module, Call, Storage, Config, Event, ValidateUnsigned} = 13, - AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config} = 14, + ElectionProviderMultiPhase: pallet_election_provider_multi_phase::{Module, Call, Storage, Event, ValidateUnsigned} = 8, + Staking: darwinia_staking::{Module, Call, Storage, Config, Event, ValidateUnsigned} = 9, + Offences: pallet_offences::{Module, Call, Storage, Event} = 10, + Historical: pallet_session_historical::{Module} = 11, + Session: pallet_session::{Module, Call, Storage, Config, Event} = 12, + Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned} = 13, + ImOnline: pallet_im_online::{Module, Call, Storage, Config, Event, ValidateUnsigned} = 14, + AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config} = 15, + HeaderMMR: darwinia_header_mmr::{Module, Call, Storage} = 16, // Governance stuff; uncallable initially. - Democracy: darwinia_democracy::{Module, Call, Storage, Config, Event} = 15, - Council: pallet_collective::::{Module, Call, Storage, Origin, Config, Event} = 16, - TechnicalCommittee: pallet_collective::::{Module, Call, Storage, Origin, Config, Event} = 17, - ElectionsPhragmen: darwinia_elections_phragmen::{Module, Call, Storage, Config, Event} = 18, - TechnicalMembership: pallet_membership::::{Module, Call, Storage, Config, Event} = 19, - Treasury: darwinia_treasury::{Module, Call, Storage, Event} = 20, + Democracy: darwinia_democracy::{Module, Call, Storage, Config, Event} = 17, + Council: pallet_collective::::{Module, Call, Storage, Origin, Config, Event} = 18, + TechnicalCommittee: pallet_collective::::{Module, Call, Storage, Origin, Config, Event} = 19, + ElectionsPhragmen: darwinia_elections_phragmen::{Module, Call, Storage, Config, Event} = 20, + TechnicalMembership: pallet_membership::::{Module, Call, Storage, Config, Event} = 21, + Treasury: darwinia_treasury::{Module, Call, Storage, Event} = 22, - Sudo: pallet_sudo::{Module, Call, Storage, Config, Event} = 21, + Sudo: pallet_sudo::{Module, Call, Storage, Config, Event} = 23, // Claims. Usable initially. - Claims: darwinia_claims::{Module, Call, Storage, Config, Event, ValidateUnsigned} = 22, + Claims: darwinia_claims::{Module, Call, Storage, Config, Event, ValidateUnsigned} = 24, // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: darwinia_vesting::{Module, Call, Storage, Event, Config} = 23, + Vesting: darwinia_vesting::{Module, Call, Storage, Event, Config} = 25, // Utility module. - Utility: pallet_utility::{Module, Call, Event} = 24, + Utility: pallet_utility::{Module, Call, Event} = 26, // Less simple identity module. - Identity: pallet_identity::{Module, Call, Storage, Event} = 25, + Identity: pallet_identity::{Module, Call, Storage, Event} = 27, // Society module. - Society: pallet_society::{Module, Call, Storage, Event} = 26, + Society: pallet_society::{Module, Call, Storage, Event} = 28, // Social recovery module. - Recovery: pallet_recovery::{Module, Call, Storage, Event} = 27, + Recovery: pallet_recovery::{Module, Call, Storage, Event} = 29, // System scheduler. - Scheduler: pallet_scheduler::{Module, Call, Storage, Event} = 28, + Scheduler: pallet_scheduler::{Module, Call, Storage, Event} = 30, // Proxy module. Late addition. - Proxy: pallet_proxy::{Module, Call, Storage, Event} = 29, + Proxy: pallet_proxy::{Module, Call, Storage, Event} = 31, // Multisig module. Late addition. - Multisig: pallet_multisig::{Module, Call, Storage, Event} = 30, - - HeaderMMR: darwinia_header_mmr::{Module, Call, Storage} = 31, + Multisig: pallet_multisig::{Module, Call, Storage, Event} = 32, - CrabIssuing: darwinia_crab_issuing::{Module, Call, Storage, Config, Event} = 32, - CrabBacking: darwinia_crab_backing::{Module, Storage, Config} = 33, + CrabIssuing: darwinia_crab_issuing::{Module, Call, Storage, Config, Event} = 33, + CrabBacking: darwinia_crab_backing::{Module, Storage, Config} = 34, - EthereumRelay: darwinia_ethereum_relay::{Module, Call, Storage, Config, Event} = 34, - EthereumBacking: darwinia_ethereum_backing::{Module, Call, Storage, Config, Event} = 35, - EthereumRelayerGame: darwinia_relayer_game::::{Module, Storage} = 36, - EthereumRelayAuthorities: darwinia_relay_authorities::::{Module, Call, Storage, Config, Event} = 37, + EthereumRelay: darwinia_ethereum_relay::{Module, Call, Storage, Config, Event} = 35, + EthereumBacking: darwinia_ethereum_backing::{Module, Call, Storage, Config, Event} = 36, + EthereumRelayerGame: darwinia_relayer_game::::{Module, Storage} = 37, + EthereumRelayAuthorities: darwinia_relay_authorities::::{Module, Call, Storage, Config, Event} = 38, - TronBacking: darwinia_tron_backing::{Module, Storage, Config} = 38, + TronBacking: darwinia_tron_backing::{Module, Storage, Config} = 39, - EVM: darwinia_evm::{Module, Call, Storage, Config, Event} = 39, - Ethereum: dvm_ethereum::{Module, Call, Storage, Config, Event, ValidateUnsigned} = 40, + EVM: darwinia_evm::{Module, Call, Storage, Config, Event} = 40, + Ethereum: dvm_ethereum::{Module, Call, Storage, Config, Event, ValidateUnsigned} = 41, } } @@ -529,7 +531,7 @@ where ); let raw_payload = SignedPayload::new(call, extra) .map_err(|e| { - debug::warn!("Unable to create signed payload: {:?}", e); + log::warn!("Unable to create signed payload: {:?}", e); }) .ok()?; let signature = raw_payload.using_encoded(|payload| C::sign(payload, public))?; @@ -557,7 +559,7 @@ impl_runtime_apis! { } fn execute_block(block: Block) { - Executive::execute_block(block) + Executive::execute_block(block); } fn initialize_block(header: &::Header) { @@ -660,7 +662,7 @@ impl_runtime_apis! { } } - fn current_epoch_start() -> sp_consensus_babe::SlotNumber { + fn current_epoch_start() -> sp_consensus_babe::Slot { Babe::current_epoch_start() } @@ -673,7 +675,7 @@ impl_runtime_apis! { } fn generate_key_ownership_proof( - _slot_number: sp_consensus_babe::SlotNumber, + _slot: sp_consensus_babe::Slot, authority_id: sp_consensus_babe::AuthorityId, ) -> Option { Historical::prove((sp_consensus_babe::KEY_TYPE, authority_id)) @@ -868,6 +870,14 @@ impl_runtime_apis! { ) } } + + #[cfg(feature = "try-runtime")] + impl frame_try_runtime::TryRuntime for Runtime { + fn on_runtime_upgrade() -> Result<(Weight, Weight), sp_runtime::RuntimeString> { + let weight = Executive::try_runtime_upgrade()?; + Ok((weight, RuntimeBlockWeights::get().max_block)) + } + } } pub struct TransactionConverter; diff --git a/bin/node/runtime/pangolin/src/staking.rs b/bin/node/runtime/pangolin/src/staking.rs index 74039053e4..89f9035790 100644 --- a/bin/node/runtime/pangolin/src/staking.rs +++ b/bin/node/runtime/pangolin/src/staking.rs @@ -46,6 +46,7 @@ impl Config for Runtime { // The unsigned solution weight targeted by the OCW. We set it to the maximum possible value of // a single extrinsic. type OffchainSolutionWeightLimit = OffchainSolutionWeightLimit; + type ElectionProvider = ElectionProviderMultiPhase; type RingCurrency = Ring; type RingRewardRemainder = Treasury; // send the slashed funds to the treasury. diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index ff2bd06ea6..7b352241d1 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -14,7 +14,7 @@ version = "2.0.0" serde = { version = "1.0.124", features = ["derive"] } toml = { version = "0.5.7" } # substrate -sc-cli = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-service = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-tracing = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sc-cli = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-service = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-tracing = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index d11e0208c7..3b7ed1c22a 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -42,22 +42,6 @@ pub struct Configuration { /// availability of local keys). validator: Option, - /// Enable sentry mode. - /// - /// The node will be started with the authority role and participate in - /// consensus tasks as an "observer", it will never actively participate - /// regardless of whether it could (e.g. keys are available locally). This - /// mode is useful as a secure proxy for validators (which would run - /// detached from the network), since we want this node to participate in - /// the full consensus protocols in order to have all needed consensus data - /// available to relay to private nodes. - // #[structopt( - // long = "sentry", - // conflicts_with_all = &[ "validator", "light" ], - // parse(try_from_str) - // )] - sentry: Option>, - /// Disable GRANDPA voter when running in validator mode, otherwise disable the GRANDPA observer. no_grandpa: Option, @@ -214,17 +198,6 @@ pub struct Configuration { /// The default value is 8 and the values higher than 256 are ignored. max_runtime_instances: Option, - /// Specify a list of sentry node public addresses. - /// - /// Can't be used with --public-addr as the sentry node would take precedence over the public address - /// specified there. - // #[structopt( - // long = "sentry-nodes", - // value_name = "ADDR", - // conflicts_with_all = &[ "sentry", "public-addr" ] - // )] - sentry_nodes: Option>, - /// Run a temporary node. /// /// A temporary directory will be created to store the configuration and will be deleted @@ -279,7 +252,6 @@ impl Configuration { let cmd = cli.mut_base(); quick_if_let!(cmd, self, validator); - quick_if_let!(cmd, self, sentry); quick_if_let!(cmd, self, no_grandpa); quick_if_let!(cmd, self, light); quick_if_let!(cmd, self, rpc_external); @@ -378,7 +350,6 @@ impl Configuration { ); quick_if_let!(cmd, self, Some(max_runtime_instances)); - quick_if_let!(cmd, self, sentry_nodes); quick_if_let!(cmd, self, tmp); } diff --git a/client/dvm/consensus/Cargo.toml b/client/dvm/consensus/Cargo.toml index a65cd1b980..ea83ae1b0b 100644 --- a/client/dvm/consensus/Cargo.toml +++ b/client/dvm/consensus/Cargo.toml @@ -11,22 +11,22 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.1", features = ["derive"] } dc-db = { path = "../db" } derive_more = { version = "0.99.11" } futures = { version = "0.3.13", features = ["compat"] } log = { version = "0.4.14" } # darwinia -dp_consensus = { path = "../../../primitives/consensus/" } -dvm-rpc-runtime-api = { path = "../../../frame/dvm/rpc/runtime-api"} +dp_consensus = { path = "../../../primitives/consensus/" } +dvm-rpc-runtime-api = { path = "../../../frame/dvm/rpc/runtime-api" } # substrate -prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-block-builder = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-consensus = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-inherents = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-timestamp = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-block-builder = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-consensus = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-inherents = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-timestamp = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } diff --git a/client/dvm/consensus/src/lib.rs b/client/dvm/consensus/src/lib.rs index edece2cdf0..051bf34f12 100644 --- a/client/dvm/consensus/src/lib.rs +++ b/client/dvm/consensus/src/lib.rs @@ -89,7 +89,7 @@ where I::Error: Into, C: ProvideRuntimeApi + Send + Sync + HeaderBackend + AuxStore + ProvideCache + BlockOf, C::Api: EthereumRuntimeRPCApi, - C::Api: BlockBuilderApi, + C::Api: BlockBuilderApi, { pub fn new(inner: I, client: Arc, backend: Arc>) -> Self { Self { @@ -108,7 +108,7 @@ where I::Error: Into, C: ProvideRuntimeApi + Send + Sync + HeaderBackend + AuxStore + ProvideCache + BlockOf, C::Api: EthereumRuntimeRPCApi, - C::Api: BlockBuilderApi, + C::Api: BlockBuilderApi, { type Error = ConsensusError; type Transaction = sp_api::TransactionFor; diff --git a/client/dvm/db/Cargo.toml b/client/dvm/db/Cargo.toml index 88dc63fe91..fef5cc2a5d 100644 --- a/client/dvm/db/Cargo.toml +++ b/client/dvm/db/Cargo.toml @@ -11,11 +11,11 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", features = ["derive"] } -kvdb = "0.8.0" -kvdb-rocksdb = "0.10.0" -parking_lot = "0.11.1" +codec = { package = "parity-scale-codec", version = "2.0.1", features = ["derive"] } +kvdb = { version = "0.9.0" } +kvdb-rocksdb = { version = "0.11.0" } +parking_lot = { version = "0.11.1" } # substrate -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-database = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-database = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } diff --git a/client/dvm/mapping-sync/Cargo.toml b/client/dvm/mapping-sync/Cargo.toml index dc0f60b158..941e4a3c5f 100644 --- a/client/dvm/mapping-sync/Cargo.toml +++ b/client/dvm/mapping-sync/Cargo.toml @@ -11,10 +11,10 @@ version = "2.0.0" [dependencies] # substrate -sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } # darwinia dc-consensus = { path = "../consensus" } dc-db = { path = "../db" } @@ -23,4 +23,4 @@ dvm-rpc-runtime-api = { path = "../../../frame/dvm/rpc/runtime-api"} # crates futures = { version = "0.3.1", features = ["compat"] } futures-timer = "3.0.1" -log = "0.4.8" \ No newline at end of file +log = "0.4.8" diff --git a/client/dvm/rpc/Cargo.toml b/client/dvm/rpc/Cargo.toml index b412451351..2aec01253b 100644 --- a/client/dvm/rpc/Cargo.toml +++ b/client/dvm/rpc/Cargo.toml @@ -12,9 +12,9 @@ version = "2.0.0" [dependencies] # crates array-bytes = { version = "1.1.0" } -codec = { package = "parity-scale-codec", version = "1.3.7" } -ethereum = { version = "0.6.0", features = ["with-codec"] } -ethereum-types = { version = "0.10.0" } +codec = { package = "parity-scale-codec", version = "2.0.1" } +ethereum = { version = "0.7.1", features = ["with-codec"] } +ethereum-types = { version = "0.11.0" } futures = { version = "0.3.13", features = ["compat"] } jsonrpc-core = { version = "15.1.0" } jsonrpc-core-client = { version = "15.1.0" } @@ -29,23 +29,23 @@ sha3 = { version = "0.8" } darwinia-evm = { path = "../../../frame/evm" } dc-consensus = { path = "../consensus" } dc-db = { path = "../db" } -dp_consensus = { path = "../../../primitives/consensus/" } +dp-rpc = { path = "../../../primitives/rpc" } dp-storage = { path = "../../../primitives/storage/" } +dp_consensus = { path = "../../../primitives/consensus/" } dvm-ethereum = { path = "../../../frame/dvm" } dvm-rpc-core = { path = "../../../frame/dvm/rpc" } dvm-rpc-runtime-api = { path = "../../../frame/dvm/rpc/runtime-api" } -dp-rpc = { path = "../../../primitives/rpc" } # substrate -sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-network = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sc-service = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-storage = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-network = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sc-service = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-storage = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] rpc_binary_search_estimate = [] diff --git a/frame/balances/Cargo.toml b/frame/balances/Cargo.toml index 96e07a1a4f..32a875305c 100644 --- a/frame/balances/Cargo.toml +++ b/frame/balances/Cargo.toml @@ -11,22 +11,23 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +log = { version = "0.4.14" } serde = { version = "1.0.124", optional = true } # darwinia darwinia-balances-rpc-runtime-api = { default-features = false, path = "./rpc/runtime-api" } darwinia-support = { default-features = false, path = "../support" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # substrate -pallet-transaction-payment = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +pallet-transaction-payment = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/balances/rpc/Cargo.toml b/frame/balances/rpc/Cargo.toml index 3d5e6288b3..e79f209976 100644 --- a/frame/balances/rpc/Cargo.toml +++ b/frame/balances/rpc/Cargo.toml @@ -11,13 +11,13 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7" } +codec = { package = "parity-scale-codec", version = "2.0.1" } jsonrpc-core = { version = "15.1.0" } jsonrpc-core-client = { version = "15.1.0" } jsonrpc-derive = { version = "15.1.0" } # darwinia darwinia-balances-rpc-runtime-api = { path = "./runtime-api" } # substrate -sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } diff --git a/frame/balances/rpc/runtime-api/Cargo.toml b/frame/balances/rpc/runtime-api/Cargo.toml index d47627c6b8..6044e55ca7 100644 --- a/frame/balances/rpc/runtime-api/Cargo.toml +++ b/frame/balances/rpc/runtime-api/Cargo.toml @@ -11,13 +11,13 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } serde = { version = "1.0.124", optional = true, features = ["derive"] } # darwinia darwinia-support = { default-features = false, path = "../../../support" } # substrate -sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/balances/src/lib.rs b/frame/balances/src/lib.rs index 779991ed89..a91c0242f8 100644 --- a/frame/balances/src/lib.rs +++ b/frame/balances/src/lib.rs @@ -645,7 +645,8 @@ impl, I: Instance> Module { /// Update the account entry for `who`, given the locks. fn update_locks(who: &T::AccountId, locks: &[BalanceLock]) { if locks.len() as u32 > T::MaxLocks::get() { - frame_support::debug::warn!( + log::warn!( + target: "runtime::balances", "Warning: A user has more currency locks than expected. \ A runtime configuration adjustment may be needed." ); @@ -666,7 +667,8 @@ impl, I: Instance> Module { // No providers for the locks. This is impossible under normal circumstances // since the funds that are under the lock will themselves be stored in the // account and therefore will need a reference. - frame_support::debug::warn!( + log::warn!( + target: "runtime::balances", "Warning: Attempt to introduce lock consumer reference, yet no providers. \ This is unexpected but should be safe." ); @@ -1539,7 +1541,7 @@ impl, I: Instance> DustCollector for Module { if !dropped.is_zero() { T::DustRemoval::on_unbalanced(NegativeImbalance::new(dropped)); if let Err(e) = >::dec_providers(who) { - frame_support::debug::print!("Logic error: Unexpected {:?}", e); + log::error!("Logic error: Unexpected {:?}", e); } Self::deposit_event(RawEvent::DustLost(who.clone(), dropped)); } diff --git a/frame/balances/src/tests_local.rs b/frame/balances/src/tests_local.rs index d5ef56604a..c51221f9f3 100644 --- a/frame/balances/src/tests_local.rs +++ b/frame/balances/src/tests_local.rs @@ -37,11 +37,11 @@ use sp_runtime::{ // --- darwinia --- use crate::{self as darwinia_balances, *}; -type Balance = u64; - type Block = MockBlock; type UncheckedExtrinsic = MockUncheckedExtrinsic; +type Balance = u64; + darwinia_support::impl_test_account_data! {} parameter_types! { diff --git a/frame/balances/src/weights.rs b/frame/balances/src/weights.rs index 15aa6b800e..caea924fc3 100644 --- a/frame/balances/src/weights.rs +++ b/frame/balances/src/weights.rs @@ -1,7 +1,7 @@ //! Autogenerated weights for pallet_balances //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0 -//! DATE: 2021-01-06, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! DATE: 2021-01-06, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: diff --git a/frame/bridge/crab/backing/Cargo.toml b/frame/bridge/crab/backing/Cargo.toml index 4e817159bf..80bfe17593 100644 --- a/frame/bridge/crab/backing/Cargo.toml +++ b/frame/bridge/crab/backing/Cargo.toml @@ -11,12 +11,12 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } serde = { version = "1.0.124", optional = true } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/bridge/crab/issuing/Cargo.toml b/frame/bridge/crab/issuing/Cargo.toml index 4bb7fea1a9..c1aee6d1a8 100644 --- a/frame/bridge/crab/issuing/Cargo.toml +++ b/frame/bridge/crab/issuing/Cargo.toml @@ -11,19 +11,19 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } serde = { version = "1.0.124", optional = true } serde_json = { version = "1.0.62", optional = true } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } # darwinia darwinia-support = { optional = true, path = "../../../support" } [dev-dependencies] # substrate -sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } # darwinia darwinia-balances = { path = "../../../balances" } darwinia-support = { path = "../../../support" } diff --git a/frame/bridge/crab/issuing/src/mock.rs b/frame/bridge/crab/issuing/src/mock.rs index 5eb29a86c7..56211f4d06 100644 --- a/frame/bridge/crab/issuing/src/mock.rs +++ b/frame/bridge/crab/issuing/src/mock.rs @@ -18,15 +18,10 @@ #![allow(dead_code)] -pub mod crab_issuing { - // --- darwinia --- - pub use crate::Event; -} - // --- crates --- use codec::{Decode, Encode}; // --- substrate --- -use frame_support::{impl_outer_event, impl_outer_origin, parameter_types}; +use frame_system::mocking::*; use sp_io::TestExternalities; use sp_runtime::{ testing::{Header, H256}, @@ -34,41 +29,17 @@ use sp_runtime::{ RuntimeDebug, }; // --- darwinia --- -use crate::*; +use crate::{self as darwinia_crab_issuing, *}; + +pub type Block = MockBlock; +pub type UncheckedExtrinsic = MockUncheckedExtrinsic; pub type AccountId = u64; pub type Balance = u128; -pub type System = frame_system::Module; -pub type CrabIssuing = Module; - pub type CrabIssuingError = Error; -impl_outer_origin! { - pub enum Origin for Test where system = frame_system {} -} - -impl_outer_event! { - pub enum Event for Test { - frame_system , - darwinia_balances Instance0, - crab_issuing , - } -} - -darwinia_support::impl_test_account_data! { deprecated } - -#[derive(Clone, Eq, PartialEq)] -pub struct Test; -parameter_types! { - pub const CrabIssuingModuleId: ModuleId = ModuleId(*b"da/crabi"); -} -impl Config for Test { - type Event = Event; - type ModuleId = CrabIssuingModuleId; - type RingCurrency = Ring; - type WeightInfo = (); -} +darwinia_support::impl_test_account_data! {} impl frame_system::Config for Test { type BaseCallFilter = (); @@ -76,7 +47,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type Origin = Origin; - type Call = (); + type Call = Call; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -87,7 +58,7 @@ impl frame_system::Config for Test { type Event = Event; type BlockHashCount = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); @@ -95,7 +66,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); } -parameter_types! { +frame_support::parameter_types! { pub const ExistentialDeposit: Balance = 0; } impl darwinia_balances::Config for Test { @@ -110,12 +81,35 @@ impl darwinia_balances::Config for Test { type WeightInfo = (); } +frame_support::parameter_types! { + pub const CrabIssuingModuleId: ModuleId = ModuleId(*b"da/crabi"); +} +impl Config for Test { + type Event = Event; + type ModuleId = CrabIssuingModuleId; + type RingCurrency = Ring; + type WeightInfo = (); +} + +frame_support::construct_runtime! { + pub enum Test + where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic + { + System: frame_system::{Module, Call, Storage, Config, Event}, + Ring: darwinia_balances::::{Module, Call, Storage, Config, Event}, + CrabIssuing: darwinia_crab_issuing::{Module, Call, Storage, Config, Event}, + } +} + pub fn new_test_ext() -> TestExternalities { let mut t = frame_system::GenesisConfig::default() .build_storage::() .unwrap(); - RingConfig { + darwinia_balances::GenesisConfig:: { balances: (1..10) .map(|i: AccountId| vec![(i, 100 * i as Balance), (10 * i, 1000 * i as Balance)]) .flatten() @@ -123,7 +117,7 @@ pub fn new_test_ext() -> TestExternalities { } .assimilate_storage(&mut t) .unwrap(); - GenesisConfig { + darwinia_crab_issuing::GenesisConfig { total_mapped_ring: 4_000, } .assimilate_storage::(&mut t) @@ -146,6 +140,6 @@ pub fn events() -> Vec { pub fn crab_issuing_events() -> Vec { events() .into_iter() - .filter(|e| matches!(e, Event::crab_issuing(_))) + .filter(|e| matches!(e, Event::darwinia_crab_issuing(_))) .collect() } diff --git a/frame/bridge/ethereum/backing/Cargo.toml b/frame/bridge/ethereum/backing/Cargo.toml index 690dde5af2..57f7acf58d 100644 --- a/frame/bridge/ethereum/backing/Cargo.toml +++ b/frame/bridge/ethereum/backing/Cargo.toml @@ -12,7 +12,8 @@ version = "2.0.0" [dependencies] # crates array-bytes = { version = "1.1.0" } -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } +log = { version = "0.4.14" } serde = { version = "1.0.124", optional = true } serde_json = { version = "1.0.62", optional = true } # darwinia @@ -20,13 +21,13 @@ darwinia-relay-primitives = { default-features = false, path = "../../../../prim darwinia-support = { default-features = false, path = "../../../support" } ethereum-primitives = { default-features = false, path = "../../../../primitives/ethereum-primitives" } # github -ethabi = { default-features = false, git = "https://github.com/darwinia-network/ethabi.git", branch = "with_no_std" } +ethabi = { default-features = false, git = "https://github.com/darwinia-network/ethabi.git", branch = "xavier-no-std" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # darwinia @@ -38,12 +39,13 @@ darwinia-relayer-game = { path = "../../relayer-game" } darwinia-staking = { path = "../../../../frame/staking" } ethereum-primitives = { features = ["deserialize"], path = "../../../../primitives/ethereum-primitives" } # github -rlp = { package = "rlp", git = "https://github.com/darwinia-network/parity-common.git" } +rlp = { version = "0.5.0" } # substrate -pallet-session = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-timestamp = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-staking = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +pallet-session = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-timestamp = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-election-providers = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-staking = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/bridge/ethereum/backing/src/lib.rs b/frame/bridge/ethereum/backing/src/lib.rs index 00a9743671..f1b950fa33 100644 --- a/frame/bridge/ethereum/backing/src/lib.rs +++ b/frame/bridge/ethereum/backing/src/lib.rs @@ -60,7 +60,7 @@ use codec::{Decode, Encode}; use ethabi::{Event as EthEvent, EventParam as EthEventParam, ParamType, RawLog}; // --- substrate --- use frame_support::{ - debug, decl_error, decl_event, decl_module, decl_storage, ensure, + decl_error, decl_event, decl_module, decl_storage, ensure, traits::{Currency, ExistenceRequirement::*, Get}, weights::Weight, }; @@ -494,7 +494,7 @@ impl Module { let token_address = result.params[0] .value .clone() - .to_address() + .into_address() .ok_or(>::AddressCF)?; ensure!( @@ -511,7 +511,7 @@ impl Module { let amount = result.params[2] .value .clone() - .to_uint() + .into_uint() .map(|x| x / U256::from(1_000_000_000u64)) .ok_or(>::IntCF)?; @@ -521,13 +521,13 @@ impl Module { let raw_account_id = result.params[3] .value .clone() - .to_bytes() + .into_bytes() .ok_or(>::BytesCF)?; - debug::trace!(target: "ethereum-backing", "[ethereum-backing] Raw Account: {:?}", raw_account_id); + log::trace!(target: "ethereum-backing", "[ethereum-backing] Raw Account: {:?}", raw_account_id); Self::account_id_try_from_bytes(&raw_account_id)? }; - debug::trace!(target: "ethereum-backing", "[ethereum-backing] Darwinia Account: {:?}", darwinia_account); + log::trace!(target: "ethereum-backing", "[ethereum-backing] Darwinia Account: {:?}", darwinia_account); Ok((darwinia_account, (is_ring, redeemed_amount), fee)) } @@ -609,13 +609,13 @@ impl Module { let deposit_id = result.params[0] .value .clone() - .to_uint() + .into_uint() .ok_or(>::IntCF)?; let months = { let months = result.params[2] .value .clone() - .to_uint() + .into_uint() .ok_or(>::IntCF)?; months.saturated_into() @@ -625,7 +625,7 @@ impl Module { let start_at = result.params[3] .value .clone() - .to_uint() + .into_uint() .ok_or(>::IntCF)?; start_at.saturated_into() @@ -636,7 +636,7 @@ impl Module { let redeemed_ring = result.params[5] .value .clone() - .to_uint() + .into_uint() .map(|x| x / U256::from(1_000_000_000u64)) .ok_or(>::IntCF)?; @@ -646,13 +646,13 @@ impl Module { let raw_account_id = result.params[6] .value .clone() - .to_bytes() + .into_bytes() .ok_or(>::BytesCF)?; - debug::trace!(target: "ethereum-backing", "[ethereum-backing] Raw Account: {:?}", raw_account_id); + log::trace!(target: "ethereum-backing", "[ethereum-backing] Raw Account: {:?}", raw_account_id); Self::account_id_try_from_bytes(&raw_account_id)? }; - debug::trace!(target: "ethereum-backing", "[ethereum-backing] Darwinia Account: {:?}", darwinia_account); + log::trace!(target: "ethereum-backing", "[ethereum-backing] Darwinia Account: {:?}", darwinia_account); Ok(( deposit_id, @@ -713,7 +713,7 @@ impl Module { let term = log.params[0] .value .clone() - .to_uint() + .into_uint() .ok_or(>::BytesCF)? .saturated_into(); let authorities = { @@ -722,10 +722,10 @@ impl Module { for token in log.params[1] .value .clone() - .to_array() + .into_array() .ok_or(>::ArrayCF)? { - authorities.push(token.to_address().ok_or(>::AddressCF)?); + authorities.push(token.into_address().ok_or(>::AddressCF)?); } authorities @@ -734,10 +734,10 @@ impl Module { let raw_account_id = log.params[2] .value .clone() - .to_fixed_bytes() + .into_fixed_bytes() .ok_or(>::BytesCF)?; - debug::trace!(target: "ethereum-backing", "[ethereum-backing] Raw Account: {:?}", raw_account_id); + log::trace!(target: "ethereum-backing", "[ethereum-backing] Raw Account: {:?}", raw_account_id); Self::account_id_try_from_bytes(&raw_account_id)? }; diff --git a/frame/bridge/ethereum/backing/src/mock.rs b/frame/bridge/ethereum/backing/src/mock.rs index f34307c41a..5a874e7234 100644 --- a/frame/bridge/ethereum/backing/src/mock.rs +++ b/frame/bridge/ethereum/backing/src/mock.rs @@ -20,89 +20,34 @@ #[macro_export] macro_rules! decl_tests { - () => { + ($($pallet:tt)*) => { // --- substrate --- - use frame_support::{ - impl_outer_dispatch, impl_outer_origin, parameter_types, weights::Weight, - }; + use frame_support::weights::Weight; + use frame_system::mocking::*; use sp_core::crypto::key_types; use sp_runtime::{ testing::{Header, TestXt, UintAuthorityId}, traits::{IdentifyAccount, IdentityLookup, OpaqueKeys, Verify}, ModuleId, {KeyTypeId, MultiSignature, Perbill}, }; + use sp_election_providers::onchain; // --- darwinia --- + use crate as darwinia_ethereum_backing; use darwinia_staking::{EraIndex, Exposure, ExposureOf}; - type Balance = u128; - type BlockNumber = u64; + type Block = MockBlock; + type UncheckedExtrinsic = MockUncheckedExtrinsic; + type Extrinsic = TestXt; /// Alias to 512-bit hash when used in the context of a transaction signature on the chain. type AccountId = <::Signer as IdentifyAccount>::AccountId; /// Some way of identifying an account on the chain. We intentionally make it equivalent /// to the public key of our transaction signing scheme. type Signature = MultiSignature; + type Balance = u128; + type BlockNumber = u64; - type Extrinsic = TestXt; - - type Session = pallet_session::Module; - type System = frame_system::Module; - type Timestamp = pallet_timestamp::Module; - type Staking = darwinia_staking::Module; - type EthereumBacking = Module; - - impl_outer_origin! { - pub enum Origin for Test where system = frame_system {} - } - - impl_outer_dispatch! { - pub enum Call for Test where origin: Origin { - darwinia_ethereum_relay::EthereumRelay, - darwinia_staking::Staking, - } - } - - darwinia_support::impl_test_account_data! { deprecated } - - #[derive(Clone, PartialEq, Eq, Debug)] - pub struct Test; - pub struct EcdsaAuthorities; - impl RelayAuthorityProtocol for EcdsaAuthorities { - type Signer = EthereumAddress; - - fn schedule_mmr_root(_: BlockNumber) {} - - fn check_authorities_change_to_sync(_: Term, _: Vec) -> DispatchResult { - Ok(()) - } - - fn sync_authorities_change() -> DispatchResult { - Ok(()) - } - } - parameter_types! { - pub const EthereumBackingModuleId: ModuleId = ModuleId(*b"da/backi"); - pub const EthereumBackingFeeModuleId: ModuleId = ModuleId(*b"da/ethfe"); - pub const RingLockLimit: Balance = 1000; - pub const KtonLockLimit: Balance = 1000; - pub const AdvancedFee: Balance = 1; - } - impl Config for Test { - type ModuleId = EthereumBackingModuleId; - type FeeModuleId = EthereumBackingFeeModuleId; - type Event = (); - type RedeemAccountId = AccountId; - type EthereumRelay = EthereumRelay; - type OnDepositRedeem = Staking; - type RingCurrency = Ring; - type KtonCurrency = Kton; - type RingLockLimit = RingLockLimit; - type KtonLockLimit = KtonLockLimit; - type AdvancedFee = AdvancedFee; - type SyncReward = (); - type EcdsaAuthorities = EcdsaAuthorities; - type WeightInfo = (); - } + darwinia_support::impl_test_account_data! {} impl frame_system::Config for Test { type BaseCallFilter = (); @@ -121,7 +66,7 @@ macro_rules! decl_tests { type Event = (); type BlockHashCount = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); @@ -136,7 +81,22 @@ macro_rules! decl_tests { type WeightInfo = (); } - parameter_types! { + pub struct TestSessionHandler; + impl pallet_session::SessionHandler for TestSessionHandler { + const KEY_TYPE_IDS: &'static [KeyTypeId] = &[key_types::DUMMY]; + + fn on_genesis_session(_validators: &[(AccountId, Ks)]) {} + + fn on_new_session( + _changed: bool, + _validators: &[(AccountId, Ks)], + _queued_validators: &[(AccountId, Ks)], + ) { + } + + fn on_disabled(_validator_index: usize) {} + } + frame_support::parameter_types! { pub const Period: BlockNumber = 1; pub const Offset: BlockNumber = 0; } @@ -181,7 +141,14 @@ macro_rules! decl_tests { type WeightInfo = (); } - parameter_types! { + impl onchain::Config for Test { + type AccountId = AccountId; + type BlockNumber = BlockNumber; + type Accuracy = Perbill; + type DataProvider = Staking; + } + + frame_support::parameter_types! { pub const StakingModuleId: ModuleId = ModuleId(*b"da/staki"); } impl darwinia_staking::Config for Test { @@ -202,6 +169,7 @@ macro_rules! decl_tests { type MaxNominatorRewardedPerValidator = (); type UnsignedPriority = (); type OffchainSolutionWeightLimit = (); + type ElectionProvider = onchain::OnChainSequentialPhragmen; type RingCurrency = Ring; type RingRewardRemainder = (); type RingSlash = (); @@ -214,6 +182,44 @@ macro_rules! decl_tests { type WeightInfo = (); } + pub struct EcdsaAuthorities; + impl RelayAuthorityProtocol for EcdsaAuthorities { + type Signer = EthereumAddress; + + fn schedule_mmr_root(_: BlockNumber) {} + + fn check_authorities_change_to_sync(_: Term, _: Vec) -> DispatchResult { + Ok(()) + } + + fn sync_authorities_change() -> DispatchResult { + Ok(()) + } + } + frame_support::parameter_types! { + pub const EthereumBackingModuleId: ModuleId = ModuleId(*b"da/backi"); + pub const EthereumBackingFeeModuleId: ModuleId = ModuleId(*b"da/ethfe"); + pub const RingLockLimit: Balance = 1000; + pub const KtonLockLimit: Balance = 1000; + pub const AdvancedFee: Balance = 1; + } + impl Config for Test { + type ModuleId = EthereumBackingModuleId; + type FeeModuleId = EthereumBackingFeeModuleId; + type Event = (); + type RedeemAccountId = AccountId; + type EthereumRelay = EthereumRelay; + type OnDepositRedeem = Staking; + type RingCurrency = Ring; + type KtonCurrency = Kton; + type RingLockLimit = RingLockLimit; + type KtonLockLimit = KtonLockLimit; + type AdvancedFee = AdvancedFee; + type SyncReward = (); + type EcdsaAuthorities = EcdsaAuthorities; + type WeightInfo = (); + } + impl frame_system::offchain::SendTransactionTypes for Test where Call: From, @@ -222,20 +228,22 @@ macro_rules! decl_tests { type OverarchingCall = Call; } - pub struct TestSessionHandler; - impl pallet_session::SessionHandler for TestSessionHandler { - const KEY_TYPE_IDS: &'static [KeyTypeId] = &[key_types::DUMMY]; - - fn on_genesis_session(_validators: &[(AccountId, Ks)]) {} - - fn on_new_session( - _changed: bool, - _validators: &[(AccountId, Ks)], - _queued_validators: &[(AccountId, Ks)], - ) { + frame_support::construct_runtime! { + pub enum Test + where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic + { + System: frame_system::{Module, Call, Storage, Config}, + Timestamp: pallet_timestamp::{Module, Call, Storage}, + Ring: darwinia_balances::::{Module, Call, Storage}, + Kton: darwinia_balances::::{Module, Call, Storage}, + Staking: darwinia_staking::{Module, Call, Storage}, + Session: pallet_session::{Module, Call, Storage}, + EthereumBacking: darwinia_ethereum_backing::{Module, Call, Storage, Config}, + $($pallet)*, } - - fn on_disabled(_validator_index: usize) {} } }; } diff --git a/frame/bridge/ethereum/backing/src/test_with_linear_relay.rs b/frame/bridge/ethereum/backing/src/test_with_linear_relay.rs index cbfed4522f..c1b783b9bb 100644 --- a/frame/bridge/ethereum/backing/src/test_with_linear_relay.rs +++ b/frame/bridge/ethereum/backing/src/test_with_linear_relay.rs @@ -30,11 +30,9 @@ use ethereum_primitives::{ header::EthereumHeader, receipt::EthereumReceiptProof, EthereumNetworkType, }; -type EthereumRelay = darwinia_ethereum_linear_relay::Module; +decl_tests!(EthereumRelay: darwinia_ethereum_linear_relay::{Module, Call, Storage}); -decl_tests!(); - -parameter_types! { +frame_support::parameter_types! { pub const EthereumLinearRelayModuleId: ModuleId = ModuleId(*b"da/ethli"); pub const EthereumNetwork: EthereumNetworkType = EthereumNetworkType::Ropsten; } @@ -59,7 +57,7 @@ impl ExtBuilder { .build_storage::() .unwrap(); - GenesisConfig:: { + darwinia_ethereum_backing::GenesisConfig:: { token_redeem_address: array_bytes::hex2array_unchecked!( "0x49262B932E439271d05634c32978294C7Ea15d0C", 20 diff --git a/frame/bridge/ethereum/backing/src/test_with_relay.rs b/frame/bridge/ethereum/backing/src/test_with_relay.rs index 00dc96d6ab..c4db9dcc22 100644 --- a/frame/bridge/ethereum/backing/src/test_with_relay.rs +++ b/frame/bridge/ethereum/backing/src/test_with_relay.rs @@ -32,9 +32,7 @@ use ethereum_primitives::{ header::EthereumHeader, receipt::EthereumReceiptProof, EthereumBlockNumber, EthereumNetworkType, }; -type EthereumRelay = darwinia_ethereum_relay::Module; - -decl_tests!(); +decl_tests!(EthereumRelay: darwinia_ethereum_relay::{Module, Call, Storage}); pub struct UnusedTechnicalMembership; impl Contains for UnusedTechnicalMembership { @@ -42,7 +40,7 @@ impl Contains for UnusedTechnicalMembership { unimplemented!() } } -parameter_types! { +frame_support::parameter_types! { pub const EthereumRelayModuleId: ModuleId = ModuleId(*b"da/ethrl"); pub const EthereumNetwork: EthereumNetworkType = EthereumNetworkType::Ropsten; } @@ -119,7 +117,7 @@ impl ExtBuilder { .build_storage::() .unwrap(); - GenesisConfig:: { + darwinia_ethereum_backing::GenesisConfig:: { token_redeem_address: array_bytes::hex2array_unchecked!( "0x49262B932E439271d05634c32978294C7Ea15d0C", 20 diff --git a/frame/bridge/ethereum/linear-relay/Cargo.toml b/frame/bridge/ethereum/linear-relay/Cargo.toml index 8d2522691e..a0fc15aee1 100644 --- a/frame/bridge/ethereum/linear-relay/Cargo.toml +++ b/frame/bridge/ethereum/linear-relay/Cargo.toml @@ -12,20 +12,20 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false, features = ["derive"] } -serde = { version = "1.0.124", optional = true } -serde_json = { version = "1.0.62", optional = true } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } +ethereum-types = { version = "0.11.0", default-features = false } +log = { version = "0.4.14" } +rlp = { version = "0.5.0", default-features = false } +serde = { version = "1.0.124", optional = true } +serde_json = { version = "1.0.62", optional = true } # darwinia darwinia-support = { default-features = false, path = "../../../support" } ethereum-primitives = { default-features = false, path = "../../../../primitives/ethereum-primitives" } -# github -ethereum-types = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } -rlp = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # crates @@ -34,8 +34,8 @@ array-bytes = { version = "1.1.0" } darwinia-balances = { path = "../../../../frame/balances" } ethereum-primitives = { features = ["deserialize"], path = "../../../../primitives/ethereum-primitives" } # substrate -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] @@ -43,12 +43,14 @@ default = ["std"] std = [ "crates-std", "darwinia-std", - "github-std", "substrate-std", ] crates-std = [ "codec/std", + "ethereum-types/std", + "ethereum-types/serialize", + "rlp/std", "serde", "serde_json", ] @@ -56,11 +58,6 @@ darwinia-std = [ "darwinia-support/std", "ethereum-primitives/std", ] -github-std = [ - "ethereum-types/std", - "ethereum-types/serialize", - "rlp/std", -] substrate-std = [ "frame-support/std", "frame-system/std", diff --git a/frame/bridge/ethereum/linear-relay/src/lib.rs b/frame/bridge/ethereum/linear-relay/src/lib.rs index 33f33cae80..60dc91ca72 100644 --- a/frame/bridge/ethereum/linear-relay/src/lib.rs +++ b/frame/bridge/ethereum/linear-relay/src/lib.rs @@ -72,7 +72,6 @@ use codec::{Decode, Encode}; use ethereum_types::H128; // --- substrate --- use frame_support::{ - debug::trace, decl_error, decl_event, decl_module, decl_storage, ensure, traits::Get, traits::{Currency, ExistenceRequirement::KeepAlive, IsSubType, ReservableCurrency}, @@ -275,7 +274,7 @@ decl_module! { /// # #[weight = 200_000_000] pub fn relay_header(origin, header: EthereumHeader, ethash_proof: Vec) { - trace!(target: "ethereum-linear-relay", "{:?}", header); + log::trace!(target: "ethereum-linear-relay", "{:?}", header); let relayer = ensure_signed(origin)?; if Self::check_authority() { @@ -551,13 +550,13 @@ impl Module { header.hash() == header.re_compute_hash(), >::HeaderHashMis ); - trace!(target: "ethereum-linear-relay", "Hash OK"); + log::trace!(target: "ethereum-linear-relay", "Hash OK"); let begin_header_number = Self::begin_header() .ok_or(>::BeginHeaderNE)? .number; ensure!(header.number >= begin_header_number, >::HeaderTE); - trace!(target: "ethereum-linear-relay", "Number1 OK"); + log::trace!(target: "ethereum-linear-relay", "Number1 OK"); // There must be a corresponding parent hash let prev_header = Self::header(header.parent_hash).ok_or(>::HeaderNE)?; @@ -566,7 +565,7 @@ impl Module { header.number == prev_header.number + 1, >::BlockNumberMis ); - trace!(target: "ethereum-linear-relay", "Number2 OK"); + log::trace!(target: "ethereum-linear-relay", "Number2 OK"); // check difficulty let ethash_params = match T::EthereumNetwork::get() { @@ -576,12 +575,12 @@ impl Module { ethash_params .verify_block_basic(header) .map_err(|_| >::BlockBasicVF)?; - trace!(target: "ethereum-linear-relay", "Basic OK"); + log::trace!(target: "ethereum-linear-relay", "Basic OK"); // verify difficulty let difficulty = ethash_params.calculate_difficulty(header, &prev_header); ensure!(difficulty == *header.difficulty(), >::DifficultyVF); - trace!(target: "ethereum-linear-relay", "Difficulty OK"); + log::trace!(target: "ethereum-linear-relay", "Difficulty OK"); Ok(()) } @@ -601,7 +600,7 @@ impl Module { { Err(>::MixHashMis)?; }; - trace!(target: "ethereum-linear-relay", "MixHash OK"); + log::trace!(target: "ethereum-linear-relay", "MixHash OK"); // TODO: Check other verification condition // See YellowPaper formula (50) in section 4.3.4 diff --git a/frame/bridge/ethereum/linear-relay/src/mock.rs b/frame/bridge/ethereum/linear-relay/src/mock.rs index 45e137762c..5ad5b991a0 100644 --- a/frame/bridge/ethereum/linear-relay/src/mock.rs +++ b/frame/bridge/ethereum/linear-relay/src/mock.rs @@ -23,49 +23,22 @@ use std::fs::File; // --- crates --- use serde::Deserialize; // --- substrate --- -use frame_support::{impl_outer_dispatch, impl_outer_origin, parameter_types}; +use frame_system::mocking::*; use sp_core::H256; use sp_runtime::{testing::Header, traits::IdentityLookup, RuntimeDebug}; // --- darwinia --- -use crate::*; +use crate::{self as darwinia_ethereum_linear_relay, *}; use ethereum_primitives::receipt::LogEntry; use ethereum_types::H512; +type Block = MockBlock; +type UncheckedExtrinsic = MockUncheckedExtrinsic; + type AccountId = u64; type BlockNumber = u64; type Balance = u128; -pub type System = frame_system::Module; -pub type EthereumRelay = Module; - -impl_outer_origin! { - pub enum Origin for Test where system = frame_system {} -} - -impl_outer_dispatch! { - pub enum Call for Test where origin: Origin { - frame_system::System, - darwinia_ethereum_relay::EthereumRelay, - } -} - -darwinia_support::impl_test_account_data! { deprecated } - -// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. -#[derive(Clone, PartialEq, Eq, Debug)] -pub struct Test; -parameter_types! { - pub const EthereumRelayModuleId: ModuleId = ModuleId(*b"da/ethli"); - pub static EthereumNetwork: EthereumNetworkType = EthereumNetworkType::Ropsten; -} -impl Config for Test { - type ModuleId = EthereumRelayModuleId; - type Event = (); - type EthereumNetwork = EthereumNetwork; - type Call = Call; - type Currency = Ring; - type WeightInfo = (); -} +darwinia_support::impl_test_account_data! {} impl frame_system::Config for Test { type BaseCallFilter = (); @@ -84,7 +57,7 @@ impl frame_system::Config for Test { type Event = (); type BlockHashCount = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); @@ -104,6 +77,32 @@ impl darwinia_balances::Config for Test { type WeightInfo = (); } +frame_support::parameter_types! { + pub const EthereumRelayModuleId: ModuleId = ModuleId(*b"da/ethli"); + pub static EthereumNetwork: EthereumNetworkType = EthereumNetworkType::Ropsten; +} +impl Config for Test { + type ModuleId = EthereumRelayModuleId; + type Event = (); + type EthereumNetwork = EthereumNetwork; + type Call = Call; + type Currency = Ring; + type WeightInfo = (); +} + +frame_support::construct_runtime! { + pub enum Test + where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic + { + System: frame_system::{Module, Call, Storage, Config}, + Ring: darwinia_balances::::{Module, Call, Storage, Config}, + EthereumRelay: darwinia_ethereum_linear_relay::{Module, Call, Storage, Config}, + } +} + #[derive(Debug)] pub struct BlockWithProof { pub proof_length: u64, @@ -263,7 +262,7 @@ impl ExtBuilder { .build_storage::() .unwrap(); - GenesisConfig:: { + darwinia_ethereum_linear_relay::GenesisConfig:: { number_of_blocks_finality: 30, number_of_blocks_safe: 10, dags_merkle_roots_loader: DagsMerkleRootsLoader::from_file( diff --git a/frame/bridge/ethereum/relay/Cargo.toml b/frame/bridge/ethereum/relay/Cargo.toml index 5ac5814aeb..7c5dea4a17 100644 --- a/frame/bridge/ethereum/relay/Cargo.toml +++ b/frame/bridge/ethereum/relay/Cargo.toml @@ -14,9 +14,9 @@ version = "2.0.0" # crates array-bytes = { version = "1.1.0" } blake2-rfc = { version = "0.2.18", default-features = false } -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } serde = { version = "1.0.124", optional = true } -serde_json = { version = "1.0.62", optional = true } +serde_json = { version = "1.0.64", optional = true } # darwinia darwinia-relay-primitives = { default-features = false, path = "../../../../primitives/relay" } darwinia-relayer-game = { default-features = false, path = "../../../bridge/relayer-game" } @@ -24,22 +24,22 @@ darwinia-support = { default-features = false, path = "../../../support ethereum-primitives = { default-features = false, path = "../../../../primitives/ethereum-primitives" } # github ckb-merkle-mountain-range = { default-features = false, git = "https://github.com/darwinia-network/merkle-mountain-range.git" } -ethereum-types = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } -rlp = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } +ethereum-types = { version = "0.11.0", default-features = false } +rlp = { version = "0.5.0", default-features = false } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # darwinia darwinia-balances = { path = "../../../../frame/balances" } ethereum-primitives = { features = ["deserialize"], path = "../../../../primitives/ethereum-primitives" } # substrate -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/bridge/ethereum/relay/src/mock.rs b/frame/bridge/ethereum/relay/src/mock.rs index ffc5244501..888c80cef8 100644 --- a/frame/bridge/ethereum/relay/src/mock.rs +++ b/frame/bridge/ethereum/relay/src/mock.rs @@ -19,65 +19,21 @@ //! Mock file for ethereum-relay. // --- substrate --- -use frame_support::{ - impl_outer_dispatch, impl_outer_origin, parameter_types, traits::OnInitialize, -}; -use frame_system::EnsureRoot; +use frame_support::traits::OnInitialize; +use frame_system::{mocking::*, EnsureRoot}; use sp_core::H256; use sp_runtime::{testing::Header, traits::IdentityLookup, RuntimeDebug}; // --- darwinia --- -use crate::*; +use crate::{self as darwinia_ethereum_relay, *}; + +pub type Block = MockBlock; +pub type UncheckedExtrinsic = MockUncheckedExtrinsic; pub type AccountId = u64; pub type BlockNumber = u64; pub type Balance = u128; -pub type System = frame_system::Module; -pub type EthereumRelay = Module; - -impl_outer_origin! { - pub enum Origin for Test where system = frame_system {} -} - -impl_outer_dispatch! { - pub enum Call for Test where origin: Origin { - frame_system::System, - darwinia_ethereum_relay::EthereumRelay, - } -} - -darwinia_support::impl_test_account_data! { deprecated } - -// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. -#[derive(Clone, PartialEq, Eq, Debug)] -pub struct Test; -pub struct UnusedTechnicalMembership; -impl Contains for UnusedTechnicalMembership { - fn sorted_members() -> Vec { - vec![1, 2, 3] - } -} -parameter_types! { - pub const EthereumRelayModuleId: ModuleId = ModuleId(*b"da/ethrl"); - pub const EthereumNetwork: EthereumNetworkType = EthereumNetworkType::Mainnet; - pub static BestConfirmedBlockNumber: EthereumBlockNumber = 0; - pub static ConfirmPeriod: BlockNumber = 0; -} -impl Config for Test { - type ModuleId = EthereumRelayModuleId; - type Event = (); - type EthereumNetwork = EthereumNetwork; - type Call = Call; - type Currency = Ring; - type RelayerGame = UnusedRelayerGame; - type ApproveOrigin = EnsureRoot; - type RejectOrigin = EnsureRoot; - type ConfirmPeriod = ConfirmPeriod; - type TechnicalMembership = UnusedTechnicalMembership; - type ApproveThreshold = (); - type RejectThreshold = (); - type WeightInfo = (); -} +darwinia_support::impl_test_account_data! {} impl frame_system::Config for Test { type BaseCallFilter = (); @@ -96,7 +52,7 @@ impl frame_system::Config for Test { type Event = (); type BlockHashCount = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); @@ -116,6 +72,47 @@ impl darwinia_balances::Config for Test { type WeightInfo = (); } +pub struct UnusedTechnicalMembership; +impl Contains for UnusedTechnicalMembership { + fn sorted_members() -> Vec { + vec![1, 2, 3] + } +} +frame_support::parameter_types! { + pub const EthereumRelayModuleId: ModuleId = ModuleId(*b"da/ethrl"); + pub const EthereumNetwork: EthereumNetworkType = EthereumNetworkType::Mainnet; + pub static BestConfirmedBlockNumber: EthereumBlockNumber = 0; + pub static ConfirmPeriod: BlockNumber = 0; +} +impl Config for Test { + type ModuleId = EthereumRelayModuleId; + type Event = (); + type EthereumNetwork = EthereumNetwork; + type Call = Call; + type Currency = Ring; + type RelayerGame = UnusedRelayerGame; + type ApproveOrigin = EnsureRoot; + type RejectOrigin = EnsureRoot; + type ConfirmPeriod = ConfirmPeriod; + type TechnicalMembership = UnusedTechnicalMembership; + type ApproveThreshold = (); + type RejectThreshold = (); + type WeightInfo = (); +} + +frame_support::construct_runtime! { + pub enum Test + where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic + { + System: frame_system::{Module, Call, Storage, Config}, + Ring: darwinia_balances::::{Module, Call, Storage}, + EthereumRelay: darwinia_ethereum_relay::{Module, Call, Storage, Config}, + } +} + pub struct ExtBuilder { best_confirmed_block_number: EthereumBlockNumber, confirm_period: BlockNumber, @@ -148,7 +145,7 @@ impl ExtBuilder { .build_storage::() .unwrap(); - GenesisConfig:: { + darwinia_ethereum_relay::GenesisConfig:: { genesis_header_info: ( vec![0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33, 29, 204, 77, 232, 222, 199, 93, 122, 171, 133, 181, 103, 182, 204, 212, 26, 211, 18, 69, 27, 148, 138, 116, 19, 240, 161, 66, 253, 64, 212, 147, 71, 128, 17, 187, 232, 219, 78, 52, 123, 78, 140, 147, 124, 28, 131, 112, 228, 181, 237, 51, 173, 179, 219, 105, 203, 219, 122, 56, 225, 229, 11, 27, 130, 250, 215, 248, 151, 79, 181, 172, 120, 217, 172, 9, 155, 154, 213, 1, 139, 237, 194, 206, 10, 114, 218, 209, 130, 122, 23, 9, 218, 48, 88, 15, 5, 68, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 132, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 136, 0, 0, 0, 0, 0, 0, 0, 66, 1, 212, 229, 103, 64, 248, 118, 174, 248, 192, 16, 184, 106, 64, 213, 245, 103, 69, 161, 24, 208, 144, 106, 52, 230, 154, 236, 140, 13, 177, 203, 143, 163], b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".into() diff --git a/frame/bridge/relay-authorities/Cargo.toml b/frame/bridge/relay-authorities/Cargo.toml index 79b64d6b47..1804801467 100644 --- a/frame/bridge/relay-authorities/Cargo.toml +++ b/frame/bridge/relay-authorities/Cargo.toml @@ -11,16 +11,16 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } serde = { version = "1.0.124", optional = true } # darwinia darwinia-relay-primitives = { default-features = false, path = "../../../primitives/relay" } darwinia-support = { default-features = false, path = "../../support" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # crates @@ -29,8 +29,8 @@ array-bytes = { version = "1.1.0" } darwinia-balances = { path = "../../balances" } darwinia-support = { path = "../../support" } # substrate -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/bridge/relay-authorities/src/mock.rs b/frame/bridge/relay-authorities/src/mock.rs index 7a267a6877..abc4f2c7b5 100644 --- a/frame/bridge/relay-authorities/src/mock.rs +++ b/frame/bridge/relay-authorities/src/mock.rs @@ -21,7 +21,7 @@ // --- crates --- use codec::{Decode, Encode}; // --- substrate --- -use frame_support::{parameter_types, traits::OnInitialize}; +use frame_support::traits::OnInitialize; use frame_system::{mocking::*, EnsureRoot}; use sp_core::H256; use sp_io::{hashing, TestExternalities}; @@ -34,14 +34,14 @@ use sp_runtime::{ use crate::{self as darwinia_relay_authorities, *}; use darwinia_relay_primitives::relay_authorities::Sign as SignT; +pub type Block = MockBlock; +pub type UncheckedExtrinsic = MockUncheckedExtrinsic; + pub type BlockNumber = u64; pub type AccountId = u64; pub type Index = u64; pub type Balance = u128; -type Block = MockBlock; -type UncheckedExtrinsic = MockUncheckedExtrinsic; - pub type RelayAuthoritiesError = Error; pub const DEFAULT_MMR_ROOT: H256 = H256([0; 32]); @@ -74,7 +74,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); } -parameter_types! { +frame_support::parameter_types! { pub const MaxLocks: u32 = 1024; } impl darwinia_balances::Config for Test { @@ -109,7 +109,7 @@ impl SignT for Sign { true } } -parameter_types! { +frame_support::parameter_types! { pub const LockId: LockIdentifier = *b"lockidts"; pub const TermDuration: BlockNumber = 10; pub const MaxCandidates: usize = 7; diff --git a/frame/bridge/relayer-game/Cargo.toml b/frame/bridge/relayer-game/Cargo.toml index 4dd044b323..4d6617931c 100644 --- a/frame/bridge/relayer-game/Cargo.toml +++ b/frame/bridge/relayer-game/Cargo.toml @@ -11,25 +11,26 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +log = { version = "0.4.14" } serde = { version = "1.0.124", optional = true } # darwinia darwinia-relay-primitives = { default-features = false, path = "../../../primitives/relay" } darwinia-support = { default-features = false, path = "../../support" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # crates -env_logger = { version = "0.8.2" } +env_logger = { version = "0.8.3" } # darwinia darwinia-balances = { path = "../../balances" } # substrate -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/bridge/relayer-game/src/lib.rs b/frame/bridge/relayer-game/src/lib.rs index bad75b49eb..b28be075a5 100644 --- a/frame/bridge/relayer-game/src/lib.rs +++ b/frame/bridge/relayer-game/src/lib.rs @@ -58,7 +58,6 @@ mod types { // --- substrate --- use frame_support::{ - debug::*, decl_error, decl_module, decl_storage, ensure, traits::{Currency, Get, OnUnbalanced}, }; @@ -204,7 +203,7 @@ decl_module! { if !game_ids.is_empty() { if let Err(e) = Self::update_games_at(game_ids, now) { - error!(target: "relayer-game", "{:?}", e); + log::error!(target: "relayer-game", "{:?}", e); } } @@ -274,8 +273,8 @@ impl, I: Instance> Module { game_ids: Vec>, moment: BlockNumber, ) -> DispatchResult { - trace!(target: "relayer-game", "Found Closed Rounds at `{:?}`", moment); - trace!(target: "relayer-game", "---"); + log::trace!(target: "relayer-game", "Found Closed Rounds at `{:?}`", moment); + log::trace!(target: "relayer-game", "---"); // let call = Call::update_games_unsigned(game_ids).into(); // @@ -354,7 +353,7 @@ impl, I: Instance> Module { ) } else { // Should never enter this condition - error!(target: "relayer-game", " > Relay Parcels Count - MISMATCHED"); + log::error!(target: "relayer-game", " > Relay Parcels Count - MISMATCHED"); None } @@ -433,21 +432,21 @@ impl, I: Instance> Module { return Some(relay_header_parcels.pop().unwrap()); } else { // Should never enter this condition - error!(target: "relayer-game", " > Relay Parcels - MORE THAN ONE"); + log::error!(target: "relayer-game", " > Relay Parcels - MORE THAN ONE"); return None; } } } else { // Should never enter this condition - error!(target: "relayer-game", " > Extended Relay Proposal - NOT EXISTED"); + log::error!(target: "relayer-game", " > Extended Relay Proposal - NOT EXISTED"); return None; } } // Should never enter this condition - error!(target: "relayer-game", " > Extended Relay Proposal - NOT EXISTED"); + log::error!(target: "relayer-game", " > Extended Relay Proposal - NOT EXISTED"); None } @@ -497,13 +496,13 @@ impl, I: Instance> Module { } } else { // Should never enter this condition - error!(target: "relayer-game", " > Index - NOT EXISTED"); + log::error!(target: "relayer-game", " > Index - NOT EXISTED"); return None; } } else { // Should never enter this condition - error!(target: "relayer-game", " > Round - NOT EXISTED"); + log::error!(target: "relayer-game", " > Round - NOT EXISTED"); return None; } @@ -512,7 +511,7 @@ impl, I: Instance> Module { if T::RelayableChain::verify_relay_chain(relay_chain).is_ok() { last_round_winning_relay_chain_indexes.push(index); } else { - trace!( + log::trace!( target: "relayer-game", " > Relay Chain - INVALID", ); @@ -611,34 +610,34 @@ impl, I: Instance> Module { return Some(relay_header_parcels[0].to_owned()); } else { // Should never enter this condition - error!(target: "relayer-game", " > Relay Parcels - MORE THAN ONE"); + log::error!(target: "relayer-game", " > Relay Parcels - MORE THAN ONE"); return None; } } } else { // Should never enter this condition - error!(target: "relayer-game", " > Extended Relay Proposal - NOT EXISTED"); + log::error!(target: "relayer-game", " > Extended Relay Proposal - NOT EXISTED"); return None; } } // Should never enter this condition - error!(target: "relayer-game", " > Extended Relay Proposal - NOT EXISTED"); + log::error!(target: "relayer-game", " > Extended Relay Proposal - NOT EXISTED"); None } _ => { // Should never enter this condition - error!(target: "relayer-game", " > Honesty Relayer - MORE THAN ONE"); + log::error!(target: "relayer-game", " > Honesty Relayer - MORE THAN ONE"); None } } } else { // Should never enter this condition - error!(target: "relayer-game", " > Relay Affirmations - EMPTY"); + log::error!(target: "relayer-game", " > Relay Affirmations - EMPTY"); None } @@ -663,7 +662,7 @@ impl, I: Instance> Module { } pub fn game_over(game_id: RelayHeaderId) { - // TODO: error trace + // TODO: log::error log::trace let _ = >::try_mutate(|relay_header_parcel_to_resolve| { if let Some(i) = relay_header_parcel_to_resolve .iter() @@ -690,7 +689,7 @@ impl, I: Instance> Module { let mut relay_header_parcels = vec![]; for game_id in game_ids { - trace!( + log::trace!( target: "relayer-game", "> Trying to Settle Game `{:?}`", game_id ); @@ -700,7 +699,7 @@ impl, I: Instance> Module { last_round } else { // Should never enter this condition - error!(target: "relayer-game", " > Rounds - EMPTY"); + log::error!(target: "relayer-game", " > Rounds - EMPTY"); continue; }; @@ -708,10 +707,10 @@ impl, I: Instance> Module { match (last_round, relay_affirmations.len()) { // Should never enter this condition - (0, 0) => error!(target: "relayer-game", " > Affirmations - EMPTY"), + (0, 0) => log::error!(target: "relayer-game", " > Affirmations - EMPTY"), // At first round and only one affirmation found (0, 1) => { - trace!(target: "relayer-game", " > Challenge - NOT EXISTED"); + log::trace!(target: "relayer-game", " > Challenge - NOT EXISTED"); if let Some(relay_header_parcel) = Self::settle_without_challenge(relay_affirmations.pop().unwrap()) @@ -721,13 +720,13 @@ impl, I: Instance> Module { } // No relayer response for the latest round (_, 0) => { - trace!(target: "relayer-game", " > All Relayers Abstain, Settle Abandon"); + log::trace!(target: "relayer-game", " > All Relayers Abstain, Settle Abandon"); Self::settle_abandon(&game_id); } // No more challenge found at latest round, only one relayer win (_, 1) => { - trace!(target: "relayer-game", " > No More Challenge, Settle With Challenge"); + log::trace!(target: "relayer-game", " > No More Challenge, Settle With Challenge"); if let Some(relay_header_parcel) = Self::settle_with_challenge(&game_id, relay_affirmations.pop().unwrap()) @@ -746,7 +745,7 @@ impl, I: Instance> Module { ); if distance == round_count { - trace!(target: "relayer-game", " > A Full Chain Gave, On Chain Arbitrate"); + log::trace!(target: "relayer-game", " > A Full Chain Gave, On Chain Arbitrate"); // A whole chain gave, start continuous verification if let Some(relay_header_parcel) = Self::on_chain_arbitrate(&game_id) { @@ -755,7 +754,7 @@ impl, I: Instance> Module { Self::settle_abandon(&game_id); } } else { - trace!(target: "relayer-game", " > Still In Challenge, Update Games"); + log::trace!(target: "relayer-game", " > Still In Challenge, Update Games"); // Update game, start new round Self::update_game_at(&game_id, last_round, now); @@ -768,10 +767,10 @@ impl, I: Instance> Module { Self::game_over(game_id); } - // TODO: handle error + // TODO: handle log::error let _ = T::RelayableChain::try_confirm_relay_header_parcels(relay_header_parcels); - trace!(target: "relayer-game", "---"); + log::trace!(target: "relayer-game", "---"); Ok(()) } @@ -807,7 +806,7 @@ impl, I: Instance> RelayerGameProtocol for Module { relay_header_parcel: Self::RelayHeaderParcel, optional_relay_proofs: Option, ) -> Result { - trace!( + log::trace!( target: "relayer-game", "Relayer `{:?}` affirm:\n{:#?}", relayer, @@ -889,7 +888,7 @@ impl, I: Instance> RelayerGameProtocol for Module { relay_header_parcel: Self::RelayHeaderParcel, optional_relay_proofs: Option, ) -> Result<(Self::RelayHeaderId, u32), DispatchError> { - trace!( + log::trace!( target: "relayer-game", "Relayer `{:?}` dispute and affirm:\n{:#?}", relayer, @@ -1011,7 +1010,7 @@ impl, I: Instance> RelayerGameProtocol for Module { game_sample_points: Vec, optional_relay_proofs: Option>, ) -> Result<(Self::RelayHeaderId, u32, u32), DispatchError> { - trace!( + log::trace!( target: "relayer-game", "Relayer `{:?}` extend affirmation: {:?} with: {:?}", relayer, diff --git a/frame/bridge/relayer-game/src/mock.rs b/frame/bridge/relayer-game/src/mock.rs index e07f70ccb4..718a213a71 100644 --- a/frame/bridge/relayer-game/src/mock.rs +++ b/frame/bridge/relayer-game/src/mock.rs @@ -241,48 +241,24 @@ use std::time::Instant; // --- crates --- use codec::{Decode, Encode}; // --- substrate --- -use frame_support::{impl_outer_origin, parameter_types, traits::OnFinalize}; +use frame_support::traits::OnFinalize; +use frame_system::mocking::*; use sp_runtime::RuntimeDebug; // --- darwinia --- -use crate::*; +use crate::{self as darwinia_relayer_game, *}; use darwinia_relay_primitives::relayer_game::*; use mock_relay::{MockRelayBlockNumber, MockRelayHeader}; +pub type Block = MockBlock; +pub type UncheckedExtrinsic = MockUncheckedExtrinsic; + pub type AccountId = u64; pub type BlockNumber = u64; pub type Balance = u128; -pub type System = frame_system::Module; -pub type Relay = mock_relay::Module; - pub type RelayerGameError = Error; -pub type RelayerGame = Module; - -impl_outer_origin! { - pub enum Origin for Test - where - system = frame_system - {} -} -darwinia_support::impl_test_account_data! { deprecated } - -#[derive(Clone, Eq, PartialEq)] -pub struct Test; -parameter_types! { - pub const RelayerGameLockId: LockIdentifier = *b"da/rgame"; - pub static GenesisTime: Instant = Instant::now(); - pub static ChallengeTime: BlockNumber = 6; - pub static EstimateBond: Balance = 1; -} -impl Config for Test { - type RingCurrency = Ring; - type LockId = RelayerGameLockId; - type RingSlash = (); - type RelayerGameAdjustor = RelayerGameAdjustor; - type RelayableChain = Relay; - type WeightInfo = (); -} +darwinia_support::impl_test_account_data! {} impl frame_system::Config for Test { type BaseCallFilter = (); @@ -290,7 +266,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type Origin = Origin; - type Call = (); + type Call = Call; type Index = u64; type BlockNumber = BlockNumber; type Hash = sp_core::H256; @@ -301,7 +277,7 @@ impl frame_system::Config for Test { type Event = (); type BlockHashCount = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); @@ -309,7 +285,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); } -parameter_types! { +frame_support::parameter_types! { pub const ExistentialDeposit: Balance = 1; } impl darwinia_balances::Config for Test { @@ -350,6 +326,34 @@ impl AdjustableRelayerGame for RelayerGameAdjustor { ESTIMATE_BOND.with(|v| v.borrow().to_owned()) } } +frame_support::parameter_types! { + pub const RelayerGameLockId: LockIdentifier = *b"da/rgame"; + pub static GenesisTime: Instant = Instant::now(); + pub static ChallengeTime: BlockNumber = 6; + pub static EstimateBond: Balance = 1; +} +impl Config for Test { + type RingCurrency = Ring; + type LockId = RelayerGameLockId; + type RingSlash = (); + type RelayerGameAdjustor = RelayerGameAdjustor; + type RelayableChain = Relay; + type WeightInfo = (); +} + +frame_support::construct_runtime! { + pub enum Test + where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic + { + System: frame_system::{Module, Call, Storage, Config}, + Ring: darwinia_balances::::{Module, Call, Storage, Config}, + Relay: mock_relay::{Module, Storage}, + RelayerGame: darwinia_relayer_game::{Module, Storage}, + } +} pub struct ExtBuilder { headers: Vec, diff --git a/frame/bridge/tron/backing/Cargo.toml b/frame/bridge/tron/backing/Cargo.toml index 2927f95932..14a3e4db55 100644 --- a/frame/bridge/tron/backing/Cargo.toml +++ b/frame/bridge/tron/backing/Cargo.toml @@ -11,12 +11,12 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } serde = { version = "1.0.124", optional = true } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/claims/Cargo.toml b/frame/claims/Cargo.toml index 93a9d35bc0..393c44dc23 100644 --- a/frame/claims/Cargo.toml +++ b/frame/claims/Cargo.toml @@ -12,17 +12,18 @@ version = "2.0.0" [dependencies] # crates array-bytes = { version = "1.1.0" } -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } +log = { version = "0.4.14" } serde = { version = "1.0.124", optional = true } serde_json = { version = "1.0.62", optional = true } # darwinia darwinia-support = { default-features = false, path = "../support" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # crates @@ -30,7 +31,7 @@ libsecp256k1 = { version = "0.3.5" } # darwinia darwinia-balances = { path = "../balances" } # substrate -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/claims/src/lib.rs b/frame/claims/src/lib.rs index 3639e3829e..0383b429cc 100644 --- a/frame/claims/src/lib.rs +++ b/frame/claims/src/lib.rs @@ -41,7 +41,7 @@ mod types { use codec::{Decode, Encode}; // --- substrate --- #[cfg(feature = "std")] -use frame_support::{debug::error, traits::WithdrawReasons}; +use frame_support::traits::WithdrawReasons; use frame_support::{ ensure, traits::{Currency, EnsureOrigin, ExistenceRequirement::KeepAlive, Get}, @@ -96,7 +96,7 @@ decl_error! { /// Ethereum address has no claim. SignerHasNoClaim, /// There's not enough in the pot to pay out some unvested amount. Generally implies a logic - /// error. + /// log::error. PotUnderflow, /// Can NOT Move Claim to an EXISTED Address. MoveToExistedAddress, @@ -125,7 +125,7 @@ decl_storage! { let mut total = >::zero(); if dot.is_empty() && eth.is_empty() && tron.is_empty() { - error!("[darwinia-claims] Genesis Claims List is Set to EMPTY"); + log::error!("[darwinia-claims] Genesis Claims List is Set to EMPTY"); } else { // Eth Address for Account { address, backed_ring } in dot { @@ -594,11 +594,11 @@ mod tests { // --- darwinia --- use crate::{self as darwinia_claims, secp_utils::*, *}; - type Balance = u64; - type Block = MockBlock; type UncheckedExtrinsic = MockUncheckedExtrinsic; + type Balance = u64; + const ETHEREUM_SIGNED_MESSAGE: &'static [u8] = b"\x19Ethereum Signed Message:\n"; const TRON_SIGNED_MESSAGE: &'static [u8] = b"\x19TRON Signed Message:\n"; diff --git a/frame/democracy/Cargo.toml b/frame/democracy/Cargo.toml index b2c58f7419..b5ad423b55 100644 --- a/frame/democracy/Cargo.toml +++ b/frame/democracy/Cargo.toml @@ -11,16 +11,16 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } serde = { version = "1.0.124", optional = true, features = ["derive"] } # darwinia darwinia-support = { default-features = false, path = "../support" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # crates @@ -29,10 +29,10 @@ hex-literal = "0.3.1" darwinia-balances = { path = "../balances" } darwinia-support = { features = ["easy-testing"], path = "../support" } # substrate -pallet-scheduler = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-storage = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -substrate-test-utils = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +pallet-scheduler = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-storage = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +substrate-test-utils = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/democracy/src/tests.rs b/frame/democracy/src/tests.rs index 765b6d51a6..af3e66fef1 100644 --- a/frame/democracy/src/tests.rs +++ b/frame/democracy/src/tests.rs @@ -4,12 +4,11 @@ use codec::Encode; // --- substrate --- use frame_support::{ - assert_noop, assert_ok, impl_outer_dispatch, impl_outer_event, impl_outer_origin, - ord_parameter_types, parameter_types, + assert_noop, assert_ok, ord_parameter_types, traits::{Contains, Filter, OnInitialize}, weights::Weight, }; -use frame_system::{EnsureRoot, EnsureSignedBy}; +use frame_system::{mocking::*, EnsureRoot, EnsureSignedBy}; use sp_core::H256; use sp_runtime::{ testing::Header, @@ -17,7 +16,7 @@ use sp_runtime::{ Perbill, }; // --- darwinia --- -use super::*; +use crate::{self as darwinia_democracy, *}; use darwinia_balances::Error as BalancesError; mod cancellation; @@ -31,6 +30,9 @@ mod public_proposals; mod scheduling; mod voting; +type Block = MockBlock; +type UncheckedExtrinsic = MockUncheckedExtrinsic; + type BlockNumber = u64; type Balance = u64; @@ -53,32 +55,7 @@ const BIG_NAY: Vote = Vote { const MAX_PROPOSALS: u32 = 100; -impl_outer_origin! { - pub enum Origin for Test where system = frame_system {} -} - -impl_outer_dispatch! { - pub enum Call for Test where origin: Origin { - frame_system::System, - pallet_balances::Balances, - democracy::Democracy, - } -} - -mod democracy { - pub use crate::Event; -} - -impl_outer_event! { - pub enum Event for Test { - system , - darwinia_balances Instance0, - pallet_scheduler , - democracy , - } -} - -darwinia_support::impl_test_account_data! { deprecated } +darwinia_support::impl_test_account_data! {} // Test that a fitlered call can be dispatched. pub struct BaseFilter; @@ -90,11 +67,7 @@ impl Filter for BaseFilter { ) } } - -// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. -#[derive(Clone, Eq, PartialEq, Debug)] -pub struct Test; -parameter_types! { +frame_support::parameter_types! { pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights::simple_max(1_000_000); } @@ -115,14 +88,14 @@ impl frame_system::Config for Test { type Event = Event; type BlockHashCount = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); type SS58Prefix = (); } -parameter_types! { +frame_support::parameter_types! { pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * BlockWeights::get().max_block; } impl pallet_scheduler::Config for Test { @@ -135,7 +108,7 @@ impl pallet_scheduler::Config for Test { type MaxScheduledPerBlock = (); type WeightInfo = (); } -parameter_types! { +frame_support::parameter_types! { pub const ExistentialDeposit: u64 = 1; } impl darwinia_balances::Config for Test { @@ -149,7 +122,7 @@ impl darwinia_balances::Config for Test { type OtherCurrencies = (); type WeightInfo = (); } -parameter_types! { +frame_support::parameter_types! { pub const LaunchPeriod: u64 = 2; pub const VotingPeriod: u64 = 2; pub const FastTrackVotingPeriod: u64 = 2; @@ -208,16 +181,31 @@ impl super::Config for Test { type MaxProposals = MaxProposals; } +frame_support::construct_runtime! { + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Module, Call, Config, Storage, Event}, + Balances: darwinia_balances::::{Module, Call, Storage, Config, Event}, + Scheduler: pallet_scheduler::{Module, Call, Storage, Config, Event}, + Democracy: darwinia_democracy::{Module, Call, Storage, Config, Event}, + } +} + pub fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default() .build_storage::() .unwrap(); - RingConfig { + darwinia_balances::GenesisConfig:: { balances: vec![(1, 10), (2, 20), (3, 30), (4, 40), (5, 50), (6, 60)], } .assimilate_storage(&mut t) .unwrap(); - GenesisConfig::default().assimilate_storage(&mut t).unwrap(); + darwinia_democracy::GenesisConfig::default() + .assimilate_storage(&mut t) + .unwrap(); let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| System::set_block_number(1)); ext @@ -229,11 +217,6 @@ pub fn new_test_ext_execute_with_cond(execute: impl FnOnce(bool) -> () + Clone) new_test_ext().execute_with(|| execute(true)); } -type System = frame_system::Module; -type Balances = darwinia_balances::Module; -type Scheduler = pallet_scheduler::Module; -type Democracy = Module; - #[test] fn params_should_work() { new_test_ext().execute_with(|| { @@ -267,7 +250,7 @@ fn set_balance_proposal_hash_and_note(value: u64) -> H256 { match Democracy::note_preimage(Origin::signed(6), p) { Ok(_) => (), Err(x) if x == Error::::DuplicatePreimage.into() => (), - Err(x) => panic!(x), + Err(x) => panic!("{:?}", x), } h } diff --git a/frame/democracy/src/vote.rs b/frame/democracy/src/vote.rs index 2f0608e440..3aa7f5bdbc 100644 --- a/frame/democracy/src/vote.rs +++ b/frame/democracy/src/vote.rs @@ -33,7 +33,7 @@ pub struct Vote { } impl Encode for Vote { - fn encode_to(&self, output: &mut T) { + fn encode_to(&self, output: &mut T) { output.push_byte(u8::from(self.conviction) | if self.aye { 0b1000_0000 } else { 0 }); } } diff --git a/frame/democracy/src/weights.rs b/frame/democracy/src/weights.rs index 55ca6921c7..6ff51f3a54 100644 --- a/frame/democracy/src/weights.rs +++ b/frame/democracy/src/weights.rs @@ -1,6 +1,6 @@ //! Weights for pallet_democracy //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0 -//! DATE: 2020-10-27, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! DATE: 2020-10-27, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: diff --git a/frame/dvm-dynamic-fee/Cargo.toml b/frame/dvm-dynamic-fee/Cargo.toml index 97d8d623ec..912b6bc7ab 100644 --- a/frame/dvm-dynamic-fee/Cargo.toml +++ b/frame/dvm-dynamic-fee/Cargo.toml @@ -11,19 +11,19 @@ version = "2.0.0" [dependencies] -codec = { default-features = false, version = "1.3.7", package = "parity-scale-codec" } -serde = { default-features = false, version = "1.0.123", optional = true, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +serde = { version = "1.0.123", default-features = false, features = ["derive"], optional = true } -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-inherents = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-inherents = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] -std = [ +std = [ "codec/std", "serde", "frame-support/std", @@ -32,4 +32,4 @@ std = [ "sp-inherents/std", "sp-runtime/std", "sp-std/std", -] \ No newline at end of file +] diff --git a/frame/dvm/Cargo.toml b/frame/dvm/Cargo.toml index fb1eef397d..9628c8d146 100644 --- a/frame/dvm/Cargo.toml +++ b/frame/dvm/Cargo.toml @@ -12,30 +12,30 @@ version = "2.0.0" [dependencies] # crates array-bytes = { version = "1.1.0" } -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } -ethereum = { version = "0.6.0", default-features = false, features = ["with-codec"] } -ethereum-types = { version = "0.10.0", default-features = false } -evm = { version = "0.23.0", default-features = false, features = ["with-codec"] } -libsecp256k1 = { version = "0.3", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +ethereum = { version = "0.7.1", default-features = false, features = ["with-codec"] } +ethereum-types = { version = "0.11.0", default-features = false } +evm = { version = "0.24.0", default-features = false, features = ["with-codec"] } +libsecp256k1 = { version = "0.3.5", default-features = false } rlp = { version = "0.5.0", default-features = false } serde = { version = "1.0.124", optional = true, default-features = false } -sha3 = { version = "0.8", default-features = false } +sha3 = { version = "0.9.1", default-features = false } # darwinia -darwinia-balances = { default-features = false, path = "../balances" } -darwinia-evm = { default-features = false, path = "../evm" } -darwinia-support = { default-features = false, path = "../support" } -dp_consensus = { default-features = false, path = "../../primitives/consensus" } -dp-evm = { default-features = false, path = "../../primitives/evm" } -dp-storage = { default-features = false, path = "../../primitives/storage" } -dvm-rpc-runtime-api = { default-features = false, path = "./rpc/runtime-api" } +darwinia-balances = { default-features = false, path = "../balances" } +darwinia-evm = { default-features = false, path = "../evm" } +darwinia-support = { default-features = false, path = "../support" } +dp-evm = { default-features = false, path = "../../primitives/evm" } +dp-storage = { default-features = false, path = "../../primitives/storage" } +dp_consensus = { default-features = false, path = "../../primitives/consensus" } +dvm-rpc-runtime-api = { default-features = false, path = "./rpc/runtime-api" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-timestamp = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-timestamp = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # crates diff --git a/frame/dvm/rpc/Cargo.toml b/frame/dvm/rpc/Cargo.toml index c1c9ca7146..6d1b3ede1f 100644 --- a/frame/dvm/rpc/Cargo.toml +++ b/frame/dvm/rpc/Cargo.toml @@ -11,9 +11,9 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } -ethereum = { version = "0.6.0", default-features = false, features = ["with-codec"] } -ethereum-types = { version = "0.10.0", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +ethereum = { version = "0.7.1", default-features = false, features = ["with-codec"] } +ethereum-types = { version = "0.11.0", default-features = false } jsonrpc-core = { version = "15.1.0" } jsonrpc-derive = { version = "15.1.0" } jsonrpc-pubsub = { version = "15.1.0" } @@ -23,10 +23,10 @@ darwinia-evm = { default-features = false, path = "../../evm" } dp-evm = { default-features = false, path = "../../../primitives/evm" } dp-rpc = { default-features = false, path = "../../../primitives/rpc" } # substrate -sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/dvm/rpc/runtime-api/Cargo.toml b/frame/dvm/rpc/runtime-api/Cargo.toml index fac18d29d0..d30fa13266 100644 --- a/frame/dvm/rpc/runtime-api/Cargo.toml +++ b/frame/dvm/rpc/runtime-api/Cargo.toml @@ -11,18 +11,18 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } -ethereum = { version = "0.6.0", default-features = false, features = ["with-codec"] } -ethereum-types = { version = "0.10.0", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +ethereum = { version = "0.7.1", default-features = false, features = ["with-codec"] } +ethereum-types = { version = "0.11.0", default-features = false } # darwinia darwinia-evm = { default-features = false, path = "../../../evm" } dp-evm = { default-features = false, path = "../../../../primitives/evm" } # substrate -sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/dvm/src/lib.rs b/frame/dvm/src/lib.rs index 9a8d633715..a22d02a223 100644 --- a/frame/dvm/src/lib.rs +++ b/frame/dvm/src/lib.rs @@ -26,6 +26,7 @@ use darwinia_evm::{AccountBasicMapping, FeeCalculator, GasWeightMapping, Runner}; use dp_consensus::{PostLog, PreLog, FRONTIER_ENGINE_ID}; use dp_evm::CallOrCreateInfo; +#[cfg(feature = "std")] use dp_storage::PALLET_ETHEREUM_SCHEMA; pub use dvm_rpc_runtime_api::TransactionStatus; // --- substrate --- diff --git a/frame/dvm/src/mock.rs b/frame/dvm/src/mock.rs index 418a77d640..ab21d1732a 100644 --- a/frame/dvm/src/mock.rs +++ b/frame/dvm/src/mock.rs @@ -16,36 +16,28 @@ //! Test utilities -use super::*; -use crate::account_basic::DVMAccountBasicMapping; -use crate::{Config, IntermediateStateRoot, Module}; +use crate::{self as dvm_ethereum, account_basic::DVMAccountBasicMapping, *}; +use codec::{Decode, Encode}; use darwinia_evm::{AddressMapping, EnsureAddressTruncated, FeeCalculator}; use ethereum::{TransactionAction, TransactionSignature}; -use frame_support::{impl_outer_origin, parameter_types, ConsensusEngineId}; +use frame_support::ConsensusEngineId; +use frame_system::mocking::*; use rlp::*; use sp_core::{H160, H256, U256}; -use sp_runtime::AccountId32; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, - ModuleId, Perbill, RuntimeDebug, + AccountId32, ModuleId, Perbill, RuntimeDebug, }; -use codec::{Decode, Encode}; +darwinia_support::impl_test_account_data! {} -impl_outer_origin! { - pub enum Origin for Test where system = frame_system {} -} -darwinia_support::impl_test_account_data! { deprecated } +type Block = MockBlock; +type UncheckedExtrinsic = MockUncheckedExtrinsic; type Balance = u64; -// For testing the pallet, we construct most of a mock runtime. This means -// first constructing a configuration type (`Test`) which `impl`s each of the -// configuration traits of pallets we want to use. -#[derive(Clone, Eq, PartialEq)] -pub struct Test; -parameter_types! { +frame_support::parameter_types! { pub const BlockHashCount: u64 = 250; pub const MaximumBlockWeight: Weight = 1024; pub const MaximumBlockLength: u32 = 2 * 1024; @@ -58,7 +50,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type Origin = Origin; - type Call = (); + type Call = Call; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -69,7 +61,7 @@ impl frame_system::Config for Test { type Event = (); type BlockHashCount = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); @@ -77,7 +69,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); } -parameter_types! { +frame_support::parameter_types! { // For weight estimation, we assume that the most locks on an individual account will be 50. // This number may need to be adjusted in the future if this assumption no longer holds true. pub const MaxLocks: u32 = 10; @@ -108,7 +100,7 @@ impl darwinia_balances::Config for Test { type BalanceInfo = AccountData; } -parameter_types! { +frame_support::parameter_types! { pub const MinimumPeriod: u64 = 6000 / 2; } @@ -136,7 +128,7 @@ impl FindAuthor for EthereumFindAuthor { } } -parameter_types! { +frame_support::parameter_types! { pub const TransactionByteFee: u64 = 1; pub const ChainId: u64 = 42; pub const EVMModuleId: ModuleId = ModuleId(*b"py/evmpa"); @@ -167,7 +159,7 @@ impl darwinia_evm::Config for Test { type AccountBasicMapping = DVMAccountBasicMapping; } -parameter_types! { +frame_support::parameter_types! { pub const BlockGasLimit: U256 = U256::MAX; } @@ -179,9 +171,20 @@ impl Config for Test { type RingCurrency = Ring; } -pub type System = frame_system::Module; -pub type Ethereum = Module; -pub type Evm = darwinia_evm::Module; +frame_support::construct_runtime! { + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Module, Call, Config, Storage}, + Timestamp: pallet_timestamp::{Module, Call, Storage}, + Ring: darwinia_balances::::{Module, Call, Storage, Config}, + Kton: darwinia_balances::::{Module, Call, Storage}, + EVM: darwinia_evm::{Module, Call, Storage}, + Ethereum: dvm_ethereum::{Module, Call, Storage}, + } +} pub struct AccountInfo { pub address: H160, @@ -221,7 +224,7 @@ pub fn new_test_ext(accounts_len: usize) -> (Vec, sp_io::TestExtern .map(|i| (pairs[i].account_id.clone(), 100_000_000_000)) .collect(); - RingConfig { balances } + darwinia_balances::GenesisConfig:: { balances } .assimilate_storage(&mut ext) .unwrap(); diff --git a/frame/dvm/src/tests.rs b/frame/dvm/src/tests.rs index d147fba5d1..b89e5e7041 100644 --- a/frame/dvm/src/tests.rs +++ b/frame/dvm/src/tests.rs @@ -18,6 +18,7 @@ //! Consensus extension module tests for BABE consensus. use super::*; +use crate::Call; use codec::Decode; use ethereum::TransactionSignature; use frame_support::{assert_err, assert_noop, assert_ok, unsigned::ValidateUnsigned}; @@ -167,7 +168,7 @@ fn contract_constructor_should_get_executed() { None, )); assert_eq!( - Evm::account_storages(erc20_address, alice_storage_address), + EVM::account_storages(erc20_address, alice_storage_address), H256::from_str("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff") .unwrap() ) @@ -191,7 +192,7 @@ fn source_should_be_derived_from_signature() { // We verify the transaction happened with alice account. assert_eq!( - Evm::account_storages(erc20_address, alice_storage_address), + EVM::account_storages(erc20_address, alice_storage_address), H256::from_str("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff") .unwrap() ) @@ -237,7 +238,7 @@ fn contract_should_be_created_at_given_address() { t.action, None, )); - assert_ne!(Evm::account_codes(erc20_address).len(), 0); + assert_ne!(EVM::account_codes(erc20_address).len(), 0); }); } @@ -410,7 +411,7 @@ fn withdraw_without_enough_balance_should_fail() { assert_err!( res, DispatchError::Module { - index: 0, + index: 4, error: 0, message: Some("BalanceLow") } diff --git a/frame/elections-phragmen/Cargo.toml b/frame/elections-phragmen/Cargo.toml index bcb0640dd7..75a6f8c3a7 100644 --- a/frame/elections-phragmen/Cargo.toml +++ b/frame/elections-phragmen/Cargo.toml @@ -11,16 +11,17 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +log = { version = "0.4.14" } serde = { version = "1.0.124", optional = true } # darwinia darwinia-support = { default-features = false, path = "../support" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-npos-elections = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-npos-elections = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # crates @@ -29,9 +30,9 @@ hex-literal = { version = "0.3.1" } darwinia-balances = { path = "../balances" } darwinia-support = { path = "../support", features = ["easy-testing"] } # substrate -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -substrate-test-utils = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +substrate-test-utils = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/elections-phragmen/src/lib.rs b/frame/elections-phragmen/src/lib.rs index b66c9d3e5a..79887ec682 100644 --- a/frame/elections-phragmen/src/lib.rs +++ b/frame/elections-phragmen/src/lib.rs @@ -685,8 +685,9 @@ impl Module { } else { // overlap. This can never happen. If so, it seems like our intended replacement // is already a member, so not much more to do. - frame_support::debug::error!( - "pallet-elections-phragmen: a member seems to also be a runner-up." + log::error!( + target: "runtime::elections-phragmen", + "A member seems to also be a runner-up.", ); } next_best @@ -1005,7 +1006,11 @@ impl Module { }, ) .map_err(|e| { - frame_support::debug::error!("elections-phragmen: failed to run election [{:?}].", e); + log::error!( + target: "runtime::elections-phragmen", + "Failed to run election [{:?}].", + e, + ); Self::deposit_event(RawEvent::ElectionError); }); @@ -1054,9 +1059,8 @@ impl ContainsLengthBound for Module { #[cfg(test)] mod tests { - use super::*; - use crate as elections_phragmen; - use frame_support::{assert_noop, assert_ok, parameter_types, traits::OnInitialize}; + use crate::{self as elections_phragmen, *}; + use frame_support::{assert_noop, assert_ok, traits::OnInitialize}; use sp_core::H256; use sp_runtime::{ testing::Header, @@ -1066,8 +1070,10 @@ mod tests { use substrate_test_utils::assert_eq_uvec; type Balance = u64; - darwinia_support::impl_test_account_data! { deprecated } - parameter_types! { + + darwinia_support::impl_test_account_data! {} + + frame_support::parameter_types! { pub const ExistentialDeposit: Balance = 1; pub const MaxLocks: u32 = 1024; } @@ -1083,7 +1089,7 @@ mod tests { type WeightInfo = (); } - parameter_types! { + frame_support::parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights::simple_max(1024); @@ -1106,7 +1112,7 @@ mod tests { type Event = Event; type BlockHashCount = BlockHashCount; type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); @@ -1172,7 +1178,7 @@ mod tests { } } - parameter_types! { + frame_support::parameter_types! { pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect"; } @@ -1264,7 +1270,7 @@ mod tests { .collect::>() }); let mut ext: sp_io::TestExternalities = GenesisConfig { - darwinia_balances_Instance0: Some(RingConfig { + darwinia_balances_Instance0: darwinia_balances::GenesisConfig:: { balances: vec![ (1, 10 * self.balance_factor), (2, 20 * self.balance_factor), @@ -1273,10 +1279,10 @@ mod tests { (5, 50 * self.balance_factor), (6, 60 * self.balance_factor), ], - }), - elections_phragmen: Some(elections_phragmen::GenesisConfig:: { + }, + elections_phragmen: elections_phragmen::GenesisConfig:: { members: self.genesis_members, - }), + }, } .build_storage() .unwrap() @@ -2549,17 +2555,14 @@ mod tests { // no replacement yet. let unwrapped_error = Elections::remove_member(Origin::root(), 4, true).unwrap_err(); - matches!( + assert!(matches!( unwrapped_error.error, DispatchError::Module { message: Some("InvalidReplacement"), .. } - ); - matches!( - unwrapped_error.post_info.actual_weight, - Some(x) if x < ::BlockWeights::get().max_block - ); + )); + assert!(unwrapped_error.post_info.actual_weight.is_some()); }); ExtBuilder::default() @@ -2581,17 +2584,14 @@ mod tests { // there is a replacement! and this one needs a weight refund. let unwrapped_error = Elections::remove_member(Origin::root(), 4, false).unwrap_err(); - matches!( + assert!(matches!( unwrapped_error.error, DispatchError::Module { message: Some("InvalidReplacement"), .. } - ); - matches!( - unwrapped_error.post_info.actual_weight, - Some(x) if x < ::BlockWeights::get().max_block - ); + )); + assert!(unwrapped_error.post_info.actual_weight.is_some()); }); } diff --git a/frame/elections-phragmen/src/weights.rs b/frame/elections-phragmen/src/weights.rs index 1f18852875..65c38304d9 100644 --- a/frame/elections-phragmen/src/weights.rs +++ b/frame/elections-phragmen/src/weights.rs @@ -1,7 +1,7 @@ //! Autogenerated weights for pallet_elections_phragmen //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.1 -//! DATE: 2021-01-20, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! DATE: 2021-01-20, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: diff --git a/frame/evm/Cargo.toml b/frame/evm/Cargo.toml index 92c4413102..b55e02efbb 100644 --- a/frame/evm/Cargo.toml +++ b/frame/evm/Cargo.toml @@ -11,25 +11,26 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } -evm = { version = "0.23.0", default-features = false, features = ["with-codec"] } -evm-gasometer = { version = "0.23.0", default-features = false } -evm-runtime = { version = "0.23.0", default-features = false } -primitive-types = { version = "0.8.0", default-features = false, features = ["rlp", "byteorder"] } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +evm = { version = "0.24.0", default-features = false, features = ["with-codec"] } +evm-gasometer = { version = "0.24.0", default-features = false } +evm-runtime = { version = "0.24.0", default-features = false } +log = { version = "0.4.14" } +primitive-types = { version = "0.9.0", default-features = false, features = ["rlp", "byteorder"] } rlp = { version = "0.5.0", default-features = false } serde = { version = "1.0.124", optional = true, default-features = false, features = ["derive"] } sha3 = { version = "0.8", default-features = false } # darwinia -darwinia-balances = { default-features = false, path = "../balances" } -dp-evm = { default-features = false, path = "../../primitives/evm" } +darwinia-balances = { default-features = false, path = "../balances" } +dp-evm = { default-features = false, path = "../../primitives/evm" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-timestamp = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-timestamp = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] darwinia-support = { features = ["easy-testing"], path = "../support" } diff --git a/frame/evm/precompile/contracts/blake2/Cargo.toml b/frame/evm/precompile/contracts/blake2/Cargo.toml index ab50111fe4..74509e378e 100644 --- a/frame/evm/precompile/contracts/blake2/Cargo.toml +++ b/frame/evm/precompile/contracts/blake2/Cargo.toml @@ -12,11 +12,11 @@ version = "2.0.0" [dependencies] # crates -evm = { default-features = false, version = "0.23.0", features = ["with-codec"] } dp-evm = { default-features = false, path = "../../../../../primitives/evm" } +evm = { version = "0.24.0", default-features = false, features = ["with-codec"] } # substrate -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/evm/precompile/contracts/bn128/Cargo.toml b/frame/evm/precompile/contracts/bn128/Cargo.toml index e947cc5ee2..cf7efafb54 100644 --- a/frame/evm/precompile/contracts/bn128/Cargo.toml +++ b/frame/evm/precompile/contracts/bn128/Cargo.toml @@ -12,12 +12,12 @@ version = "2.0.0" [dependencies] # crates -bn = { default-features = false, package = "substrate-bn", version = "0.5" } +bn = { package = "substrate-bn", version = "0.5", default-features = false } dp-evm = { default-features = false, path = "../../../../../primitives/evm" } -evm = { default-features = false, version = "0.23.0", features = ["with-codec"] } +evm = { version = "0.24.0", default-features = false, features = ["with-codec"] } # substrate -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/evm/precompile/contracts/dispatch/Cargo.toml b/frame/evm/precompile/contracts/dispatch/Cargo.toml index 858a63aaed..aa4f1054f6 100644 --- a/frame/evm/precompile/contracts/dispatch/Cargo.toml +++ b/frame/evm/precompile/contracts/dispatch/Cargo.toml @@ -12,14 +12,14 @@ version = "2.0.0" [dependencies] # crates -codec = { default-features = false, package = "parity-scale-codec", version = "1.3.7" } -darwinia-evm = { default-features = false, path = "../../../../evm" } -dp-evm = { default-features = false, path = "../../../../../primitives/evm" } -evm = { default-features = false, version = "0.23.0", features = ["with-codec"] } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +darwinia-evm = { default-features = false, path = "../../../../evm" } +dp-evm = { default-features = false, path = "../../../../../primitives/evm" } +evm = { version = "0.24.0", default-features = false, features = ["with-codec"] } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/evm/precompile/contracts/ed25519/Cargo.toml b/frame/evm/precompile/contracts/ed25519/Cargo.toml index 60d388c380..29a188e93f 100644 --- a/frame/evm/precompile/contracts/ed25519/Cargo.toml +++ b/frame/evm/precompile/contracts/ed25519/Cargo.toml @@ -11,12 +11,12 @@ version = "2.0.0" [dependencies] # crates -dp-evm = { default-features = false, path = "../../../../../primitives/evm" } -ed25519-dalek = { default-features = false, version = "1.0.0", features = ["alloc", "u64_backend"] } -evm = { default-features = false, version = "0.23.0", features = ["with-codec"] } +dp-evm = { default-features = false, path = "../../../../../primitives/evm" } +ed25519-dalek = { version = "1.0.0", default-features = false, features = ["alloc", "u64_backend"] } +evm = { version = "0.24.0", default-features = false, features = ["with-codec"] } # substrate -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/evm/precompile/contracts/empty/Cargo.toml b/frame/evm/precompile/contracts/empty/Cargo.toml index 0e0c87f42a..0b7126be2d 100644 --- a/frame/evm/precompile/contracts/empty/Cargo.toml +++ b/frame/evm/precompile/contracts/empty/Cargo.toml @@ -12,7 +12,7 @@ version = "2.0.0" [dependencies] # crates dp-evm = { default-features = false, path = "../../../../../primitives/evm" } -evm = { default-features = false, version = "0.23.0", features = ["with-codec"] } +evm = { version = "0.24.0", default-features = false, features = ["with-codec"] } [features] default = ["std"] diff --git a/frame/evm/precompile/contracts/kton/Cargo.toml b/frame/evm/precompile/contracts/kton/Cargo.toml index 267dd52e6b..d4b1d38643 100644 --- a/frame/evm/precompile/contracts/kton/Cargo.toml +++ b/frame/evm/precompile/contracts/kton/Cargo.toml @@ -11,25 +11,25 @@ version = "2.0.0" [dependencies] # crates -array-bytes = { version = "1.1.0" } -codec = { default-features = false, package = "parity-scale-codec", version = "1.3.7" } -ethabi = { default-features = false, git = "https://github.com/darwinia-network/ethabi.git", branch = "with_no_std" } -ethereum-types = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } -evm = { version = "0.23.0", default-features = false, features = ["with-codec"] } -hex = { version = "0.4", default-features = false } -ripemd160 = { version = "0.9", default-features = false } -sha3 = { version = "0.8", default-features = false } +array-bytes = { version = "1.1.0" } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +ethereum-types = { version = "0.11.0", default-features = false } +evm = { version = "0.24.0", default-features = false, features = ["with-codec"] } +hex = { version = "0.4.3", default-features = false } +ripemd160 = { version = "0.9.1", default-features = false } +sha3 = { version = "0.9.1", default-features = false } # darwinia darwinia-evm = { default-features = false, path = "../../../" } dp-evm = { default-features = false, path = "../../../../../primitives/evm" } +ethabi = { default-features = false, git = "https://github.com/darwinia-network/ethabi.git", branch = "xavier-no-std" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-timestamp = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-timestamp = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] @@ -42,15 +42,17 @@ std = [ crates-std = [ "codec/std", - "dp-evm/std", - "ethabi/std", "ethereum-types/std", "evm/std", + "hex/std", "ripemd160/std", + "sha3/std", ] darwinia-std = [ "darwinia-evm/std", + "dp-evm/std", + "ethabi/std", ] substrate-std = [ diff --git a/frame/evm/precompile/contracts/modexp/Cargo.toml b/frame/evm/precompile/contracts/modexp/Cargo.toml index c7a862029e..0b7b2fc28a 100644 --- a/frame/evm/precompile/contracts/modexp/Cargo.toml +++ b/frame/evm/precompile/contracts/modexp/Cargo.toml @@ -13,11 +13,11 @@ version = "2.0.0" [dependencies] # crates dp-evm = { default-features = false, path = "../../../../../primitives/evm" } -evm = { default-features = false, version = "0.23.0", features = ["with-codec"] } -num = { default-features = false, version = "0.3", features = ["alloc"] } +evm = { version = "0.24.0", default-features = false, features = ["with-codec"] } +num = { version = "0.3", default-features = false, features = ["alloc"] } # substrate -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] hex = "0.4.0" diff --git a/frame/evm/precompile/contracts/simple/Cargo.toml b/frame/evm/precompile/contracts/simple/Cargo.toml index 1c1a4ad9e3..c49d6b3918 100644 --- a/frame/evm/precompile/contracts/simple/Cargo.toml +++ b/frame/evm/precompile/contracts/simple/Cargo.toml @@ -12,11 +12,11 @@ version = "2.0.0" [dependencies] # crates dp-evm = { default-features = false, path = "../../../../../primitives/evm" } -evm = { default-features = false, version = "0.23.0", features = ["with-codec"] } -ripemd160 = { default-features = false, version = "0.9" } +evm = { version = "0.24.0", default-features = false, features = ["with-codec"] } +ripemd160 = { version = "0.9", default-features = false } # substrate -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/evm/precompile/contracts/withdraw/Cargo.toml b/frame/evm/precompile/contracts/withdraw/Cargo.toml index 6e3b20bf08..60d4e34701 100644 --- a/frame/evm/precompile/contracts/withdraw/Cargo.toml +++ b/frame/evm/precompile/contracts/withdraw/Cargo.toml @@ -11,20 +11,20 @@ version = "2.0.0" [dependencies] # crates -codec = { default-features = false, package = "parity-scale-codec", version = "1.3.7" } -evm = { default-features = false, version = "0.23.0", features = ["with-codec"] } -ripemd160 = { default-features = false, version = "0.9" } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +evm = { version = "0.24.0", features = ["with-codec"], default-features = false } +ripemd160 = { version = "0.9", default-features = false } # darwinia darwinia-evm = { default-features = false, path = "../../../" } dp-evm = { default-features = false, path = "../../../../../primitives/evm" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-timestamp = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-timestamp = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/evm/src/lib.rs b/frame/evm/src/lib.rs index c89aecc70a..87b8e8fcb8 100644 --- a/frame/evm/src/lib.rs +++ b/frame/evm/src/lib.rs @@ -184,8 +184,8 @@ pub struct ConcatAddressMapping; /// The ConcatAddressMapping used for transfer from evm 20-length to substrate 32-length address /// The concat rule inclued three parts: /// 1. AccountId Prefix: concat("dvm", "0x00000000000000"), length: 11 byetes -/// 2. Evm address: the original evm address, length: 20 bytes -/// 3. CheckSum: byte_xor(AccountId Prefix + Evm address), length: 1 bytes +/// 2. EVM address: the original evm address, length: 20 bytes +/// 3. CheckSum: byte_xor(AccountId Prefix + EVM address), length: 1 bytes impl AddressMapping for ConcatAddressMapping { fn into_account_id(address: H160) -> AccountId32 { let mut data = [0u8; 32]; diff --git a/frame/evm/src/runner/stack.rs b/frame/evm/src/runner/stack.rs index b96bd996c2..73f0b457c5 100644 --- a/frame/evm/src/runner/stack.rs +++ b/frame/evm/src/runner/stack.rs @@ -27,7 +27,7 @@ use crate::{ use dp_evm::{Account, CallInfo, CreateInfo, ExecutionInfo, Log, Vicinity}; // --- substrate --- use frame_support::{ - debug, ensure, + ensure, storage::{StorageDoubleMap, StorageMap}, traits::Get, }; @@ -104,7 +104,7 @@ impl Runner { let used_gas = U256::from(executor.used_gas()); let actual_fee = executor.fee(gas_price); - debug::debug!( + log::debug!( target: "evm", "Execution {:?} [source: {:?}, value: {}, gas_limit: {}, actual_fee: {}]", reason, @@ -118,7 +118,7 @@ impl Runner { let state = executor.into_state(); for address in state.substate.deletes { - debug::debug!( + log::debug!( target: "evm", "Deleting account at {:?}", address @@ -126,20 +126,20 @@ impl Runner { Module::::remove_account(&address) } - for log in &state.substate.logs { - debug::trace!( + for substrate_log in &state.substate.logs { + log::trace!( target: "evm", "Inserting log for {:?}, topics ({}) {:?}, data ({}): {:?}]", - log.address, - log.topics.len(), - log.topics, - log.data.len(), - log.data + substrate_log.address, + substrate_log.topics.len(), + substrate_log.topics, + substrate_log.data.len(), + substrate_log.data ); Module::::deposit_event(Event::::Log(Log { - address: log.address, - topics: log.topics.clone(), - data: log.data.clone(), + address: substrate_log.address, + topics: substrate_log.topics.clone(), + data: substrate_log.data.clone(), })); } @@ -456,7 +456,7 @@ impl<'vicinity, 'config, T: Config> StackStateT<'config> fn set_storage(&mut self, address: H160, index: H256, value: H256) { if value == H256::default() { - debug::debug!( + log::debug!( target: "evm", "Removing storage for {:?} [index: {:?}]", address, @@ -464,7 +464,7 @@ impl<'vicinity, 'config, T: Config> StackStateT<'config> ); AccountStorages::remove(address, index); } else { - debug::debug!( + log::debug!( target: "evm", "Updating storage for {:?} [index: {:?}, value: {:?}]", address, @@ -488,7 +488,7 @@ impl<'vicinity, 'config, T: Config> StackStateT<'config> } fn set_code(&mut self, address: H160, code: Vec) { - debug::debug!( + log::debug!( target: "evm", "Inserting code ({} bytes) at {:?}", code.len(), diff --git a/frame/evm/src/tests.rs b/frame/evm/src/tests.rs index b034f4923c..00da17b432 100644 --- a/frame/evm/src/tests.rs +++ b/frame/evm/src/tests.rs @@ -1,8 +1,8 @@ #![cfg(test)] -use super::*; - -use frame_support::{assert_ok, impl_outer_dispatch, impl_outer_origin, parameter_types}; +use crate::{self as darwinia_evm, *}; +use frame_support::assert_ok; +use frame_system::mocking::*; use sp_core::{Blake2Hasher, H256}; use sp_runtime::{ testing::Header, @@ -11,22 +11,12 @@ use sp_runtime::{ }; use std::{collections::BTreeMap, str::FromStr}; -type Balance = u64; - -impl_outer_origin! { - pub enum Origin for Test where system = frame_system {} -} - -impl_outer_dispatch! { - pub enum OuterCall for Test where origin: Origin { - self::EVM, - } -} +type Block = MockBlock; +type UncheckedExtrinsic = MockUncheckedExtrinsic; -darwinia_support::impl_test_account_data! { deprecated } +type Balance = u64; -#[derive(Clone, Eq, PartialEq, Debug)] -pub struct Test; +darwinia_support::impl_test_account_data! {} impl frame_system::Config for Test { type BaseCallFilter = (); @@ -37,15 +27,15 @@ impl frame_system::Config for Test { type Index = u64; type BlockNumber = u64; type Hash = H256; - type Call = OuterCall; + type Call = Call; type Hashing = BlakeTwo256; type AccountId = AccountId32; type Lookup = IdentityLookup; type Header = Header; - type Event = (); + type Event = Event; type BlockHashCount = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); @@ -53,13 +43,13 @@ impl frame_system::Config for Test { type SS58Prefix = (); } -parameter_types! { +frame_support::parameter_types! { pub const ExistentialDeposit: u64 = 1; } impl darwinia_balances::Config for Test { type Balance = Balance; type DustRemoval = (); - type Event = (); + type Event = Event; type ExistentialDeposit = ExistentialDeposit; type BalanceInfo = AccountData; type AccountStore = System; @@ -70,7 +60,7 @@ impl darwinia_balances::Config for Test { impl darwinia_balances::Config for Test { type Balance = Balance; type DustRemoval = (); - type Event = (); + type Event = Event; type ExistentialDeposit = ExistentialDeposit; type BalanceInfo = AccountData; type AccountStore = System; @@ -79,7 +69,7 @@ impl darwinia_balances::Config for Test { type WeightInfo = (); } -parameter_types! { +frame_support::parameter_types! { pub const MinimumPeriod: u64 = 1000; } impl pallet_timestamp::Config for Test { @@ -108,15 +98,26 @@ impl Config for Test { type RingCurrency = Ring; type KtonCurrency = Kton; - type Event = Event; + type Event = Event; type Precompiles = (); type ChainId = (); type Runner = crate::runner::stack::Runner; type AccountBasicMapping = RawAccountBasicMapping; } -type System = frame_system::Module; -type EVM = Module; +frame_support::construct_runtime! { + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Module, Call, Config, Storage, Event}, + Timestamp: pallet_timestamp::{Module, Call, Storage}, + Ring: darwinia_balances::::{Module, Call, Storage, Config, Event}, + Kton: darwinia_balances::::{Module, Call, Storage, Config, Event}, + EVM: darwinia_evm::{Module, Call, Storage, Config, Event}, + } +} pub fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default() @@ -147,8 +148,13 @@ pub fn new_test_ext() -> sp_io::TestExternalities { }, ); - RingConfig::default().assimilate_storage(&mut t).unwrap(); - GenesisConfig { accounts } + >::default() + .assimilate_storage(&mut t) + .unwrap(); + >::default() + .assimilate_storage(&mut t) + .unwrap(); + darwinia_evm::GenesisConfig { accounts } .assimilate_storage::(&mut t) .unwrap(); t.into() diff --git a/frame/header-mmr/Cargo.toml b/frame/header-mmr/Cargo.toml index 636a93b910..097289ff96 100644 --- a/frame/header-mmr/Cargo.toml +++ b/frame/header-mmr/Cargo.toml @@ -11,7 +11,8 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +log = { version = "0.4.14" } serde = { version = "1.0.124", optional = true } # darwinia darwinia-header-mmr-rpc-runtime-api = { default-features = false, path = "./rpc/runtime-api" } @@ -20,18 +21,18 @@ darwinia-support = { default-features = false, path = "../sup # github merkle-mountain-range = { package = "ckb-merkle-mountain-range", default-features = false, git = "https://github.com/darwinia-network/merkle-mountain-range.git" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # crates array-bytes = { version = "1.1.0" } serde_json = { version = "1.0.62" } # substrate -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/header-mmr/rpc/Cargo.toml b/frame/header-mmr/rpc/Cargo.toml index 68bea4e19c..7b80ec21a0 100644 --- a/frame/header-mmr/rpc/Cargo.toml +++ b/frame/header-mmr/rpc/Cargo.toml @@ -11,13 +11,13 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7" } +codec = { package = "parity-scale-codec", version = "2.0.1" } jsonrpc-core = { version = "15.1.0" } jsonrpc-core-client = { version = "15.1.0" } jsonrpc-derive = { version = "15.1.0" } # darwinia darwinia-header-mmr-rpc-runtime-api = { path = "./runtime-api" } # substrate -sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } diff --git a/frame/header-mmr/rpc/runtime-api/Cargo.toml b/frame/header-mmr/rpc/runtime-api/Cargo.toml index aa57047657..7a6779e04b 100644 --- a/frame/header-mmr/rpc/runtime-api/Cargo.toml +++ b/frame/header-mmr/rpc/runtime-api/Cargo.toml @@ -11,14 +11,14 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } serde = { version = "1.0.124", optional = true, features = ["derive"] } # darwinia darwinia-support = { default-features = false, path = "../../../support" } # substrate -sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/header-mmr/src/lib.rs b/frame/header-mmr/src/lib.rs index 7c5ab9241b..7bc8104609 100644 --- a/frame/header-mmr/src/lib.rs +++ b/frame/header-mmr/src/lib.rs @@ -68,7 +68,7 @@ use merkle_mountain_range::{ }; // --- substrate --- use codec::{Decode, Encode}; -use frame_support::{debug::error, decl_module, decl_storage}; +use frame_support::{decl_module, decl_storage}; use sp_runtime::{ generic::{DigestItem, OpaqueDigestItemId}, traits::{Hash, Header}, @@ -126,10 +126,10 @@ decl_module! { >::deposit_log(mmr_item.into()); } else { - error!("[darwinia-header-mmr] FAILED to Commit MMR"); + log::error!("[darwinia-header-mmr] FAILED to Commit MMR"); } } else { - error!("[darwinia-header-mmr] FAILED to Calculate MMR"); + log::error!("[darwinia-header-mmr] FAILED to Calculate MMR"); } } } diff --git a/frame/staking/Cargo.toml b/frame/staking/Cargo.toml index 35b9464fef..0edb4ba713 100644 --- a/frame/staking/Cargo.toml +++ b/frame/staking/Cargo.toml @@ -11,7 +11,8 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } +log = { version = "0.4.14" } rand_chacha = { version = "0.2", default-features = false, optional = true } serde = { version = "1.0.124", optional = true } static_assertions = { version = "1.1.0" } @@ -21,17 +22,19 @@ darwinia-support = { default-features = false, path = "../suppor # github substrate-fixed = { default-features = false, git = "https://github.com/encointer/substrate-fixed", branch = "master" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-authorship = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -pallet-session = { default-features = false, features = ["historical"], git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-arithmetic = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-npos-elections = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-staking = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-authorship = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +pallet-session = { default-features = false, features = ["historical"], git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-arithmetic = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-election-providers = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +# TWO_PHASE_NOTE:: ideally we should be able to get rid of this. +sp-npos-elections = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-staking = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # crates @@ -40,10 +43,10 @@ rand_chacha = { version = "0.2" } darwinia-balances = { path = "../../frame/balances" } darwinia-support = { features = ["easy-testing"], path = "../support" } # substrate -pallet-timestamp = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-storage = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-tracing = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -substrate-test-utils = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +pallet-timestamp = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-storage = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-tracing = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +substrate-test-utils = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] @@ -71,6 +74,7 @@ substrate-std = [ "pallet-session/std", "sp-arithmetic/std", "sp-core/std", + "sp-election-providers/std", "sp-io/std", "sp-npos-elections/std", "sp-runtime/std", diff --git a/frame/staking/rpc/Cargo.toml b/frame/staking/rpc/Cargo.toml index 50e5d92594..d5c8e09fe0 100644 --- a/frame/staking/rpc/Cargo.toml +++ b/frame/staking/rpc/Cargo.toml @@ -11,13 +11,13 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7" } +codec = { package = "parity-scale-codec", version = "2.0.1" } jsonrpc-core = { version = "15.1.0" } jsonrpc-core-client = { version = "15.1.0" } jsonrpc-derive = { version = "15.1.0" } # darwinia darwinia-staking-rpc-runtime-api = { path = "./runtime-api" } # substrate -sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } diff --git a/frame/staking/rpc/runtime-api/Cargo.toml b/frame/staking/rpc/runtime-api/Cargo.toml index ab4c58aaea..0c224ef719 100644 --- a/frame/staking/rpc/runtime-api/Cargo.toml +++ b/frame/staking/rpc/runtime-api/Cargo.toml @@ -11,13 +11,13 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } serde = { version = "1.0.124", optional = true, features = ["derive"] } # darwinia darwinia-support = { default-features = false, path = "../../../support" } # substrate -sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/staking/src/inflation.rs b/frame/staking/src/inflation.rs index e0614a272a..15cf38a177 100644 --- a/frame/staking/src/inflation.rs +++ b/frame/staking/src/inflation.rs @@ -22,7 +22,6 @@ use substrate_fixed::{ types::I64F64, }; // --- substrate --- -use frame_support::debug::*; use sp_arithmetic::helpers_128bit::multiply_by_rational; use sp_core::U256; use sp_runtime::Perbill; @@ -45,7 +44,7 @@ pub fn compute_total_payout( total_left: RingBalance, payout_fraction: Perbill, ) -> (RingBalance, RingBalance) { - info!( + log::info!( target: "darwinia-staking", "era_duration: {}, living_time: {}, total_left: {:?}, payout_fraction: {:?}", era_duration, @@ -111,10 +110,10 @@ pub fn compute_inflation(maximum: Balance, year: u32) -> Option { return Some(e.floor().to_num()); } else { - error!(target: "darwniia-staking", "Compute Inflation Failed at Step 1"); + log::error!(target: "darwniia-staking", "Compute Inflation Failed at Step 1"); } } else { - error!(target: "darwniia-staking", "Compute Inflation Failed at Step 0"); + log::error!(target: "darwniia-staking", "Compute Inflation Failed at Step 0"); } None diff --git a/frame/staking/src/lib.rs b/frame/staking/src/lib.rs index 49213e68ce..1dfee78bef 100644 --- a/frame/staking/src/lib.rs +++ b/frame/staking/src/lib.rs @@ -356,7 +356,7 @@ mod types { } // --- darwinia --- -pub use types::EraIndex; +pub use types::{CompactAssignments, EraIndex}; // --- crates --- use codec::{Decode, Encode, HasCompact}; @@ -376,10 +376,11 @@ use frame_support::{ }, }; use frame_system::{ensure_none, ensure_root, ensure_signed, offchain::SendTransactionTypes}; +use sp_election_providers::ElectionProvider; use sp_npos_elections::{ - generate_solution_type, is_score_better, seq_phragmen, to_support_map, Assignment, + generate_solution_type, is_score_better, seq_phragmen, to_supports, Assignment, CompactSolution, ElectionResult as PrimitiveElectionResult, ElectionScore, EvaluateSupport, - ExtendedBalance, PerThing128, SupportMap, VoteWeight, + ExtendedBalance, PerThing128, Supports, VoteWeight, }; use sp_runtime::{ helpers_128bit::multiply_by_rational, @@ -414,22 +415,22 @@ use darwinia_support::{ }; use types::*; -pub(crate) const LOG_TARGET: &'static str = "staking"; +pub(crate) const LOG_TARGET: &'static str = "runtime::staking"; // syntactic sugar for logging. #[macro_export] macro_rules! log { ($level:tt, $patter:expr $(, $values:expr)* $(,)?) => { - frame_support::debug::$level!( + log::$level!( target: crate::LOG_TARGET, - $patter $(, $values)* + concat!("💸 ", $patter) $(, $values)* ) }; } pub const MAX_NOMINATIONS: usize = ::LIMIT; +pub const MAX_UNLOCKING_CHUNKS: usize = 32; -pub(crate) const MAX_UNLOCKING_CHUNKS: usize = 32; /// Maximum number of stakers that can be stored in a snapshot. pub(crate) const MAX_VALIDATORS: usize = ValidatorIndex::max_value() as usize; pub(crate) const MAX_NOMINATORS: usize = NominatorIndex::max_value() as usize; @@ -450,6 +451,14 @@ pub trait Config: frame_system::Config + SendTransactionTypes> { /// is not used. type UnixTime: UnixTime; + /// Something that provides the election functionality. + type ElectionProvider: sp_election_providers::ElectionProvider< + Self::AccountId, + Self::BlockNumber, + // we only accept an election provider that has staking as data provider. + DataProvider = Module, + >; + /// Number of sessions per era. type SessionsPerEra: Get; @@ -878,28 +887,45 @@ decl_storage! { /// The earliest era for which we have a pending, unapplied slash. EarliestUnappliedSlash: Option; + /// The last planned session scheduled by the session pallet. + /// + /// This is basically in sync with the call to [`SessionManager::new_session`]. + pub CurrentPlannedSession get(fn current_planned_session): SessionIndex; + /// Snapshot of validators at the beginning of the current election window. This should only /// have a value when [`EraElectionStatus`] == `ElectionStatus::Open(_)`. + /// + /// TWO_PHASE_NOTE: should be removed once we switch to multi-phase. pub SnapshotValidators get(fn snapshot_validators): Option>; /// Snapshot of nominators at the beginning of the current election window. This should only /// have a value when [`EraElectionStatus`] == `ElectionStatus::Open(_)`. + /// + /// TWO_PHASE_NOTE: should be removed once we switch to multi-phase. pub SnapshotNominators get(fn snapshot_nominators): Option>; /// The next validator set. At the end of an era, if this is available (potentially from the /// result of an offchain worker), it is immediately used. Otherwise, the on-chain election /// is executed. + /// + /// TWO_PHASE_NOTE: should be removed once we switch to multi-phase. pub QueuedElected get(fn queued_elected): Option>; /// The score of the current [`QueuedElected`]. + /// + /// TWO_PHASE_NOTE: should be removed once we switch to multi-phase. pub QueuedScore get(fn queued_score): Option; /// Flag to control the execution of the offchain election. When `Open(_)`, we accept /// solutions to be submitted. + /// + /// TWO_PHASE_NOTE: should be removed once we switch to multi-phase. pub EraElectionStatus get(fn era_election_status): ElectionStatus; /// True if the current **planned** session is final. Note that this does not take era /// forcing into account. + /// + /// TWO_PHASE_NOTE: should be removed once we switch to multi-phase. pub IsCurrentSessionFinal get(fn is_current_session_final): bool = false; /// This is set to v5.0.0 for new networks. @@ -1044,18 +1070,14 @@ decl_module! { ElectionStatus::::Open(now) ); add_weight(0, 1, 0); - log!( - info, - "💸 Election window is Open({:?}). Snapshot created", - now - ); + log!(info, "Election window is Open({:?}). Snapshot created", now); } else { - log!(warn, "💸 Failed to create snapshot at {:?}.", now); + log!(warn, "Failed to create snapshot at {:?}.", now); } } } } else { - log!(warn, "💸 Estimating next session change failed."); + log!(warn, "Estimating next session change failed."); } add_weight(0, 0, T::NextNewSession::weight(now)) } @@ -1076,16 +1098,12 @@ decl_module! { if Self::era_election_status().is_open_at(now) { let offchain_status = set_check_offchain_execution_status::(now); if let Err(why) = offchain_status { - log!( - warn, - "💸 skipping offchain worker in open election window due to [{}]", - why - ); + log!(warn, "skipping offchain worker in open election window due to [{}]", why); } else { if let Err(e) = compute_offchain_election::() { - log!(error, "💸 Error in election offchain worker: {:?}", e); + log!(error, "Error in election offchain worker: {:?}", e); } else { - log!(debug, "💸 Executed offchain worker thread without errors."); + log!(debug, "Executed offchain worker thread without errors."); } } @@ -2462,7 +2480,7 @@ impl Module { { log!( warn, - "💸 Snapshot size too big [{} <> {}][{} <> {}].", + "Snapshot size too big [{} <> {}][{} <> {}].", num_validators, MAX_VALIDATORS, num_nominators, @@ -2867,7 +2885,7 @@ impl Module { .into_assignment(nominator_at, validator_at) .map_err(|e| { // log the error since it is not propagated into the runtime error. - log!(warn, "💸 un-compacting solution failed due to {:?}", e); + log!(warn, "un-compacting solution failed due to {:?}", e); >::OffchainElectionBogusCompact })?; @@ -2884,7 +2902,7 @@ impl Module { // have bigger problems. log!( error, - "💸 detected an error in the staking locking and snapshot." + "detected an error in the staking locking and snapshot." ); // abort. return Err(>::OffchainElectionBogusNominator.into()); @@ -2937,7 +2955,7 @@ impl Module { sp_npos_elections::assignment_ratio_to_staked(assignments, |s| Self::power_of(s) as _); // build the support map thereof in order to evaluate. - let supports = to_support_map::(&winners, &staked_assignments) + let supports = to_supports(&winners, &staked_assignments) .map_err(|_| >::OffchainElectionBogusEdge)?; // Check if the score is the same as the claimed one. @@ -2948,10 +2966,11 @@ impl Module { ); // At last, alles Ok. Exposures and store the result. - let exposures = Self::collect_exposure(supports); + let exposures = Self::collect_exposures(supports); log!( info, - "💸 A better solution (with compute {:?} and score {:?}) has been validated and stored on chain.", + "A better solution (with compute {:?} and score {:?}) has been validated and stored \ + on chain.", compute, submitted_score, ); @@ -3095,6 +3114,8 @@ impl Module { // Set staking information for new era. let maybe_new_validators = Self::select_and_update_validators(current_era); + // TWO_PHASE_NOTE: use this later on. + let _unused_new_validators = Self::enact_election(current_era); maybe_new_validators } @@ -3165,7 +3186,7 @@ impl Module { log!( info, - "💸 new validator set of size {:?} has been elected via {:?} for era {:?}", + "new validator set of size {:?} has been elected via {:?} for staring era {:?}", elected_stashes.len(), compute, current_era, @@ -3214,17 +3235,17 @@ impl Module { Self::power_of(s) as _ }); - let supports = to_support_map::(&elected_stashes, &staked_assignments) + let supports = to_supports(&elected_stashes, &staked_assignments) .map_err(|_| { log!( error, - "💸 on-chain phragmen is failing due to a problem in the result. This must be a bug." + "on-chain phragmen is failing due to a problem in the result. This must be a bug." ) }) .ok()?; // collect exposures - let exposures = Self::collect_exposure(supports); + let exposures = Self::collect_exposures(supports); // In order to keep the property required by `on_session_ending` that we must return the // new validator set even if it's the same as the old, as long as any underlying @@ -3291,7 +3312,7 @@ impl Module { // If we don't have enough candidates, nothing to do. log!( error, - "💸 Chain does not have enough staking candidates to operate. Era {:?}.", + "chain does not have enough staking candidates to operate. Era {:?}.", Self::current_era() ); None @@ -3307,8 +3328,9 @@ impl Module { } } - /// Consume a set of [`Supports`] from [`sp_npos_elections`] and collect them into a [`Exposure`] - fn collect_exposure(supports: SupportMap) -> Vec<(T::AccountId, ExposureT)> { + /// Consume a set of [`Supports`] from [`sp_npos_elections`] and collect them into a + /// [`Exposure`]. + fn collect_exposures(supports: Supports) -> Vec<(T::AccountId, ExposureT)> { supports .into_iter() .map(|(validator, support)| { @@ -3384,6 +3406,90 @@ impl Module { .collect::)>>() } + /// Process the output of the election. + /// + /// This ensures enough validators have been elected, converts all supports to exposures and + /// writes them to the associated storage. + /// + /// Returns `Err(())` if less than [`MinimumValidatorCount`] validators have been elected, `Ok` + /// otherwise. + // TWO_PHASE_NOTE: remove the dead code. + #[allow(dead_code)] + pub fn process_election( + flat_supports: sp_npos_elections::Supports, + current_era: EraIndex, + ) -> Result, ()> { + let exposures = Self::collect_exposures(flat_supports); + let elected_stashes = exposures + .iter() + .cloned() + .map(|(x, _)| x) + .collect::>(); + + if (elected_stashes.len() as u32) <= Self::minimum_validator_count() { + log!( + warn, + "chain does not have enough staking candidates to operate for era {:?}", + current_era, + ); + return Err(()); + } + + // Populate Stakers and write slot stake. + let mut total_stake = 0; + exposures.into_iter().for_each(|(stash, exposure)| { + total_stake = total_stake.saturating_add(exposure.total_power); + >::insert(current_era, &stash, &exposure); + + let mut exposure_clipped = exposure; + let clipped_max_len = T::MaxNominatorRewardedPerValidator::get() as usize; + if exposure_clipped.others.len() > clipped_max_len { + exposure_clipped + .others + .sort_by(|a, b| a.power.cmp(&b.power).reverse()); + exposure_clipped.others.truncate(clipped_max_len); + } + >::insert(¤t_era, &stash, exposure_clipped); + }); + + // Insert current era staking information + ErasTotalStake::insert(¤t_era, total_stake); + + // collect the pref of all winners + for stash in &elected_stashes { + let pref = Self::validators(stash); + >::insert(¤t_era, stash, pref); + } + + // emit event + // TWO_PHASE_NOTE: remove the inner value. + Self::deposit_event(RawEvent::StakingElection(ElectionCompute::Signed)); + + log!( + info, + "new validator set of size {:?} has been processed for era {:?}", + elected_stashes.len(), + current_era, + ); + + Ok(elected_stashes) + } + + /// Enact and process the election using the `ElectionProvider` type. + /// + /// This will also process the election, as noted in [`process_election`]. + fn enact_election(_current_era: EraIndex) -> Option> { + let _outcome = T::ElectionProvider::elect().map(|_| ()); + log!( + debug, + "Experimental election provider outputted {:?}", + _outcome + ); + // TWO_PHASE_NOTE: This code path shall not return anything for now. Later on, redirect the + // results to `process_election`. + None + } + /// Remove all associated data of a stash account from the staking system. /// /// Assumes storage is upgraded before calling. @@ -3493,33 +3599,153 @@ impl Module { pub fn set_slash_reward_fraction(fraction: Perbill) { SlashRewardFraction::put(fraction); } + + /// Get all of the voters that are eligible for the npos election. + /// + /// This will use all on-chain nominators, and all the validators will inject a self vote. + /// + /// ### Slashing + /// + /// All nominations that have been submitted before the last non-zero slash of the validator are + /// auto-chilled. + /// + /// Note that this is VERY expensive. Use with care. + pub fn get_npos_voters() -> Vec<(T::AccountId, VoteWeight, Vec)> { + let weight_of = + |account_id: &T::AccountId| -> VoteWeight { Self::power_of(account_id) as _ }; + let mut all_voters = Vec::new(); + + for (validator, _) in >::iter() { + // append self vote + let self_vote = ( + validator.clone(), + weight_of(&validator), + vec![validator.clone()], + ); + all_voters.push(self_vote); + } + + for (nominator, nominations) in >::iter() { + let Nominations { + submitted_in, + mut targets, + suppressed: _, + } = nominations; + + // Filter out nomination targets which were nominated before the most recent + // slashing span. + targets.retain(|stash| { + Self::slashing_spans(&stash) + .map_or(true, |spans| submitted_in >= spans.last_nonzero_slash()) + }); + + let vote_weight = weight_of(&nominator); + all_voters.push((nominator, vote_weight, targets)) + } + + all_voters + } + + pub fn get_npos_targets() -> Vec { + >::iter().map(|(v, _)| v).collect::>() + } +} + +impl sp_election_providers::ElectionDataProvider + for Module +{ + fn desired_targets() -> u32 { + Self::validator_count() + } + + fn voters() -> Vec<(T::AccountId, VoteWeight, Vec)> { + Self::get_npos_voters() + } + + fn targets() -> Vec { + Self::get_npos_targets() + } + + fn next_election_prediction(now: T::BlockNumber) -> T::BlockNumber { + let current_era = Self::current_era().unwrap_or(0); + let current_session = Self::current_planned_session(); + let current_era_start_session_index = + Self::eras_start_session_index(current_era).unwrap_or(0); + let era_length = current_session + .saturating_sub(current_era_start_session_index) + .min(T::SessionsPerEra::get()); + + let session_length = T::NextNewSession::average_session_length(); + + let until_this_session_end = T::NextNewSession::estimate_next_new_session(now) + .unwrap_or_default() + .saturating_sub(now); + + let sessions_left: T::BlockNumber = T::SessionsPerEra::get() + .saturating_sub(era_length) + // one session is computed in this_session_end. + .saturating_sub(1) + .into(); + + now.saturating_add( + until_this_session_end.saturating_add(sessions_left.saturating_mul(session_length)), + ) + } + + #[cfg(feature = "runtime-benchmarks")] + fn put_snapshot( + voters: Vec<(T::AccountId, VoteWeight, Vec)>, + targets: Vec, + ) { + targets.into_iter().for_each(|v| { + >::insert( + v, + ValidatorPrefs { + commission: Perbill::zero(), + blocked: false, + }, + ); + }); + + voters.into_iter().for_each(|(v, _s, t)| { + >::insert( + v, + Nominations { + targets: t, + submitted_in: 0, + suppressed: false, + }, + ); + }); + } } impl pallet_session::SessionManager for Module { fn new_session(new_index: SessionIndex) -> Option> { - frame_support::debug::native::trace!( - target: LOG_TARGET, - "[{}] planning new_session({})", + log!( + trace, + "[{:?}] planning new_session({})", >::block_number(), - new_index + new_index, ); + CurrentPlannedSession::put(new_index); Self::new_session(new_index) } fn end_session(end_index: SessionIndex) { - frame_support::debug::native::trace!( - target: LOG_TARGET, - "[{}] ending end_session({})", + log!( + trace, + "[{:?}] ending end_session({})", >::block_number(), - end_index + end_index, ); Self::end_session(end_index) } fn start_session(start_index: SessionIndex) { - frame_support::debug::native::trace!( - target: LOG_TARGET, - "[{}] starting start_session({})", + log!( + trace, + "[{:?}] starting start_session({})", >::block_number(), - start_index + start_index, ); Self::start_session(start_index) } @@ -3552,15 +3778,15 @@ impl pallet_session::historical::SessionManager - OnOffenceHandler, Weight> +impl OnOffenceHandler, Weight> for Module where - T: pallet_session::Config>, - T: pallet_session::historical::Config< - FullIdentification = ExposureT, - FullIdentificationOf = ExposureOf, - >, + T: Config + + pallet_session::Config> + + pallet_session::historical::Config< + FullIdentification = ExposureT, + FullIdentificationOf = ExposureOf, + >, T::SessionHandler: pallet_session::SessionHandler>, T::SessionManager: pallet_session::SessionManager>, T::ValidatorIdOf: Convert, Option>>, @@ -3691,6 +3917,7 @@ where } fn can_report() -> bool { + // TWO_PHASE_NOTE: we can get rid of this API Self::era_election_status().is_closed() } } @@ -3800,7 +4027,7 @@ impl frame_support::unsigned::ValidateUnsigned for Module { let invalid = to_invalid(error_with_post_info); log!( debug, - "💸 validate unsigned pre dispatch checks failed due to error #{:?}.", + "validate unsigned pre dispatch checks failed due to error #{:?}.", invalid, ); return invalid.into(); @@ -3808,7 +4035,7 @@ impl frame_support::unsigned::ValidateUnsigned for Module { log!( debug, - "💸 validateUnsigned succeeded for a solution at era {}.", + "validateUnsigned succeeded for a solution at era {}.", era ); diff --git a/frame/staking/src/mock.rs b/frame/staking/src/mock.rs index 5ec07cf175..6bff5d4cef 100644 --- a/frame/staking/src/mock.rs +++ b/frame/staking/src/mock.rs @@ -26,12 +26,13 @@ use std::{cell::RefCell, collections::HashSet}; use frame_support::{ assert_ok, parameter_types, storage::IterableStorageMap, - traits::{Currency, FindAuthor, Get, OnFinalize, OnInitialize}, + traits::{Currency, FindAuthor, Get, OnFinalize, OnInitialize, OneSessionHandler}, weights::{constants::RocksDbWeight, Weight}, StorageValue, }; use frame_system::mocking::*; use sp_core::H256; +use sp_election_providers::onchain; use sp_npos_elections::{reduce, StakedAssignment}; use sp_runtime::{ testing::{Header, TestXt, UintAuthorityId}, @@ -71,7 +72,7 @@ darwinia_support::impl_test_account_data! {} /// Another session handler struct to test on_disabled. pub struct OtherSessionHandler; -impl pallet_session::OneSessionHandler for OtherSessionHandler { +impl OneSessionHandler for OtherSessionHandler { type Key = UintAuthorityId; fn on_genesis_session<'a, I: 'a>(_: I) @@ -213,6 +214,13 @@ impl darwinia_balances::Config for Test { type WeightInfo = (); } +impl onchain::Config for Test { + type AccountId = AccountId; + type BlockNumber = BlockNumber; + type Accuracy = Perbill; + type DataProvider = Staking; +} + parameter_types! { pub const StakingModuleId: ModuleId = ModuleId(*b"da/staki"); pub const BondingDurationInEra: EraIndex = 3; @@ -249,6 +257,7 @@ impl Config for Test { type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator; type UnsignedPriority = UnsignedPriority; type OffchainSolutionWeightLimit = OffchainSolutionWeightLimit; + type ElectionProvider = onchain::OnChainSequentialPhragmen; type RingCurrency = Ring; type RingRewardRemainder = RingRewardRemainderMock; type RingSlash = (); @@ -961,7 +970,7 @@ pub(crate) fn horrible_npos_solution( let score = { let (_, _, better_score) = prepare_submission_with(true, true, 0, |_| {}); - let support = to_support_map::(&winners, &staked_assignment).unwrap(); + let support = to_supports::(&winners, &staked_assignment).unwrap(); let score = support.evaluate(); assert!(sp_npos_elections::is_score_better::( @@ -1071,8 +1080,7 @@ pub(crate) fn prepare_submission_with( Staking::power_of(stash) as _ }); - let support_map = - to_support_map::(winners.as_slice(), staked.as_slice()).unwrap(); + let support_map = to_supports(winners.as_slice(), staked.as_slice()).unwrap(); support_map.evaluate() } else { Default::default() @@ -1147,10 +1155,10 @@ macro_rules! assert_session_era { $session, ); assert_eq!( - active_era(), + current_era(), $era, - "wrong active era {} != {}", - active_era(), + "wrong current era {} != {}", + current_era(), $era, ); }; diff --git a/frame/staking/src/offchain_election.rs b/frame/staking/src/offchain_election.rs index 90c65c4bea..84c6070bab 100644 --- a/frame/staking/src/offchain_election.rs +++ b/frame/staking/src/offchain_election.rs @@ -24,7 +24,7 @@ use codec::Decode; use frame_support::{traits::Get, weights::Weight, IterableStorageMap}; use frame_system::offchain::SubmitTransaction; use sp_npos_elections::{ - reduce, to_support_map, Assignment, CompactSolution, ElectionResult, ElectionScore, + reduce, to_supports, Assignment, CompactSolution, ElectionResult, ElectionScore, EvaluateSupport, ExtendedBalance, }; use sp_runtime::{offchain::storage::StorageValueRef, traits::TrailingZeroInput, RuntimeDebug}; @@ -129,7 +129,7 @@ pub(crate) fn compute_offchain_election() -> Result<(), OffchainElect crate::log!( info, - "💸 prepared a seq-phragmen solution with {} balancing iterations and score {:?}", + "prepared a seq-phragmen solution with {} balancing iterations and score {:?}", iters, score, ); @@ -285,7 +285,7 @@ where if compact.remove_voter(index) { crate::log!( trace, - "💸 removed a voter at index {} with stake {:?} from compact to reduce the size", + "removed a voter at index {} with stake {:?} from compact to reduce the size", index, _stake, ); @@ -298,18 +298,19 @@ where } crate::log!( - warn, - "💸 {} nominators out of {} had to be removed from compact solution due to size limits.", - removed, - compact.voter_count() + removed, - ); + warn, + "{} nominators out of {} had to be removed from compact solution due to size \ + limits.", + removed, + compact.voter_count() + removed, + ); Ok(compact) } _ => { // nada, return as-is crate::log!( info, - "💸 Compact solution did not get trimmed due to block weight limits.", + "Compact solution did not get trimmed due to block weight limits.", ); Ok(compact) } @@ -395,7 +396,10 @@ pub fn prepare_submission( let maximum_allowed_voters = maximum_compact_len::(winners.len() as u32, size, maximum_weight); - crate::log!(debug, "💸 Maximum weight = {:?} // current weight = {:?} // maximum voters = {:?} // current votes = {:?}", + crate::log!( + debug, + "Maximum weight = {:?} // current weight = {:?} // maximum voters = {:?} // current votes \ + = {:?}", maximum_weight, T::WeightInfo::submit_solution_better( size.validators.into(), @@ -419,7 +423,7 @@ pub fn prepare_submission( >::power_of(s) as _ }); - let support_map = to_support_map::(&winners, &staked) + let support_map = to_supports::(&winners, &staked) .map_err(|_| OffchainElectionError::ElectionFailed)?; support_map.evaluate() }; diff --git a/frame/staking/src/substrate_tests.rs b/frame/staking/src/substrate_tests.rs index 81319e26b7..4b44a536fe 100644 --- a/frame/staking/src/substrate_tests.rs +++ b/frame/staking/src/substrate_tests.rs @@ -2259,6 +2259,7 @@ fn bond_with_duplicate_vote_should_be_ignored_by_npos_election() { RewardDestination::Controller, 0 )); + // 11 should not be elected. All of these count as ONE vote. assert_ok!(Staking::nominate( Origin::signed(2), vec![11, 11, 11, 21, 31,] @@ -2274,7 +2275,6 @@ fn bond_with_duplicate_vote_should_be_ignored_by_npos_election() { assert_ok!(Staking::nominate(Origin::signed(4), vec![21, 31])); // winners should be 21 and 31. Otherwise this election is taking duplicates into account. - let sp_npos_elections::ElectionResult { winners, assignments, @@ -2530,7 +2530,7 @@ fn reward_from_authorship_event_handler_works() { fn add_reward_points_fns_works() { ExtBuilder::default().build_and_execute(|| { // Not mandatory but must be coherent with rewards - assert_eq!(Session::validators(), vec![21, 11]); + assert_eq_uvec!(Session::validators(), vec![21, 11]); Staking::reward_by_ids(vec![(21, 1), (11, 1), (11, 1)]); @@ -4368,3 +4368,113 @@ fn cannot_bond_to_lower_than_ed() { ); }) } + +mod election_data_provider { + use super::*; + use sp_election_providers::ElectionDataProvider; + + #[test] + fn voters_include_self_vote() { + ExtBuilder::default() + .nominate(false) + .build() + .execute_with(|| { + assert!(>::iter() + .map(|(x, _)| x) + .all(|v| Staking::voters() + .into_iter() + .find(|(w, _, t)| { v == *w && t[0] == *w }) + .is_some())) + }) + } + + #[test] + fn voters_exclude_slashed() { + ExtBuilder::default().build().execute_with(|| { + assert_eq!(Staking::nominators(101).unwrap().targets, vec![11, 21]); + assert_eq!( + >::voters() + .iter() + .find(|x| x.0 == 101) + .unwrap() + .2, + vec![11, 21] + ); + + start_active_era(1); + add_slash(&11); + + // 11 is gone. + start_active_era(2); + assert_eq!( + >::voters() + .iter() + .find(|x| x.0 == 101) + .unwrap() + .2, + vec![21] + ); + + // resubmit and it is back + assert_ok!(Staking::nominate(Origin::signed(100), vec![11, 21])); + assert_eq!( + >::voters() + .iter() + .find(|x| x.0 == 101) + .unwrap() + .2, + vec![11, 21] + ); + }) + } + + #[test] + fn estimate_next_election_works() { + ExtBuilder::default() + .sessions_per_era(5) + .period(5) + .build() + .execute_with(|| { + // first session is always length 0. + for b in 1..20 { + run_to_block(b); + assert_eq!( + Staking::next_election_prediction(System::block_number()), + 20 + ); + } + + // election + run_to_block(20); + assert_eq!( + Staking::next_election_prediction(System::block_number()), + 45 + ); + assert_eq!(staking_events().len(), 1); + assert_eq!( + *staking_events().last().unwrap(), + RawEvent::StakingElection(ElectionCompute::OnChain) + ); + + for b in 21..45 { + run_to_block(b); + assert_eq!( + Staking::next_election_prediction(System::block_number()), + 45 + ); + } + + // election + run_to_block(45); + assert_eq!( + Staking::next_election_prediction(System::block_number()), + 70 + ); + assert_eq!(staking_events().len(), 3); + assert_eq!( + *staking_events().last().unwrap(), + RawEvent::StakingElection(ElectionCompute::OnChain) + ); + }) + } +} diff --git a/frame/staking/src/weights.rs b/frame/staking/src/weights.rs index fbafcbb15c..bbcc74ea20 100644 --- a/frame/staking/src/weights.rs +++ b/frame/staking/src/weights.rs @@ -1,7 +1,7 @@ //! Autogenerated weights for pallet_staking //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.1 -//! DATE: 2021-01-19, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-02-13, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: @@ -59,157 +59,157 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn bond() -> Weight { - (76_281_000 as Weight) + (81_642_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } fn bond_extra() -> Weight { - (62_062_000 as Weight) + (66_025_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } fn deposit_extra() -> Weight { - (57_195_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + (66_025_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) } fn unbond() -> Weight { - (57_195_000 as Weight) + (60_810_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } fn validate() -> Weight { - (20_228_000 as Weight) + (21_009_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } fn kick(k: u32) -> Weight { - (31_066_000 as Weight) - // Standard Error: 11_000 - .saturating_add((17_754_000 as Weight).saturating_mul(k as Weight)) + (31_832_000 as Weight) + // Standard Error: 15_000 + .saturating_add((19_418_000 as Weight).saturating_mul(k as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(k as Weight))) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) } fn nominate(n: u32) -> Weight { - (33_494_000 as Weight) - // Standard Error: 23_000 - .saturating_add((5_253_000 as Weight).saturating_mul(n as Weight)) + (34_304_000 as Weight) + // Standard Error: 20_000 + .saturating_add((5_643_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } fn chill() -> Weight { - (19_396_000 as Weight) + (20_103_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } fn set_payee() -> Weight { - (13_449_000 as Weight) + (13_858_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn set_controller() -> Weight { - (29_184_000 as Weight) + (30_269_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } fn set_validator_count() -> Weight { - (2_266_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (2_444_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn force_no_eras() -> Weight { - (2_462_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (2_766_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn force_new_era() -> Weight { - (2_483_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (2_724_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn force_new_era_always() -> Weight { - (2_495_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (2_702_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn set_invulnerables(v: u32) -> Weight { - (2_712_000 as Weight) + (2_914_000 as Weight) // Standard Error: 0 - .saturating_add((9_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((35_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn force_unstake(s: u32) -> Weight { - (60_508_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_525_000 as Weight).saturating_mul(s as Weight)) + (64_032_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_787_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } fn cancel_deferred_slash(s: u32) -> Weight { - (5_886_772_000 as Weight) - // Standard Error: 393_000 - .saturating_add((34_849_000 as Weight).saturating_mul(s as Weight)) + (5_903_394_000 as Weight) + // Standard Error: 391_000 + .saturating_add((34_834_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn payout_stakers_dead_controller(n: u32) -> Weight { - (127_627_000 as Weight) - // Standard Error: 27_000 - .saturating_add((49_354_000 as Weight).saturating_mul(n as Weight)) + (141_724_000 as Weight) + // Standard Error: 24_000 + .saturating_add((53_018_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(n as Weight))) } fn payout_stakers_alive_staked(n: u32) -> Weight { - (156_838_000 as Weight) - // Standard Error: 24_000 - .saturating_add((62_653_000 as Weight).saturating_mul(n as Weight)) + (159_994_000 as Weight) + // Standard Error: 28_000 + .saturating_add((67_746_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight))) } fn rebond(l: u32) -> Weight { - (40_110_000 as Weight) + (42_177_000 as Weight) // Standard Error: 1_000 - .saturating_add((78_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((82_000 as Weight).saturating_mul(l as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } fn set_history_depth(e: u32) -> Weight { (0 as Weight) - // Standard Error: 70_000 - .saturating_add((32_883_000 as Weight).saturating_mul(e as Weight)) + // Standard Error: 65_000 + .saturating_add((34_151_000 as Weight).saturating_mul(e as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight))) } fn reap_stash(s: u32) -> Weight { - (64_605_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_506_000 as Weight).saturating_mul(s as Weight)) + (68_377_000 as Weight) + // Standard Error: 0 + .saturating_add((2_757_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } fn new_era(v: u32, n: u32) -> Weight { (0 as Weight) - // Standard Error: 926_000 - .saturating_add((548_212_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 46_000 - .saturating_add((78_343_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) + // Standard Error: 908_000 + .saturating_add((588_562_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 45_000 + .saturating_add((83_485_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) + .saturating_add(T::DbWeight::get().writes(13 as Weight)) .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight))) } fn submit_solution_better(v: u32, n: u32, a: u32, w: u32) -> Weight { (0 as Weight) - // Standard Error: 48_000 - .saturating_add((937_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 19_000 - .saturating_add((657_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 48_000 - .saturating_add((70_669_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 101_000 - .saturating_add((7_658_000 as Weight).saturating_mul(w as Weight)) + // Standard Error: 52_000 + .saturating_add((750_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 20_000 + .saturating_add((556_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 52_000 + .saturating_add((76_201_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 108_000 + .saturating_add((7_271_000 as Weight).saturating_mul(w as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(a as Weight))) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(w as Weight))) @@ -220,157 +220,157 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn bond() -> Weight { - (76_281_000 as Weight) + (81_642_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } fn bond_extra() -> Weight { - (62_062_000 as Weight) + (66_025_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } fn deposit_extra() -> Weight { - (62_062_000 as Weight) + (66_025_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } fn unbond() -> Weight { - (57_195_000 as Weight) + (60_810_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } fn validate() -> Weight { - (20_228_000 as Weight) + (21_009_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } fn kick(k: u32) -> Weight { - (31_066_000 as Weight) - // Standard Error: 11_000 - .saturating_add((17_754_000 as Weight).saturating_mul(k as Weight)) + (31_832_000 as Weight) + // Standard Error: 15_000 + .saturating_add((19_418_000 as Weight).saturating_mul(k as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(k as Weight))) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) } fn nominate(n: u32) -> Weight { - (33_494_000 as Weight) - // Standard Error: 23_000 - .saturating_add((5_253_000 as Weight).saturating_mul(n as Weight)) + (34_304_000 as Weight) + // Standard Error: 20_000 + .saturating_add((5_643_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } fn chill() -> Weight { - (19_396_000 as Weight) + (20_103_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } fn set_payee() -> Weight { - (13_449_000 as Weight) + (13_858_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn set_controller() -> Weight { - (29_184_000 as Weight) + (30_269_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } fn set_validator_count() -> Weight { - (2_266_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (2_444_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn force_no_eras() -> Weight { - (2_462_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (2_766_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn force_new_era() -> Weight { - (2_483_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (2_724_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn force_new_era_always() -> Weight { - (2_495_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (2_702_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn set_invulnerables(v: u32) -> Weight { - (2_712_000 as Weight) + (2_914_000 as Weight) // Standard Error: 0 - .saturating_add((9_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((35_000 as Weight).saturating_mul(v as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn force_unstake(s: u32) -> Weight { - (60_508_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_525_000 as Weight).saturating_mul(s as Weight)) + (64_032_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_787_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } fn cancel_deferred_slash(s: u32) -> Weight { - (5_886_772_000 as Weight) - // Standard Error: 393_000 - .saturating_add((34_849_000 as Weight).saturating_mul(s as Weight)) + (5_903_394_000 as Weight) + // Standard Error: 391_000 + .saturating_add((34_834_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn payout_stakers_dead_controller(n: u32) -> Weight { - (127_627_000 as Weight) - // Standard Error: 27_000 - .saturating_add((49_354_000 as Weight).saturating_mul(n as Weight)) + (141_724_000 as Weight) + // Standard Error: 24_000 + .saturating_add((53_018_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(11 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(n as Weight))) } fn payout_stakers_alive_staked(n: u32) -> Weight { - (156_838_000 as Weight) - // Standard Error: 24_000 - .saturating_add((62_653_000 as Weight).saturating_mul(n as Weight)) + (159_994_000 as Weight) + // Standard Error: 28_000 + .saturating_add((67_746_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(12 as Weight)) .saturating_add(RocksDbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(n as Weight))) } fn rebond(l: u32) -> Weight { - (40_110_000 as Weight) + (42_177_000 as Weight) // Standard Error: 1_000 - .saturating_add((78_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((82_000 as Weight).saturating_mul(l as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } fn set_history_depth(e: u32) -> Weight { (0 as Weight) - // Standard Error: 70_000 - .saturating_add((32_883_000 as Weight).saturating_mul(e as Weight)) + // Standard Error: 65_000 + .saturating_add((34_151_000 as Weight).saturating_mul(e as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) .saturating_add(RocksDbWeight::get().writes((7 as Weight).saturating_mul(e as Weight))) } fn reap_stash(s: u32) -> Weight { - (64_605_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_506_000 as Weight).saturating_mul(s as Weight)) + (68_377_000 as Weight) + // Standard Error: 0 + .saturating_add((2_757_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } fn new_era(v: u32, n: u32) -> Weight { (0 as Weight) - // Standard Error: 926_000 - .saturating_add((548_212_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 46_000 - .saturating_add((78_343_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(RocksDbWeight::get().reads(7 as Weight)) + // Standard Error: 908_000 + .saturating_add((588_562_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 45_000 + .saturating_add((83_485_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(RocksDbWeight::get().reads(9 as Weight)) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(v as Weight))) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) - .saturating_add(RocksDbWeight::get().writes(8 as Weight)) + .saturating_add(RocksDbWeight::get().writes(13 as Weight)) .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(v as Weight))) } fn submit_solution_better(v: u32, n: u32, a: u32, w: u32) -> Weight { (0 as Weight) - // Standard Error: 48_000 - .saturating_add((937_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 19_000 - .saturating_add((657_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 48_000 - .saturating_add((70_669_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 101_000 - .saturating_add((7_658_000 as Weight).saturating_mul(w as Weight)) + // Standard Error: 52_000 + .saturating_add((750_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 20_000 + .saturating_add((556_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 52_000 + .saturating_add((76_201_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 108_000 + .saturating_add((7_271_000 as Weight).saturating_mul(w as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(a as Weight))) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(w as Weight))) diff --git a/frame/support/Cargo.toml b/frame/support/Cargo.toml index b529ecea7d..440c049372 100644 --- a/frame/support/Cargo.toml +++ b/frame/support/Cargo.toml @@ -11,15 +11,15 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false, features = ["derive"] } -impl-trait-for-tuples = { version = "0.2.0" } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } +impl-trait-for-tuples = { version = "0.2.1" } num-traits = { version = "0.2.14", default-features = false } # darwinia ethereum-primitives = { default-features = false, path = "../../primitives/ethereum-primitives" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] diff --git a/frame/support/src/testing.rs b/frame/support/src/testing.rs index 7f6e546ec0..090b16ea38 100644 --- a/frame/support/src/testing.rs +++ b/frame/support/src/testing.rs @@ -24,26 +24,6 @@ macro_rules! impl_test_account_data { pub type KtonInstance = darwinia_balances::Instance1; pub type KtonError = darwinia_balances::Error; - $crate::impl_account_data! { - struct AccountData - for - RingInstance, - KtonInstance - where - Balance = Balance - {} - } - }; - (deprecated) => { - pub type RingInstance = darwinia_balances::Instance0; - pub type RingError = darwinia_balances::Error; - pub type RingConfig = darwinia_balances::GenesisConfig; - pub type Ring = darwinia_balances::Module; - pub type KtonInstance = darwinia_balances::Instance1; - pub type KtonError = darwinia_balances::Error; - pub type KtonConfig = darwinia_balances::GenesisConfig; - pub type Kton = darwinia_balances::Module; - $crate::impl_account_data! { struct AccountData for diff --git a/frame/treasury/Cargo.toml b/frame/treasury/Cargo.toml index 54edcc81c7..6f03305d5c 100644 --- a/frame/treasury/Cargo.toml +++ b/frame/treasury/Cargo.toml @@ -11,23 +11,23 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } serde = { version = "1.0.124", optional = true, features = ["derive"] } # darwinia darwinia-support = { default-features = false, path = "../support" } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # darwinia darwinia-balances = { path = "../balances" } # substrate -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-storage = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-storage = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/frame/treasury/src/mock.rs b/frame/treasury/src/mock.rs index b4bd38229a..984631f7f0 100644 --- a/frame/treasury/src/mock.rs +++ b/frame/treasury/src/mock.rs @@ -25,7 +25,7 @@ mod treasury { } // --- substrate --- -use frame_support::{impl_outer_event, impl_outer_origin, parameter_types}; +use frame_system::mocking::*; use sp_core::H256; use sp_runtime::{ testing::Header, @@ -33,41 +33,22 @@ use sp_runtime::{ ModuleId, }; // --- darwinia --- -use crate::*; +use crate::{self as darwinia_treasury, *}; -type Balance = u64; - -pub type System = frame_system::Module; -pub type Treasury = Module; - -impl_outer_event! { - pub enum Event for Test { - frame_system , - darwinia_balances Instance0, - darwinia_balances Instance1, - treasury , - } -} - -impl_outer_origin! { - pub enum Origin for Test where system = frame_system {} -} +type Block = MockBlock; +type UncheckedExtrinsic = MockUncheckedExtrinsic; -darwinia_support::impl_test_account_data! { deprecated } +type Balance = u64; -#[derive(Clone, Eq, PartialEq)] -pub struct Test; +darwinia_support::impl_test_account_data! {} -parameter_types! { - pub static TenToFourteen: Vec = vec![10, 11, 12, 13, 14]; -} impl frame_system::Config for Test { type BaseCallFilter = (); type BlockWeights = (); type BlockLength = (); type DbWeight = (); type Origin = Origin; - type Call = (); + type Call = Call; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -78,7 +59,7 @@ impl frame_system::Config for Test { type Event = Event; type BlockHashCount = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); @@ -109,8 +90,9 @@ impl ContainsLengthBound for Tippers { } } -parameter_types! { +frame_support::parameter_types! { pub const ExistentialDeposit: u64 = 1; + pub static TenToFourteen: Vec = vec![10, 11, 12, 13, 14]; } impl darwinia_balances::Config for Test { type Balance = Balance; @@ -135,7 +117,7 @@ impl darwinia_balances::Config for Test { type WeightInfo = (); } -parameter_types! { +frame_support::parameter_types! { pub const TreasuryModuleId: ModuleId = ModuleId(*b"da/trsry"); pub const TipCountdown: u64 = 1; pub const TipFindersFee: Percent = Percent::from_percent(20); @@ -183,24 +165,38 @@ impl Config for Test { type WeightInfo = (); } +frame_support::construct_runtime! { + pub enum Test + where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic + { + System: frame_system::{Module, Call, Storage, Config, Event}, + Ring: darwinia_balances::::{Module, Call, Storage, Config, Event}, + Kton: darwinia_balances::::{Module, Call, Storage, Config, Event}, + Treasury: darwinia_treasury::{Module, Call, Storage, Config, Event}, + } +} + pub fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default() .build_storage::() .unwrap(); - RingConfig { + darwinia_balances::GenesisConfig:: { // Total issuance will be 200 with treasury account initialized at ED. balances: vec![(0, 100), (1, 98), (2, 1)], } .assimilate_storage(&mut t) .unwrap(); - KtonConfig { + darwinia_balances::GenesisConfig:: { // Total issuance will be 200 with treasury account initialized at ED. balances: vec![(0, 100), (1, 98), (2, 1)], } .assimilate_storage(&mut t) .unwrap(); - GenesisConfig::default() + darwinia_treasury::GenesisConfig::default() .assimilate_storage::(&mut t) .unwrap(); @@ -212,7 +208,7 @@ pub fn last_event() -> RawEvent { .into_iter() .map(|r| r.event) .filter_map(|e| { - if let Event::treasury(inner) = e { + if let Event::darwinia_treasury(inner) = e { Some(inner) } else { None diff --git a/frame/treasury/src/tests.rs b/frame/treasury/src/tests.rs index d76e555fd1..238e9de045 100644 --- a/frame/treasury/src/tests.rs +++ b/frame/treasury/src/tests.rs @@ -22,7 +22,7 @@ use frame_support::{assert_noop, assert_ok, traits::OnInitialize}; use sp_runtime::traits::BlakeTwo256; // --- darwinia --- -use crate::{mock::*, *}; +use crate::{self as darwinia_treasury, mock::*, *}; #[test] fn genesis_config_works() { @@ -1379,7 +1379,7 @@ fn genesis_funding_works() { } .assimilate_storage(&mut t) .unwrap(); - GenesisConfig::default() + darwinia_treasury::GenesisConfig::default() .assimilate_storage::(&mut t) .unwrap(); let mut t: sp_io::TestExternalities = t.into(); diff --git a/frame/treasury/src/weights.rs b/frame/treasury/src/weights.rs index cc25e363d7..de75ed268c 100644 --- a/frame/treasury/src/weights.rs +++ b/frame/treasury/src/weights.rs @@ -1,6 +1,6 @@ //! Weights for pallet_treasury //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0 -//! DATE: 2020-10-27, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! DATE: 2020-10-27, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: diff --git a/frame/vesting/Cargo.toml b/frame/vesting/Cargo.toml index 1033ebf545..21b2136392 100644 --- a/frame/vesting/Cargo.toml +++ b/frame/vesting/Cargo.toml @@ -11,14 +11,14 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } enumflags2 = { version = "0.6.2" } serde = { version = "1.0.124", optional = true } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } # darwinia darwinia-support = { default-features = false, path = "../support" } @@ -26,9 +26,9 @@ darwinia-support = { default-features = false, path = "../support" } # crates hex-literal = "0.3.1" # substrate -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-storage = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-storage = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } # darwinia darwinia-balances = { path = "../balances" } diff --git a/frame/vesting/src/lib.rs b/frame/vesting/src/lib.rs index a99757104e..0e3353a7f8 100644 --- a/frame/vesting/src/lib.rs +++ b/frame/vesting/src/lib.rs @@ -395,7 +395,7 @@ where mod tests { use crate::{self as darwinia_vesting, *}; - use frame_support::{assert_noop, assert_ok, parameter_types}; + use frame_support::{assert_noop, assert_ok}; use frame_system::{mocking::*, RawOrigin}; use sp_core::H256; use sp_runtime::{ @@ -403,11 +403,11 @@ mod tests { traits::{BadOrigin, BlakeTwo256, Identity, IdentityLookup}, }; - type Balance = u64; - type Block = MockBlock; type UncheckedExtrinsic = MockUncheckedExtrinsic; + type Balance = u64; + darwinia_support::impl_test_account_data! {} impl frame_system::Config for Test { @@ -435,7 +435,7 @@ mod tests { type SS58Prefix = (); } - parameter_types! { + frame_support::parameter_types! { pub const MaxLocks: u32 = 10; } impl darwinia_balances::Config for Test { @@ -450,7 +450,7 @@ mod tests { type WeightInfo = (); } - parameter_types! { + frame_support::parameter_types! { pub const MinVestedTransfer: u64 = 256 * 2; pub static ExistentialDeposit: u64 = 0; } diff --git a/primitives/consensus/Cargo.toml b/primitives/consensus/Cargo.toml index 463d1441cf..f255373634 100644 --- a/primitives/consensus/Cargo.toml +++ b/primitives/consensus/Cargo.toml @@ -11,28 +11,30 @@ version = "2.0.0" [dependencies] # crates -codec = { default-features = false, package = "parity-scale-codec", version = "1.3.7", features = ["derive"] } -ethereum = { default-features = false, version = "0.6.0", features = ["with-codec"] } -rlp = { default-features = false, version = "0.5" } -sha3 = { default-features = false, version = "0.8" } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } +ethereum = { version = "0.7.1", default-features = false, features = ["with-codec"] } +rlp = { version = "0.5", default-features = false } +sha3 = { version = "0.8", default-features = false } # substrate -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] std = [ "crates-std", + "substrate-std", +] + +crates-std = [ + "codec/std", "ethereum/std", "rlp/std", "sha3/std", - "substrate-std", ] -crates-std = ["codec/std"] - substrate-std = [ "sp-std/std", "sp-runtime/std", diff --git a/primitives/consensus/src/lib.rs b/primitives/consensus/src/lib.rs index bba6e19a2e..cafc29b53d 100644 --- a/primitives/consensus/src/lib.rs +++ b/primitives/consensus/src/lib.rs @@ -46,15 +46,15 @@ impl Log { #[derive(Decode, Encode, Clone, PartialEq, Eq)] pub enum PreLog { - #[codec(index = "3")] + #[codec(index = 3)] Block(ethereum::Block), } #[derive(Decode, Encode, Clone, PartialEq, Eq)] pub enum PostLog { - #[codec(index = "1")] + #[codec(index = 1)] Hashes(Hashes), - #[codec(index = "2")] + #[codec(index = 2)] Block(ethereum::Block), } diff --git a/primitives/ethereum-primitives/Cargo.toml b/primitives/ethereum-primitives/Cargo.toml index ad4a0f2829..fb81f64242 100644 --- a/primitives/ethereum-primitives/Cargo.toml +++ b/primitives/ethereum-primitives/Cargo.toml @@ -11,55 +11,46 @@ version = "2.0.0" [dependencies] # crates -array-bytes = { version = "1.1.0" } -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false, features = ["derive"] } -ethash = { default-features = false, git = "https://github.com/darwinia-network/ethash", tag = "v1.0.0" } -serde = { version = "1.0.124", optional = true, features = ["derive"] } +array-bytes = { version = "1.1.0" } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false, features = ["derive"] } +ethbloom = { version = "0.11.0", default-features = false, features = ["codec", "rlp"] } +ethereum-types = { version = "0.11.0", default-features = false, features = ["codec", "rlp"] } +fixed-hash = { version = "0.7.0", default-features = false } +impl-codec = { version = "0.5.0", default-features = false } +impl-rlp = { version = "0.3.0", default-features = false } +keccak-hash = { version = "0.7.0", default-features = false } +primitive-types = { version = "0.9.0", default-features = false, features = ["codec", "rlp"] } +rlp = { version = "0.5.0", default-features = false } +rlp-derive = { version = "0.1.0" } +serde = { version = "1.0.124", optional = true, features = ["derive"] } # darwinia +ethash = { default-features = false, git = "https://github.com/darwinia-network/rust-ethash" } merkle-patricia-trie = { default-features = false, path = "../merkle-patricia-trie" } -# github -ethbloom = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } -ethereum-types = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } -fixed-hash = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } -impl-codec = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } -impl-rlp = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } -keccak-hash = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } -primitive-types = { default-features = false, features = ["codec", "rlp"], git = "https://github.com/darwinia-network/parity-common.git" } -rlp = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } -rlp-derive = { git = "https://github.com/darwinia-network/parity-common.git" } # substrate -sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-io = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # crates keccak-hasher = { version = "0.15.3" } -serde_json = { version = "1.0.62" } +serde_json = { version = "1.0.64" } # github -triehash = { git = "https://github.com/darwinia-network/parity-common.git" } +triehash = { version = "0.8.4" } # substrate -frame-support = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] std = [ "crates-std", - "github-std", "darwinia-std", "substrate-std", ] crates-std = [ "codec/std", - "serde", -] -darwinia-std = [ - "ethash/std", - "merkle-patricia-trie/std", -] -github-std = [ "ethbloom/std", "ethereum-types/std", "ethereum-types/serialize", @@ -69,6 +60,11 @@ github-std = [ "keccak-hash/std", "primitive-types/std", "rlp/std", + "serde", +] +darwinia-std = [ + "ethash/std", + "merkle-patricia-trie/std", ] substrate-std = [ "sp-io/std", diff --git a/primitives/ethereum-primitives/src/header.rs b/primitives/ethereum-primitives/src/header.rs index 16fd4f828e..61ee749139 100644 --- a/primitives/ethereum-primitives/src/header.rs +++ b/primitives/ethereum-primitives/src/header.rs @@ -174,7 +174,10 @@ impl EthereumHeader { array_bytes::hex2array_unchecked!(parse_value_unchecked(s), 32).into(); } } - eth_header.seal = vec![rlp::encode(&mix_hash), rlp::encode(&nonce)]; + eth_header.seal = vec![ + rlp::encode(&mix_hash).to_vec(), + rlp::encode(&nonce).to_vec(), + ]; eth_header } @@ -388,7 +391,7 @@ impl EthereumHeader { fn rlp(&self, with_seal: Seal) -> Bytes { let mut s = RlpStream::new(); self.stream_rlp(&mut s, with_seal); - s.out() + s.out().to_vec() } /// Place this header into an RLP stream `s`, optionally `with_seal`. @@ -777,7 +780,10 @@ mod tests { #[test] fn can_do_proof_of_work_verification_fail() { let mut header: EthereumHeader = EthereumHeader::default(); - header.set_seal(vec![rlp::encode(&H256::zero()), rlp::encode(&H64::zero())]); + header.set_seal(vec![ + rlp::encode(&H256::zero()).to_vec(), + rlp::encode(&H64::zero()).to_vec(), + ]); header.set_difficulty( U256::from_str("ffffffffffffffffffffffffffffffffffffffffffffaaaaaaaaaaaaaaaaaaaa") .unwrap(), diff --git a/primitives/evm/Cargo.toml b/primitives/evm/Cargo.toml index 7c576073fb..38989a0904 100644 --- a/primitives/evm/Cargo.toml +++ b/primitives/evm/Cargo.toml @@ -11,13 +11,13 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } -evm = { version = "0.23.0", default-features = false, features = ["with-codec"] } -impl-trait-for-tuples = { version = "0.2.0" } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } +evm = { version = "0.24.0", default-features = false, features = ["with-codec"] } +impl-trait-for-tuples = { version = "0.2.1" } serde = { version = "1.0.124", optional = true, features = ["derive"] } # substrate -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/primitives/merkle-patricia-trie/Cargo.toml b/primitives/merkle-patricia-trie/Cargo.toml index a1e09f392b..7180250d2a 100644 --- a/primitives/merkle-patricia-trie/Cargo.toml +++ b/primitives/merkle-patricia-trie/Cargo.toml @@ -16,30 +16,29 @@ name = "trie" [dependencies] # crates array-bytes = { version = "1.1.0" } +hash = { package = "keccak-hash", version = "0.7.0", default-features = false } hashbrown = { version = "0.9.1" } -# github -hash = { package = "keccak-hash", default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } -rlp = { default-features = false, git = "https://github.com/darwinia-network/parity-common.git" } +rlp = { version = "0.5.0", default-features = false } # substrate -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [dev-dependencies] # crates -criterion = { version = "0.3.3" } -ethereum-types = { version = "0.5.2" } -hex = { version = "0.4.2" } -rand = { version = "0.7.3" } -uuid = { version = "0.8.1", features = ["serde", "v4"] } +criterion = { version = "0.3.4" } +ethereum-types = { version = "0.11.0" } +hex = { version = "0.4.3" } +rand = { version = "0.8.3" } +uuid = { version = "0.8.2", features = ["serde", "v4"] } [features] default = ["std"] std = [ - "github-std", + "crates-std", "substrate-std", ] -github-std = [ +crates-std = [ "hash/std", "rlp/std", ] diff --git a/primitives/merkle-patricia-trie/src/proof.rs b/primitives/merkle-patricia-trie/src/proof.rs index 91a60e9925..f6c4af0369 100644 --- a/primitives/merkle-patricia-trie/src/proof.rs +++ b/primitives/merkle-patricia-trie/src/proof.rs @@ -27,7 +27,7 @@ pub struct Proof { impl Proof { pub fn to_rlp(&self) -> Vec { - rlp::encode(self) + rlp::encode(self).to_vec() } pub fn len(&self) -> usize { diff --git a/primitives/merkle-patricia-trie/src/tests.rs b/primitives/merkle-patricia-trie/src/tests.rs index 19c2b5e8a0..e03000b288 100644 --- a/primitives/merkle-patricia-trie/src/tests.rs +++ b/primitives/merkle-patricia-trie/src/tests.rs @@ -634,7 +634,7 @@ mod trie_tests { let mut rng = rand::thread_rng(); let mut keys = vec![]; for _ in 0..100 { - let random_bytes: Vec = (0..rng.gen_range(2, 30)) + let random_bytes: Vec = (0..rng.gen_range(2..30)) .map(|_| rand::random::()) .collect(); trie.insert(random_bytes.to_vec(), random_bytes.clone()) diff --git a/primitives/merkle-patricia-trie/src/trie.rs b/primitives/merkle-patricia-trie/src/trie.rs index f600dcbfbd..4393f8c494 100644 --- a/primitives/merkle-patricia-trie/src/trie.rs +++ b/primitives/merkle-patricia-trie/src/trie.rs @@ -573,7 +573,7 @@ impl MerklePatriciaTrie { let mut stream = RlpStream::new_list(2); stream.append(&borrow_leaf.key.encode_compact()); stream.append(&borrow_leaf.value); - stream.out() + stream.out().to_vec() } Node::Branch(branch) => { let borrow_branch = branch.borrow(); @@ -593,7 +593,7 @@ impl MerklePatriciaTrie { Some(v) => stream.append(v), None => stream.append_empty_data(), }; - stream.out() + stream.out().to_vec() } Node::Extension(ext) => { let borrow_ext = ext.borrow(); @@ -606,7 +606,7 @@ impl MerklePatriciaTrie { } else { stream.append_raw(&data, 1); } - stream.out() + stream.out().to_vec() } Node::Hash(_hash) => unreachable!(), } @@ -829,7 +829,11 @@ mod tests { let mut trie = MerklePatriciaTrie::new(memdb); for _ in 0..1000 { - let rand_str: String = thread_rng().sample_iter(&Alphanumeric).take(30).collect(); + let rand_str: String = thread_rng() + .sample_iter(Alphanumeric) + .map(char::from) + .take(30) + .collect(); let val = rand_str.as_bytes(); trie.insert(val.to_vec(), val.to_vec()).unwrap(); @@ -862,7 +866,11 @@ mod tests { let mut trie = MerklePatriciaTrie::new(memdb); for _ in 0..1000 { - let rand_str: String = thread_rng().sample_iter(&Alphanumeric).take(30).collect(); + let rand_str: String = thread_rng() + .sample_iter(Alphanumeric) + .map(char::from) + .take(30) + .collect(); let val = rand_str.as_bytes(); trie.insert(val.to_vec(), val.to_vec()).unwrap(); @@ -943,9 +951,9 @@ mod tests { #[test] fn test_multiple_trie_roots() { - let k0: ethereum_types::H256 = 0.into(); - let k1: ethereum_types::H256 = 1.into(); - let v: ethereum_types::H256 = 0x1234.into(); + let k0 = ethereum_types::H256::from_low_u64_be(0); + let k1 = ethereum_types::H256::from_low_u64_be(1); + let v = ethereum_types::H256::from_low_u64_be(0x1234); let root1 = { let memdb = Rc::new(MemoryDB::new()); @@ -995,7 +1003,7 @@ mod tests { let mut rng = rand::thread_rng(); let mut keys = vec![]; for _ in 0..100 { - let random_bytes: Vec = (0..rng.gen_range(2, 30)) + let random_bytes: Vec = (0..rng.gen_range(2..30)) .map(|_| rand::random::()) .collect(); trie.insert(random_bytes.clone(), random_bytes.clone()) diff --git a/primitives/relay/Cargo.toml b/primitives/relay/Cargo.toml index 46c9ee23ec..61235bcec4 100644 --- a/primitives/relay/Cargo.toml +++ b/primitives/relay/Cargo.toml @@ -11,11 +11,11 @@ version = "2.0.0" [dependencies] # crates -codec = { package = "parity-scale-codec", version = "1.3.7", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false } # substrate -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.2.1-darwinia" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "rococo-v1.1" } [features] default = ["std"] diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index 7a2ff0a0ff..b630170137 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -11,7 +11,7 @@ version = "2.0.0" [dependencies] # crates -ethereum-types = { version = "0.10.0" } +ethereum-types = { version = "0.11.0" } jsonrpc-core = { version = "15.1.0" } jsonrpc-core-client = { version = "15.1.0" } jsonrpc-derive = { version = "15.1.0" }