- Mar 11, 2021
-
-
Wei Tang authored
-
Pierre Krieger authored
-
dependabot[bot] authored
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.22 to 0.1.25. - [Release notes](https://github.com/tokio-rs/tracing/releases) - [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.22...tracing-0.1.25) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-
Cecile Tonglet authored
polkadot companion: paritytech/polkadot#2535
-
Andreas Doerr authored
-
Peter Goodspeed-Niklaus authored
* Apply. * get rid of glob import * use meaningful generic type name * pjr_check operates on `Supports` struct used elsewhere * improve algorithmic complexity of `prepare_pjr_input` * fix rustdoc warnings * improve module docs * typo * simplify debug assertion * add test finding the phase-change threshold value for a constructed scenario * add more threshold scenarios to disambiguate plausible interpretations * add link to npos paper reference * docs: staked_assignment -> supports Co-authored-by: Kian Paimani <[email protected]> * add utility method for generating npos inputs * add a fuzzer which asserts that all unbalanced seq_phragmen are PJR Note that this currently fails. I hope that this can be rectified by calculating the threshold instead of choosing some arbitrary number. * assert in all cases, not just debug * leverage a native solution to choose candidates * use existing helper methods * add pjr-check and incorporate into the fuzzer We should probably have one of the W3F people look at this to ensure we're not misconstruing any definitions, but this seems like a fairly straightforward implementation. * fix compilation errors * Enable manually setting iteration parameters in single run. This gives us the ability to reproducably extract cases where honggfuzz has discovered a panic. For example: $ cargo run --release --bin phragmen_pjr -- --candidates 569 --voters 100 Tue 23 Feb 2021 11:23:39 AM CET Compiling bitflags v1.2.1 Compiling unicode-width v0.1.8 Compiling unicode-segmentation v1.7.1 Compiling ansi_term v0.11.0 Compiling strsim v0.8.0 Compiling vec_map v0.8.2 Compiling proc-macro-error-attr v1.0.4 Compiling proc-macro-error v1.0.4 Compiling textwrap v0.11.0 Compiling atty v0.2.14 Compiling heck v0.3.2 Compiling clap v2.33.3 Compiling structopt-derive v0.4.14 Compiling structopt v0.3.21 Compiling sp-npos-elections-fuzzer v2.0.0-alpha.5 (/home/coriolinus/Documents/Projects/paritytech/substrate/primitives/npos-elections/fuzzer) Finished release [optimized] target(s) in 6.15s Running `/home/coriolinus/Documents/Projects/paritytech/substrate/target/release/phragmen_pjr -c 569 -v 100` thread 'main' panicked at 'unbalanced sequential phragmen must satisfy PJR', primitives/npos-elections/fuzzer/src/phragmen_pjr.rs:133:5 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace This is still not adequate proof that seq_phragmen is broken; it could very well be that our PJR checker is doing the wrong thing, or we've somehow missed a parameter of interest. Still, it's concerning. * update comment verbiage for accuracy * it is valid in PJR for an elected candidate to have 0 support * Fix phragmen_pjr fuzzer It turns out that the fundamental problem causing previous implementations of the fuzzer to fail wasn't in `seq_phragmen` _or_ in `pjr_check`: it was in the rounding errors introduced in the various conversions between the internal data representation and the external one. Fixing the fuzzer is then simply an issue of using the internal representation and staying in that representation. However, that leaves the issue that `seq_phragmen` occasionally produces an output which is technically not PJR due to rounding errors. In the future we will need to add some kind of "close-enough" threshold. However, that is explicitly out of scope of this PR. * restart ci; it appears to be stalled * use necessary import for no-std * use a more realistic distribution of voters and candidates This isn't ideal; more realistic numbers would be about twice these. However, either case generation or voting has nonlinear execution time, and doubling these values brings iteration time from ~20s to ~180s. Fuzzing 6x as fast should make up for fuzzing cases half the size. * identify specifically which PJR check may fail * move candidate collection comment into correct place * standard_threshold: use a calculation method which cannot overflow * Apply suggestions from code review (update comments) Co-authored-by: Kian Paimani <[email protected]> * clarify the effectiveness bounds for t-pjr check * how to spell "committee" * reorganize: high -> low abstraction * ensure standard threshold calc cannot panic Co-authored-by: Kian Paimani <[email protected]> * Apply suggestions from code review Co-authored-by: Shawn Tabrizi <[email protected]> Co-authored-by: kianenigma <[email protected]> Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]>
-
- Mar 10, 2021
-
-
asynchronous rob authored
* more clear randomness API for BABE * babe: move randomness utilities to its own file * node: use babe::RandomnessFromOneEpochAgo in random_seed implementation * frame-support: annotate randomness trait with block number * pallet-randomness-collective-flip: fix for new randomness trait * pallet-society: fix randomness usage * pallet-lottery: fix randomness usage * pallet-contracts: fix randomness usage * pallet-babe: fix randomness usage we need to track when the current and previous epoch started so that we know the block number by each existing on-chain was known * node: fix random_seed * node-template: fix random_seed * frame-support: extend docs * babe: add test for epoch starting block number tracking * babe: fix epoch randomness docs * frame: add todos for dealing with randomness api changes Co-authored-by: André Silva <[email protected]>
-
Tomasz Drwięga authored
* Add MMR custom RPC. * Change RuntimeApi to avoid hardcoding leaf type. * Properly implement the new RuntimeAPI and wire up RPC. * Extract Offchain DB as separate execution extension. * Enable offchain DB access for offchain calls. * Fix offchain_election tests. * Skip block initialisation for proof generation. * Fix integration test setup. * Fix offchain tests. Not sure how I missed them earlier
🤷 . * Fix long line. * One more test missing. * Update mock for multi-phase. * Address review grumbbles. * Address review grumbles. * Fix line width of a comment -
Denis_P authored
* CI: return docs jobs allowing them to fail * CI: refrain from Dwarnings for now * CI: pass RUSTFLAGS directly; no need removing what wasn't there
-
Ashley authored
* Make changes * Add serialize/deserialize, copy babe epoch config defaults from node runtime * Fix line widths and turn default features off for serde * Remove ser/deser from Epoch, fix node-cli * Apply suggestions * Add comment to BABE_GENESIS_EPOCH_CONFIG in bin * Apply suggestions * Add a sketchy migration function * Add a migration test * Check for PendingEpochConfigChange as well * Make epoch_config in node-cli * Move updating EpochConfig out of the if * Fix executor tests * Calculate weight for add_epoch_configurations * Fix babe test * Apply suggestions from code review Co-authored-by: André Silva <[email protected]> * Add more asserts to tests, remove unused changes to primitives/slots * Allow setting the migration pallet prefix * Rename to BabePalletPrefix Co-authored-by: André Silva <[email protected]>
-
- Mar 09, 2021
-
-
Bastian Köcher authored
-
Bastian Köcher authored
* Introduce new concept of "slot portion for proposing" Currently when building a block we actually give the proposer all of the time in the slot, while this is wrong. The slot is actually split in at least two phases proposing and propagation or in the polkadot case into three phases validating pov's, proposing and propagation. As we don't want to bring that much polkadot concepts into Substrate, we only support splitting the slot into proposing and propagation. The portion can now be passed as parameter to AuRa and BABE to configure this value. However, this slot portion for propagation doesn't mean that the proposer can not go over this limit. When we miss slots we still apply the lenience factor to increase the proposing time, so that we have enough time to build a heavy block. Besides all what was said above, this is especially required for parachains. Parachains have a much more constraint proposing window. Currently the slot duration is at minimum 12 seconds, but we only have around 500ms for proposing. So, this slot portion for proposing is really required to make it working without hacks. * Offgit feedback * Cast cast cast
-
Alexander Theißen authored
-
Liu-Cheng Xu authored
-
Bastian Köcher authored
* Decrease the peer reputation on invalid block requests This pr changes the block request handler to decrease the reputation of peers when they send the same request multiple times or they send us an invalid block request. * Review feedback * Change log target * Remove unused code
-
Niklas Adolfsson authored
-
Gavin Wood authored
* IgnoredIssuance * Fixes * Fixes
-
Gavin Wood authored
* Initial work * Tests for frame system * Self-sufficient account ref-counting * Fixes * Benchmarks building. * Update frame/system/src/lib.rs Co-authored-by: Jaco Greeff <[email protected]> * Fixes * Fixes * Fixes * Fixes * Fixes * Fixes * Test approvals * Fixes * Report assets pallet tests * Tests for approvals & force_cancel_approval * Use structs rather than tuples for approval data * Add force_asset_status, force_set_metadata * Add clear_metadata. * approval benchmarks * force_asset_status benchmarks * final benchmarks * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Update frame/system/src/lib.rs Co-authored-by: Guillaume Thiolliere <[email protected]> * Update frame/system/src/lib.rs Co-authored-by: Guillaume Thiolliere <[email protected]> * Update frame/system/src/lib.rs Co-authored-by: Guillaume Thiolliere <[email protected]> * Docs for new approval dispatches. * Docs for pallet. * Remove accidental code. * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/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_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Fixes * Update frame/assets/src/lib.rs Co-authored-by: Shawn Tabrizi <[email protected]> * Grumbles. * Transfer zero works, use DispatchResult * fix test * Remove force_destroy * Remove TODO * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs * transfer_keep_alive * Fixes * Fixes * Fixes * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs Co-authored-by: Jaco Greeff <[email protected]> Co-authored-by: Parity Benchmarking Bot <[email protected]> Co-authored-by: Guillaume Thiolliere <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]>
-
- Mar 08, 2021
-
-
honeywest authored
* optimize code * fix clippy replace = with += or %= * fix redundant closure found warning * redundant field names in struct initialization * fix clippy warning and optimize code * fix clippy warning * fix clippy warning * fix test error
-
Alexander Theißen authored
-
- Mar 06, 2021
-
-
Niklas Adolfsson authored
* A clean new attempt * Checkpoint to move remote. * A lot of dependency wiring to make it feature gated. * bad macro, bad macro. * refactor(remote ext): use jsonrpsee * refactor(remote ext): use jsonrpsee * Undo the DB mess. * fix(remote ext): use max limit `u32::MAX` * resolve TODOs * jsonrpsee switch to `hyper` as backend * Update utils/frame/try-runtime/remote-externalities/src/lib.rs Co-authored-by: Kian Paimani <[email protected]> * update jsonrpsee * remove boiler-plate * suppress warnings to CI happy * Unbreak his build * Use option * fix nit; make it work again * fix err message. * Update utils/frame/remote-externalities/Cargo.toml * Fix uri stuff * remove needless clone Co-authored-by: kianenigma <[email protected]> Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: kianenigma <[email protected]>
-
Bastian Köcher authored
Currently we wrap every `GenesisConfig` field in an `Option`, while we require `Default` being implemented for all pallet genesisconfigs. Passing `None` also results in the genesis not being initialized, which is a bug as seen from the perspective of a pallet developer? This pr changes the fields of the `GenesisConfig` to non `Option` types.
-
- Mar 05, 2021
-
-
Bastian Köcher authored
* AuRa improvements Hot and fresh AuRa improvements. This pr does the following: - Move code belonging to the import queue etc to import_queue.rs - Introduce `ImportQueueParams` and `StartAuraParams` structs to make it more easier to understand what parameters we pass to AuRa. - Introduce `CheckForEquivocation` to tell AuRa if it should check for equivocation on block import. This is required for parachains, because they are allowed to equivocate when they build two blocks for the same slot, but for different relay chain parents. * Update client/consensus/aura/src/import_queue.rs Co-authored-by: André Silva <[email protected]> * Fix compilation * AAA Co-authored-by: André Silva <[email protected]>
-
thiolliere authored
* implement * make default pre/post_upgrade * simplify Cargo.toml * revert removal of outdated/private links * link in pallet-mmr
-
Bastian Köcher authored
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.
-
- Mar 04, 2021
-
-
asynchronous rob authored
* babe: introduce a request-answering mechanic * gromble * send method
-
thiolliere authored
-
- Mar 03, 2021
-
-
Gavin Wood authored
* Self-sufficient account ref-counting * Fixes * Update frame/system/src/lib.rs Co-authored-by: Jaco Greeff <[email protected]> * Fixes * Fixes * Fixes * Fixes * Fixes * Update frame/system/src/lib.rs Co-authored-by: Guillaume Thiolliere <[email protected]> * Update frame/system/src/lib.rs Co-authored-by: Guillaume Thiolliere <[email protected]> * Update frame/system/src/lib.rs Co-authored-by: Guillaume Thiolliere <[email protected]> * fix build * Update frame/system/src/lib.rs Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Jaco Greeff <[email protected]> Co-authored-by: Guillaume Thiolliere <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]> Co-authored-by: Kian Paimani <[email protected]>
-
Bastian Köcher authored
That was actually a bad idea by me, because it should essentially be the same as block.header. Ty @Kianenigma
-
Kian Paimani authored
* Add logs to proc macro pallet. * update logs.
-
thiolliere authored
* allow dispatch result * remove custom error message * format * add forgotten UI test * fix test * fix tests
-
Bastian Köcher authored
This pr changes the `ExecuteBlock` trait to return the final header that results from executing the given block.
-
Bastian Köcher authored
* 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 <[email protected]> * Review feedback * Make BABE use the new functionality Co-authored-by: André Silva <[email protected]>
-
- Mar 02, 2021
-
-
thiolliere authored
* migration helper * fix move_storage * format * doc * improve doc * Update frame/support/src/storage/migration.rs Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
-
thiolliere authored
-
Shawn Tabrizi authored
* 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 <[email protected]> * Update bin/node-template/pallets/template/Cargo.toml Co-authored-by: Bastian Köcher <[email protected]>
-
Shawn Tabrizi authored
* 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 <[email protected]>
-
Alexander Theißen authored
* contracts: Use unstable sort for topics * Add warning about non-determinism
-
- Mar 01, 2021
-
-
Pierre Krieger authored
-
André Silva authored
-