1. May 10, 2021
  2. May 09, 2021
  3. May 08, 2021
  4. May 07, 2021
    • Peter Goodspeed-Niklaus's avatar
      Relax `BoundedVec` trait restrictions (#8749) · b6897901
      Peter Goodspeed-Niklaus authored
      * requiring users to maintain an unchecked invariant is unsafe
      
      * relax trait restrictions on BoundedVec<T, S>
      
      A normal `Vec<T>` can do many things without any particular trait
      bounds on `T`. This commit relaxes the bounds on `BoundedVec<T, S>`
      to give it similar capabilities.
      b6897901
    • Alexander Theißen's avatar
      contracts: Refactor the exec module (#8604) · 9e894ce1
      Alexander Theißen authored
      
      
      * contracts: Add default implementation for Executable::occupied_storage()
      
      * contracts: Refactor the exec module
      
      * Let runtime specify the backing type of the call stack
      
      This removes the need for a runtime check of the specified
      `MaxDepth`. We can now garantuee that we don't need to
      allocate when a new call frame is pushed.
      
      * Fix doc typo
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * Review nits
      
      * Fix defect in contract info caching behaviour
      
      * Add more docs
      
      * Fix wording and typos
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      Co-authored-by: default avatarParity Benchmarking Bot <[email protected]>
      9e894ce1
    • Peter Goodspeed-Niklaus's avatar
      `#[derive(MaxEncodedLen)]` (#8737) · 17a1997d
      Peter Goodspeed-Niklaus authored
      * impl #[derive(MaxEncodedLen)] for structs
      
      * impl #[derive(MaxEncodedLen)] for enums, unions
      
      * break long comments onto multiple lines
      
      * add doc for public item
      
      * add examples to macro documentation
      
      * move MaxEncodedLen macro docs, un-ignore doc-tests
      17a1997d
  5. May 06, 2021
  6. May 05, 2021
    • Arkadiy Paronyan's avatar
      Added client function to delete a recent block (#8533) · d11e6051
      Arkadiy Paronyan authored
      
      
      * Implemented recent block removal
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      d11e6051
    • Roman Proskuryakov's avatar
    • Shaun Wang's avatar
      Migrate pallet-nicks to pallet attribute macro. (#8723) · 68a740c0
      Shaun Wang authored
      * Migrate pallet-nicks to pallet attribute macro.
      
      * Fix constants.
      68a740c0
    • Aten's avatar
      3d259fde
    • Shaun Wang's avatar
      Migrate pallet-im-online to pallet attribute macro. (#8714) · d0efe2d1
      Shaun Wang authored
      
      
      * Migrate pallet-im-online to pallet attribute macro.
      
      * Move validate_unsigned into pallet macro.
      
      * fix metadata
      
      * fix test
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      d0efe2d1
    • Kian Paimani's avatar
    • mattrutherford's avatar
      RPC to trace execution of specified block (#7780) · 6e8957b0
      mattrutherford authored
      
      
      * Add filter reload handle
      
      * add RPC, move logging module from cli to tracing
      
      * remove dup fn
      
      * working example
      
      * Update client/rpc-api/src/system/mod.rs
      
      Co-authored-by: default avatarPierre Krieger <[email protected]>
      
      * Prefer "set" to "reload"
      
      * Re-enable the commented out features of the logger
      
      * Remove duplicate code
      
      * cleanup
      
      * unneeded lvar
      
      * Bump to latest patch release
      
      * Add new CLI option to disable log filter reloading,
      
      Move profiling CLI options to SharedParams
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Applied suggestions from reviews
      
      * Fix calls to init_logger()
      
      * Handle errors when parsing logging directives
      
      * Deny `system_setLogFilter` RPC by default
      
      * One more time
      
      * Don't ignore parse errors for log directives set via CLI or RPC
      
      * Improve docs
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update client/cli/src/config.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * fix merge errors
      
      * include default directives with system_setLogFilter RPC,
      
      implement system_rawSetLogFilter RPC to exclude defaults
      
      * docs etc...
      
      * update test
      
      * refactor: rename fn
      
      * Add a test for system_set_log_filter – NOTE: the code should likely change to return an error when bad directives are passed
      
      * Update client/cli/src/lib.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Address review grumbles
      
      * Add doc note on panicking behaviour
      
      * print all invalid directives before panic
      
      * change RPCs to: addLogFilter and resetLogFilter
      
      * make CLI log directives default
      
      * add comments
      
      * restore previous behaviour to panic when hard-coded directives are invalid
      
      * change/refactor directive parsing
      
      * fix line width
      
      * add test for log filter reloading
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * finish up suggestions from code review
      
      * improve test
      
      * change expect message
      
      * change fn name
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * add docs, remove unused fn
      
      * propagate Err on invalid log directive
      
      * Update tracing-subscriber version
      
      * Improve docs for `disable_log_reloading` CLI param
      
      * WIP implementation: RPC and trace capturing
      
      * WIP
      
      * fix incorrect number of digest items
      
      * return errors
      
      * add From impl for Values, rename structs
      
      * fixes
      
      * implement option to choose targets for traces
      
      * rename fn
      
      * fix EnvFilter and add root span
      
      * fix root span
      
      * add docs, remove unnecessary traits
      
      * fix regression on parent_id introduced in a9c73113
      
      
      
      * fix line width
      
      * remove unused
      
      * include block hash, parent hash & targets in response
      
      * move types from sp-tracing into sp-rpc
      
      move block and parent hash into root of BlockTrace
      
      * switch from log::trace to tracing::trace in state-machine
      
      * use unsigned integer type to represent Ext::id in traces
      
      * ensure id is unique by implementing Subscriber
      
      tracing_subscriber::FmtSubscriber does not guarantee
      unique ids
      
      * indentation
      
      * fix typo
      
      * update types
      
      * add sp_io::storage events
      
      * Change response format
      
      - update types
      - record distinct timestamps
      - sort spans by first entered
      
      * convert to HexDisplay, refactor
      
      * Sort out fallout from merge
      
      * Update client/rpc-api/src/state/mod.rs
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Exit early unless the node runs with --rpc-methods=Unsafe
      
      * Better error handling
      
      * Use wasm-timer
      
      * revert trace alteration in `state-machine` and remove events in `sp_io::storage`
      
      Resolve in follow-up PR
      
      * Review feedback: less collects
      
      * Without Arcs
      
      * Fix span exit
      
      * typo
      
      * cleanup
      
      * Add a few debug messages to tracing module
      
      * Structure traces state-machine/ext; Dispatchable extrinsics spans not working
      
      * Correctly encode Option storage values
      
      * Remove test field for Put and Get
      
      * Try out some changes to dispatch macro
      
      * Add various log messages in dispatch
      
      * Add span dispatch span to new proc macro
      
      * Remove debug messages in dispatch
      
      * Trivial clean up
      
      * Structure remaining state-machine traces (ChangesRoot*)
      
      * Removed unnesecary tracing targets
      
      * Remove log
      
      * New cargo.lock post merge
      
      * Add logging for wasm_overrides
      
      * remove temp logs
      
      * remove temp logs
      
      * remove unused dep
      
      * remove temp logs
      
      * add logging to wasm_overrides
      
      * add logging to state_tracing
      
      * add logging for spans to substrate (includes timings)
      
      * Skip serializing some event fields; Remove most storage traces
      
      * Bring back all ext.rs traces
      
      * Do not skip bool values in events
      
      * Skip serializing span values
      
      * Serialize span values; remove some trace events in ext
      
      * Remove more trace events
      
      * Delete commented out traces
      
      * Remove all unused traces
      
      * Add event filtering
      
      * Fix typo
      
      * wip - change response types to be more efficient
      
      missing import
      
      type
      
      * Serialize struct fields as camelCase
      
      * Add back in event filtering
      
      * Remove name field from event
      
      * Sort spans by time entered
      
      * Sort spans in ASCending order
      
      * Add storage keys target param to rpc
      
      * Limit payload size; improve hash fields; include storage keys
      
      - cleanup event_key_filter
      - better block hash representation
      - limit payload size
      - cleanup based on andrews comments
      
      * Error when serialized payload is to big
      
      * Import MAX_PAYLOAD from rpc-servers
      
      * Clean up ext.rs
      
      * Misc. cleaning and comments
      
      * Strict ordering span Id; no span sort; adjust for rpc base payload
      
      * Add RPC docs to rpc-api/src/state/mod
      
      * Make params bullet points
      
      * Update primitives/rpc/src/tracing.rs
      
      * Put all tracing logic within trace
      
      * Remove attr.record in new_span
      
      * Add back value record in new_span
      
      * restore result collection in ext
      
      * Revert "Add back value record in new_span"
      
      This reverts commit baf1a735f23e5eef1bf6264adfabb788910fa661.
      
      * 🤦
      
      * more 🤦
      
      
      
      * Update docs; Try fix line width issues
      
      * Improve docs
      
      * Improve docs
      
      * Remove default key filters + add key recs to docs
      
      * Try restore old traces
      
      * Add back doc comment
      
      * Clean up newlines in ext.rs
      
      * More new line remova;
      l
      
      * Use FxHashMap
      
      * Try use EnvFilter directives for event filtering
      
      * Remove directive, filter events by fields
      
      * Use trace metadata correctly
      
      * Try EnvFilter directive with all default targets
      
      * Revert "Try EnvFilter directive with all default targets"
      
      This reverts commit 4cc6ebc721d207c3b846444174f89d45038525ac.
      
      * Clean up clippy warning
      
      * Incorporate Niklas feedback
      
      * Update trace/log macro calls to have better syntx
      
      * Use Ordering::Relaxed
      
      * Improve patch and filter doc comment
      
      * Clean up `BlockSubscriber::new`
      
      * Try optimize `BlockSubscriber::enabled`
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Use contains_key
      
      * use heuristic for payload size
      
      * Add error tupe for client::tracing::block
      
      * Minor tweaks
      
      * Make a note about `--features with-tracing`
      
      * Add CURL example to RPC docs
      
      * Link to substrate-archibe wasm
      
      * Trivial doc clean up based on David feedback
      
      * Explicit result type name
      
      * Respect line length
      
      * Use the error
      
      * Don't print timings when spans close
      
      * Fix failing sc-rpc-api
      
      * Update  sp-tracing inner-line doc
      
      * Update client/tracing/src/block/mod.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update client/service/src/client/call_executor.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update client/service/src/client/call_executor.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update client/tracing/src/block/mod.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update client/tracing/src/block/mod.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Address some review grumbles
      
      * Update primitives/state-machine/src/ext.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Use result_encoded structure fields in ext.rs
      
      * Use value key for ext put
      
      * Add notes about tracing key names matter
      
      Co-authored-by: default avatarMatt <[email protected]>
      Co-authored-by: default avatarDavid <[email protected]>
      Co-authored-by: default avatarPierre Krieger <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avataremostov <[email protected]>
      6e8957b0
  7. May 04, 2021
  8. May 03, 2021
    • Pierre Krieger's avatar
    • Bastian Köcher's avatar
      Rework inherent data client side (#8526) · 2675741a
      Bastian Köcher authored
      
      
      * Lol
      
      * Yeah
      
      * Moare
      
      * adaasda
      
      * Convert AURA to new pallet macro
      
      * AURA: Switch to `CurrentSlot` instead of `LastTimestamp`
      
      This switches AURA to use `CurrentSlot` instead of `LastTimestamp`.
      
      * Add missing file
      
      * Update frame/aura/src/migrations.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * Remove the runtime side provide inherent code
      
      * Use correct weight
      
      * Add TODO
      
      * Remove the Inherent from AURA
      
      * 🤦
      
      
      
      * Remove unused stuff
      
      * Update primitives authorship
      
      * Fix babe inherent data provider
      
      * Fix consensus-uncles
      
      * Fix BABE
      
      * Do some further changes to authorship primitives... :D
      
      * More work
      
      * Make it compile the happy path
      
      * Make it async!
      
      * Take hash
      
      * More stuff
      
      * Hacks
      
      * Revert "Hacks"
      
      This reverts commit cfffad88668cfdebf632a59c4fbfada001ef8251.
      
      * Fix
      
      * Make `execute_block` return the final block header
      
      * Move Aura digest stuff
      
      * Make it possible to disable equivocation checking
      
      * Fix fix fix
      
      * Some refactorings
      
      * Comment
      
      * Fixes fixes fixes
      
      * More cleanups
      
      * Some love
      
      * Better love
      
      * Make slot duration being exposed as `Duration` to the outside
      
      * Some slot info love
      
      * Add `build_aura_worker` utility function
      
      * Copy copy copy
      
      * Some stuff
      
      * Start fixing pow
      
      * Fix pow
      
      * Remove some bounds
      
      * More work
      
      * Make grandpa work
      
      * Make slots use `async_trait`
      
      * Introduce `SharedData`
      
      * Add test and fix bugs
      
      * Switch to `SharedData`
      
      * Make grandpa tests working
      
      * More Babe work
      
      * Make grandpa work
      
      * Introduce `SharedData`
      
      * Add test and fix bugs
      
      * Switch to `SharedData`
      
      * Make grandpa tests working
      
      * More Babe work
      
      * Make it async
      
      * Fix fix
      
      * Use `async_trait` in sc-consensus-slots
      
      This makes the code a little bit easier to read and also expresses that
      there can always only be one call at a time to `on_slot`.
      
      * Make grandpa tests compile
      
      * More Babe tests work
      
      * Fix network test
      
      * Start fixing service test
      
      * Finish service-test
      
      * Fix sc-consensus-aura
      
      * Fix fix fix
      
      * More fixes
      
      * Make everything compile *yeah*
      
      * Make manual-seal compile
      
      * More fixes
      
      * Start fixing Aura
      
      * Fix Aura tests
      
      * Fix Babe tests
      
      * Make everything compile
      
      * Move code around and switch to async_trait
      
      * Fix Babe
      
      * Docs docs docs
      
      * Move to FRAME
      
      * Fix fix fix
      
      * Make everything compile
      
      * Last cleanups
      
      * Fix integration test
      
      * Change slot usage of the timestamp
      
      * We really need to switch to `impl-trait-for-tuples`
      
      * Update primitives/inherents/src/lib.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * Update primitives/inherents/src/lib.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * Update primitives/inherents/src/lib.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * Some extra logging
      
      * Remove dbg!
      
      * Update primitives/consensus/common/src/import_queue/basic_queue.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      2675741a
    • Roman Proskuryakov's avatar
      Add a JSON-RPC layer for reserved nodes (#8704) · ef07c3be
      Roman Proskuryakov authored
      
      
      * Add boilerplate for JSON-RPC layer for reserved nodes
      
      * Add more boilerplate for JSON-RPC layer for reserved nodes
      
      * Make JSON-RPC layer for reserved nodes async
      
      * Use more realistic data in reserver_peers tests
      
      * Make JSON-RPC layer for reserved nodes blocking
      
      * Apply tomaka's suggestion to reduce .into_iter() for an iter
      
      Co-authored-by: default avatarPierre Krieger <[email protected]>
      
      Co-authored-by: default avatarPierre Krieger <[email protected]>
      ef07c3be
    • Peter Goodspeed-Niklaus's avatar
      Multi-phase elections solution resubmission (#8290) · de5d0b23
      Peter Goodspeed-Niklaus authored
      
      
      * not climate
      
      * explain the intent of the bool in the unsigned phase
      
      * remove glob imports from unsigned.rs
      
      * add OffchainRepeat parameter to ElectionProviderMultiPhase
      
      * migrate core logic from #7976
      
      This is a much smaller diff than that PR contained, but I think
      it contains all the essentials.
      
      * improve formatting
      
      * fix test build failures
      
      * cause test to pass
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * collapse imports
      
      * threshold acquired directly within try_acquire_offchain_lock
      
      * add test of resubmission after interval
      
      * add test that ocw can regenerate a failed cache when resubmitting
      
      * ensure that OCW solutions are of the correct round
      
      This should help prevent stale cached solutions from persisting
      past the election for which they are intended.
      
      * add test of pre-dispatch round check
      
      * use `RawSolution.round` instead of redundantly externally
      
      * unpack imports
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * rename `OFFCHAIN_HEAD_DB` -> `OFFCHAIN_LOCK`
      
      * rename `mine_call` -> `mine_checked_call`
      
      * eliminate extraneous comma
      
      * check cached call is current before submitting
      
      * remove unused consts introduced by bad merge.
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * resubmit when our solution beats queued solution
      
      * clear call cache if solution fails to submit
      
      * use local storage; clear on ElectionFinalized
      
      * Revert "use local storage; clear on ElectionFinalized"
      
      This reverts commit 4b46a9388532d0c09b337dc7c7edf76044a6cee8.
      
      * BROKEN: try to filter local events in OCW
      
      * use local storage; simplify score fetching
      
      * fix event filter
      
      * mutate storage instead of setting it
      
      * StorageValueRef::local isn't actually implemented yet
      
      * add logging for some events of interest in OCW miner
      
      * rename kill_solution -> kill_ocw_solution to avoid ambiguity
      
      * defensive err instead of unreachable given unreachable code
      
      * doc punctuation
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * distinguish miner errors between "out of date" and "call invalid"
      
      * downgrade info logs -> debug
      
      * ensure encoded call decodes as a call
      
      * fix semantics of validation of pre-dispatch failure for wrong round
      
      * move score check within `and_then`
      
      * add test that offchain workers clear their cache after election
      
      * ensure that bad ocw submissions are not retained for resubmission
      
      * simplify fn ocw_solution_exists
      
      * add feasibility check when restoring cached solution
      
      should address https://github.com/paritytech/substrate/pull/8290/files#r617533358
      
      
      
      restructures how the checks are sequenced, which simplifies legibility.
      
      * simplify checks again
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      de5d0b23
    • thiolliere's avatar
    • Lohann Paterno Coutinho Ferreira's avatar
      Remove Offence delay (#8414) · ffca28ba
      Lohann Paterno Coutinho Ferreira authored
      
      
      * Removed can_report api from OnOffenceHandler
      
      * Removed DeferredOffences and create a storage migration
      
      * Removed missing comments
      
      * Mock set_deferred_offences and deferred_offences methods
      
      * OnOffenceHandler::on_offence always succeed
      
      * Fix benchmark tests
      
      * Fix runtime-benchmark cfg methods
      
      * Removed 'applied' attribute from Offence event
      
      * refactor deprecated deferred offences getter
      
      * Validate if offences are submited after on_runtime_upgrade
      
      * update changelog
      
      * Remove empty lines
      
      * Fix remove_deferred_storage weights
      
      * Remove Offence::on_runtime_upgrade benchmark
      
      * Revert CHANGELOG.md update
      
      * Deprecate DeferredOffenceOf type
      
      * Update copyright
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Add migration logs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Fix migration log
      
      * Remove unused import
      
      * Add migration tests
      
      * rustfmt
      
      * use generate_storage_alias! macro
      
      * Refactor should_resubmit_deferred_offences test
      
      * Replace spaces by tabs
      
      * Refactor should_resubmit_deferred_offences test
      
      * Removed WeightSoftLimit
      
      * Removed WeightSoftLimit from tests and mocks
      
      * Remove unused imports
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      ffca28ba