Guillaume Thiolliere
9c4e4d453c
Fix doc build with --all-features ( #8277 )
...
* implement
* make default pre/post_upgrade
* simplify Cargo.toml
* revert removal of outdated/private links
* link in pallet-mmr
2021-03-05 16:08:44 +01:00
Bastian Köcher
d0530d0f2a
Fix warnings related to panic and assert ( #8272 )
...
We were using the wrong syntax and that will be dropped with Rust 2021.
The compiler already starts to hint the wrong syntax with warnings. So,
we fix this here.
2021-03-05 10:56:33 +01:00
Robert Habermeier
0c72a8767b
babe: introduce a request-answering mechanic ( #7833 )
...
* babe: introduce a request-answering mechanic
* gromble
* send method
2021-03-04 20:01:18 +01:00
Guillaume Thiolliere
ddbdfc9e57
update nb-connect pin-project-lite rand_core ( #8249 )
2021-03-04 09:49:49 +01:00
Gavin Wood
e993f884fc
Self-sufficient account ref-counting ( #8221 )
...
* Self-sufficient account ref-counting
* Fixes
* Update frame/system/src/lib.rs
Co-authored-by: Jaco Greeff <jacogr@gmail.com >
* Fixes
* Fixes
* Fixes
* Fixes
* Fixes
* Update frame/system/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Update frame/system/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Update frame/system/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* fix build
* Update frame/system/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Jaco Greeff <jacogr@gmail.com >
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2021-03-03 22:28:05 +01:00
Bastian Köcher
274e7f0652
Do not return the Header from execute_block ( #8256 )
...
That was actually a bad idea by me, because it should essentially be the
same as block.header.
Ty @kianenigma
2021-03-03 21:59:28 +01:00
Kian Paimani
0d8a849b84
Add migration logs to pallet v2 ( #8243 )
...
* Add logs to proc macro pallet.
* update logs.
2021-03-03 13:27:17 +00:00
Guillaume Thiolliere
fb8da7ea92
Allow pallet::call to return DispatchResult ( #8241 )
...
* allow dispatch result
* remove custom error message
* format
* add forgotten UI test
* fix test
* fix tests
2021-03-03 13:14:07 +01:00
Bastian Köcher
4de4662480
Make ExecuteBlock::execute_block return the final block header ( #8244 )
...
This pr changes the `ExecuteBlock` trait to return the final header that
results from executing the given block.
2021-03-03 08:44:34 +00:00
Bastian Köcher
dc190a69f2
Move AuRa digest from client to primitives ( #8245 )
...
* Move AuRa digest from client to primitives
This makes the digest stuff usable from inside the runtime ;)
* Update primitives/runtime/src/generic/digest.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
* Review feedback
* Make BABE use the new functionality
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
2021-03-03 09:41:27 +01:00
Guillaume Thiolliere
aca3332953
Add some migration helper to help migrating pallet changing pallet prefix ( #8199 )
...
* migration helper
* fix move_storage
* format
* doc
* improve doc
* Update frame/support/src/storage/migration.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2021-03-02 19:13:47 +01:00
Guillaume Thiolliere
9af70e93b7
make use of matches ( #8211 )
2021-03-02 19:03:05 +01:00
Shawn Tabrizi
62ef739faf
Add benchmark to node-template pallet-template ( #8239 )
...
* Add benchmark to node-template pallet-template
* export sp_std to avoid missing dep when using macro
* fix more `sp_std` deps
* remove unused
* Update bin/node-template/pallets/template/src/benchmarking.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update bin/node-template/pallets/template/Cargo.toml
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2021-03-02 18:23:07 +01:00
Shawn Tabrizi
cdc59db5b7
Make Benchmark Output Analysis Function Configurable ( #8228 )
...
* Integrate `output-analysis`
* fix test
* use default
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_system --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/system/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Update frame/system/src/weights.rs
* cargo run --release --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_system --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/system/src/weights.rs --template=./.maintain/frame-weight-template.hbs --output-analysis=max
* Update frame/system/src/weights.rs
* dont discard value_dist and model
* feedback
Co-authored-by: Parity Benchmarking Bot <admin@parity.io >
2021-03-02 15:56:51 +00:00
Alexander Theißen
7c1dd95e50
contracts: Use unstable sort for topics ( #8232 )
...
* contracts: Use unstable sort for topics
* Add warning about non-determinism
2021-03-02 07:26:43 +00:00
Pierre Krieger
add5cbebb6
Fix state mismatch in case of bad handshake ( #8230 )
2021-03-01 18:57:00 +01:00
André Silva
13ef9ad39e
babe: make plan_config_change callable ( #8233 )
2021-03-01 15:58:49 +01:00
Bastian Köcher
68390d4085
Init RuntimeLogger automatically for each runtime api call ( #8128 )
...
* Init `RuntimeLogger` automatically for each runtime api call
This pr change the runtime api in such a way to always and automatically
enable the `RuntimeLogger`. This enables the user to use `log` or
`tracing` from inside the runtime to create log messages. As logging
introduces some extra code and especially increases the size of the wasm
blob. It is advised to disable all logging completely with
`sp-api/disable-logging` when doing the wasm builds for the on-chain
wasm runtime.
Besides these changes, the pr also brings most of the logging found in
frame to the same format "runtime::*".
* Update frame/im-online/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Update test-utils/runtime/Cargo.toml
* Fix test
* Don't use tracing in the runtime, as we don't support it :D
* Fixes
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
2021-03-01 15:29:17 +01:00
André Silva
f2d9bb9ea6
grandpa: maintain invariants when evaluating aggregated voting rules ( #8186 )
...
* grandpa: maintain invariants when evaluating aggregated voting rules
* grandpa: update comment on VotingRules::restrict_vote
* grandpa: simplify comment
2021-02-28 16:53:30 +00:00
Xiliang Chen
8ac2cd57cc
emit event on remark ( #8120 )
...
Co-authored-by: Parity Benchmarking Bot <admin@parity.io >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-02-28 11:02:46 +01:00
Gavin Wood
ed365da8b9
Gilts Pallet ( #8139 )
...
* Initial draft
* Enlarge function drafted.
* Thaw draft
* Retract_bid draft
* Final bits of draft impl.
* Test mockup
* Tests
* Docs
* Add benchmark scaffold
* Integrate weights
* All benchmarks done
* Missing file
* Remove stale comments
* Fixes
* Fixes
* Allow for priority queuing.
* Another test and a fix
* Fixes
* Fixes
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_gilt --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/gilt/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Grumble
* Update frame/gilt/src/tests.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update frame/gilt/src/tests.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Grumble
* Update frame/gilt/src/tests.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update frame/gilt/src/lib.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update frame/gilt/src/lib.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Fix unreserve ordering
* Grumble
* Fixes
Co-authored-by: Parity Benchmarking Bot <admin@parity.io >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-02-27 16:11:27 +01:00
Guillaume Thiolliere
65df4a9333
Fix ignored error in benchmark tests ( #8214 )
...
* fix ignored error in benchmark tests
* use normal format for str
* explicit match
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-02-26 19:50:58 +01:00
Kian Paimani
33b435894a
Better identifier and logging for runtime upgrades ( #8123 )
...
* A clean new attempt
* Checkpoint to move remote.
* A lot of dependency wiring to make it feature gated.
* bad macro, bad macro.
* Undo the DB mess.
* Update frame/support/src/traits.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* Apply suggestions from code review
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* unbreak the build
* Better logging and ids for migrations
* Fix doc.
* Test
* Update frame/try-runtime/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update utils/frame/try-runtime/cli/Cargo.toml
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update frame/try-runtime/Cargo.toml
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Address most review grumbles.
* Fix build
* Add some comments
* Remove allowing one pallet at a time.
* Rework the PR
* nit
* Slightly better error handling.
* Remove files
* Update utils/frame/remote-externalities/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update frame/support/src/dispatch.rs
* Update frame/support/src/dispatch.rs
* Fix test
* Make extension trait.
* Bring back try-runtime/std
* remove bincode
* Remove warning
* Change test features
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-02-26 15:41:23 +00:00
Pierre Krieger
2bd41a0251
Fix transactions not being propagated to authorities ( #8212 )
2021-02-26 15:09:42 +00:00
yjh
5013e7630e
chore: fix typos for contract ( #8178 )
2021-02-26 11:47:47 +01:00
Alexander Theißen
4bf0387237
contracts: Release as v3.0.0 and add reserved field to ContractInfoOf ( #8175 )
...
* contracts: Update README
* contracts: Add CHANGELOG.md
* contracts: Bump version to v3.0.0 and allow publish
* Typos
Co-authored-by: Andrew Jones <ascjones@gmail.com >
* Improve wording in the changelog
* contracts: Add reserved field to ContractInfoOf for future proofing
* also bump frame-benchmarking
* update lockfile
Co-authored-by: Andrew Jones <ascjones@gmail.com >
Co-authored-by: Benjamin Kampmann <ben@parity.io >
2021-02-25 17:04:48 +01:00
Benjamin Kampmann
0b4126ca40
Frame Benchmarking v3.1.0 released ( #8206 )
...
* Releasing frame-benchmarking 3.1
* bump in the entire dependency tree
2021-02-25 17:04:36 +01:00
Guillaume Thiolliere
f2436b87b5
pallet macro broke benchmarks_instance, fix by introducing benchmarks_instance_pallet ( #8190 )
...
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com >
2021-02-25 16:25:08 +01:00
Pierre Krieger
d5b308f13c
Fix networking debug_asserts ( #8200 )
...
* Fix networking debug_asserts
* Fix comment
2021-02-25 13:51:29 +01:00
Ashley
241302d0e4
Add an is_finished boolean to the grandpa warp sync response ( #8203 )
2021-02-25 12:39:30 +00:00
Guillaume Thiolliere
5232e8ad5c
allow to write pre and post runtime upgrade in pallet macro ( #8194 )
2021-02-25 11:43:48 +01:00
Jakub Pánik
f0c3656489
Add ss58 prefix for HydraDX ( #8058 )
...
* Add ss58 prefix for HydraDX
* fix formatting
2021-02-25 09:03:49 +00:00
André Silva
94c29ff666
grandpa: rewrite warp sync proof generation ( #8148 )
...
* grandpa: use AuthoritySetChanges to generate warp sync proof
* node: init grandpa warp sync protocol
* grandpa: iterator for AuthoritySetChanges
* grandpa: rewrite warp sync proof generation
* grandpa: remove old code for warp sync generation
* grandpa: fix indentation
* grandpa: fix off by one
* grandpa: use binary search to find start idx when generating warp sync proof
* grandpa: add method to verify warp sync proofs
* grandpa: remove unnecessary code to skip authority set changes
* grandpa: add test for warp sync proof generation and verification
* grandpa: add missing docs
* grandpa: remove trailing comma
2021-02-25 08:44:51 +00:00
Bastian Köcher
8a0e8ea9a6
Move proof generation to the type system level ( #8185 )
...
* Start
* Finish!!!!
* Update client/basic-authorship/src/basic_authorship.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
* Review comments
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
2021-02-24 20:43:50 +00:00
Tomasz Drwięga
3309c4366b
Display nicer inspect results. ( #8198 )
2021-02-24 20:00:00 +01:00
Pierre Krieger
a3d749f3c5
Add some debug_asserts for #8171 ( #8181 )
2021-02-24 17:13:34 +01:00
Kian Paimani
e9f12cb29e
Update lib.rs ( #8192 )
...
Turns out the polkadot bot assumes that this guys is exported from the root of the pallet.
2021-02-24 12:43:31 +00:00
joshua-mir
7d285f7474
[multisig, insubstantial] WeightTooLow -> MaxWeightTooLow ( #8112 )
2021-02-24 09:31:49 +01:00
Bastian Köcher
76d3814e90
Make on_slot return the block with the post header ( #8188 )
...
* Make `on_slot` return the block with the post header
Before this pr `on_slot` returned the pre block. However this is wrong,
because adding some post digest changes the hash of the header. Thus,
we need to make sure to return the correct block that uses the post
header.
* Update primitives/consensus/common/src/block_import.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
2021-02-24 08:03:05 +01:00
Wei Tang
3e3b5f9cba
Reserve ss58 prefix 48 for Neatcoin ( #8165 )
...
* Reserved ss58 prefixes for Neatcoin
* Switch to use 63
* Switch to use 48
2021-02-24 00:28:57 +01:00
Martin Pugh
ab325993b4
Remove suicide from frame_system weights ( #8184 )
...
* remove suicide from frame_system weights
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_system --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/system/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Update frame/system/src/weights.rs
Co-authored-by: Parity Benchmarking Bot <admin@parity.io >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-02-23 17:37:17 +00:00
Kian Paimani
7205eea40d
Decouple Staking and Election - Part 2 Unsigned Phase ( #7909 )
...
* Base features and traits.
* pallet and unsigned phase
* Undo bad formattings.
* some formatting cleanup.
* Small self-cleanup.
* Make it all build
* self-review
* Some doc tests.
* Some changes from other PR
* Fix session test
* Update Cargo.lock
* Update frame/election-provider-multi-phase/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Some review comments
* Rename + make encode/decode
* Do an assert as well, just in case.
* Fix build
* Update frame/election-provider-multi-phase/src/unsigned.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Las comment
* fix staking fuzzer.
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_election_provider_multi_phase --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/election-provider-multi-phase/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Add one last layer of feasibility check as well.
* Last fixes to benchmarks
* Some more docs.
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_election_provider_multi_phase --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/election-provider-multi-phase/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_election_provider_multi_phase --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/election-provider-multi-phase/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Some nits
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Fix doc
* Mkae ci green
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
Co-authored-by: Parity Benchmarking Bot <admin@parity.io >
2021-02-23 15:46:17 +01:00
Pierre Krieger
ba659f9440
Bump lru dependency ( #8182 )
2021-02-23 12:52:59 +01:00
Pierre Krieger
9e84a5405c
Add a Prometheus alert on no incoming connection ( #7517 )
2021-02-23 10:05:39 +01:00
Robin Syihab
e7ac265649
Make Regex in ss58codec and secret phrase crypto static ( #8117 ) ( #8177 )
2021-02-22 22:37:48 +01:00
Shawn Tabrizi
d25229bc89
Return number of keys removed when calling storage_kill on child trie ( #8166 )
...
* Initial piping of returning amount of keys killed
* One more test for `None` limit
* forgot to update
* fix return value
* use version 3
* Update to return `KillOutcome`
* Update name to KillChildStorageResult
2021-02-22 19:24:12 +00:00
Arkadiy Paronyan
74a1d69477
Bump thread_local ( #8174 )
2021-02-22 18:57:02 +01:00
Guillaume Thiolliere
115dcd81dc
Fix: stash account reaped when ledger.active == ED ( #8170 )
...
* do not reap account when active == ed
* add tests + refactor
2021-02-22 16:46:45 +00:00
Alexander Theißen
b2f393945a
contracts: Convert to framev2 macros ( #8157 )
...
* contracts: Convert to framev2
* Reduce the API surface of the crate
* Remove unused import
* Merge import block
* Use pallet::metadata to reduce metadata diff
* Remove the explicit "Null" from AccountCounter
2021-02-22 15:18:24 +00:00
Bastian Köcher
4f4a0c5b38
Make keystore return None when a key doesn't exist ( #8163 )
...
* Make keystore return `None` when a key doesn't exist
* Fixes
* More fixes
* Update comment
* Update primitives/keystore/src/lib.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
* Update client/keystore/src/local.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
* Address comments
* Update client/keystore/src/local.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
2021-02-22 14:24:09 +00:00