Skip to content
  1. Dec 18, 2019
    • Bastian Köcher's avatar
      Make `decl_error!` errors usable · 50cad21e
      Bastian Köcher authored
      This pr implements support for returning errors of different pallets in
      a pallet. These errors need to be declared with `decl_error!`.
      
      The pr changes the following:
      
      - Each dispatchable function now returns a `DispatchResult` which is an
      alias for `Result<(), DispatchError>`.
      - `DispatchError` is an enum that has 4 variants:
        - `Other`: For storing string error messages
        - `CannotLookup`: Variant that is returned when something returns a
        `sp_runtime::LookupError`
        - `BadOrigin`: Variant that is returned for any kind of bad origin
        - `Module`: The error of a specific module. Contains the `index`,
        `error` and the `message`. The index is the index of the module in
        `construct_runtime!`. `error` is the index of the error in the error
        enum declared by `decl_error!`. `message` is the message to the error
        variant (this will not be encoded).
      - `construct_runtime!` now creates a new struct `ModuleToIndex`. This
      struct implements the trait `ModuleToIndex`.
      - `frame_system::Trait` has a new associated type: `ModuleToIndex` that
      expects the `ModuleToIndex` generated by `construct_runtime!`.
      - All error strings returned in any module are being converted now to `DispatchError`.
      - `BadOrigin` is the default error returned by any type that implements `EnsureOrigin`.
      50cad21e
    • André Silva's avatar
      grandpa: fix slow gossip test (#4440) · adc8d505
      André Silva authored and asynchronous rob's avatar asynchronous rob committed
      adc8d505
    • André Silva's avatar
      grandpa: log everything under afg target (#4443) · 00bb3829
      André Silva authored and asynchronous rob's avatar asynchronous rob committed
      00bb3829
    • asynchronous rob's avatar
      client: Do not set fork sync request via network-gossip (#4439) · b84a4c6b
      asynchronous rob authored
      The finality-grandpa module needs two sets of functionalities from the
      network:
      
      1. Everything gossip related, e.g. event_stream, write_notification, ...
      
      2. The ability to set a fork sync request for a specific block hash.
      
      Instead of embedding (2) inside of (1) this patch extracts (2) from (1)
      having finality-grandpa depend on a `Network` that fulfills the
      `network_gossip::Network` trait and that can set block sync requests.
      
      On the one hand this improves the overall structure splitting things
      that don't logically belong together. On the other hand it does
      reintroduce a lot of trait bounds within finality-grandpa.
      b84a4c6b
    • asynchronous rob's avatar
      RPCs for reserved peers (#4423) · 496dce56
      asynchronous rob authored
      
      
      * RPC forwarders for adding reserved peers
      
      * implement service side of reserved-peer RPCs
      
      * Clean up unnecessary format! invocation
      
      Co-Authored-By: default avatarNiklas Adolfsson <[email protected]>
      
      * add some tests for the new RPC methods
      
      * remove redundant `data` field
      
      Co-Authored-By: default avatarTomasz Drwięga <[email protected]>
      496dce56
    • Weiliang Li's avatar
      e3b382ca
    • Wei Tang's avatar
      pallet-evm: default implementation for FeeCalculator and ConvertAccountId and... · b4a39f32
      Wei Tang authored
      pallet-evm: default implementation for FeeCalculator and ConvertAccountId and separate gas price (#4424)
      
      * Default implementation for FeeCalculator and ConvertAccountId and separate gas price
      
      * Styling fixes and some docs addition
      
      * TruncateConvertAccountId -> HashTruncateConvertAccountId
      
      * Fix compile
      b4a39f32
    • Drew Stone's avatar
      Add Edgeware network ID to core/crypto and subkey (#4426) · df750ba0
      Drew Stone authored
      * Add linear back-off for aura slot workers
      
      * logging
      
      * Use slot from header
      
      * Get network id for Edgeware and add to subkey
      df750ba0
    • Shawn Tabrizi's avatar
      More `decl_error!` migrations (#4427) · 56b127e7
      Shawn Tabrizi authored
      * Update assets to `decl_error`
      
      * Update aura to `decl_error`
      
      * Update authority discovery to `decl_error`
      
      * Update collective to `decl_error`
      
      * Update evm to `decl_error!`
      
      * Fix error with replace
      
      * Revert "Update authority discovery to `decl_error`"
      
      This reverts commit 26e8f3c5.
      
      * Revert "Update aura to `decl_error`"
      
      This reverts commit 8f17c44c.
      
      * Update democracy to `decl_error`
      
      * Update finality-tracker to `decl_error`
      
      * Update grandpa to `decl_error`
      
      * `assert` to `ensure` in dispatchable function
      56b127e7
    • Gavin Wood's avatar
      Fix the subkey error message (#4428) · 6f9d8018
      Gavin Wood authored
      * Fix the subkey error message
      
      * Fix check_benchmarks
      6f9d8018
    • Gavin Wood's avatar
      Remove incorrect assumption that runners-up were sorted by account (#4429) · 97d65310
      Gavin Wood authored
      * Remove incorrect assumption that runners-up were sorted by account
      
      * Fix
      
      * Update lib.rs
      97d65310
  2. Dec 17, 2019
  3. Dec 16, 2019
    • Shawn Tabrizi's avatar
      Make sudo use `decl_error!` (#4369) · 0d022840
      Shawn Tabrizi authored
      * Make sudo use `decl_error`
      
      * copy pasta error
      
      * Update to use `as_str`
      
      * Add doc
      
      * Add back `decl_error`
      0d022840
    • Tomasz Drwięga's avatar
      [big refactor] Remove crate aliasing. (#4395) · 40a16efe
      Tomasz Drwięga authored
      * Rename: Phase 1.
      
      * Unify codec.
      
      * Fixing: Phase 2
      
      * Fixing: Phase 3.
      
      * Fixing: Phase 4.
      
      * Fixing: Phase 5.
      
      * Fixing: Phase 6.
      
      * Fixing: Phase 7.
      
      * Fixing: Phase 8. Tests
      
      * Fixing: Phase 9. Tests!!!
      
      * Fixing: Phase 10. Moar tests!
      
      * Finally done!
      
      * More fixes.
      
      * Rename primitives:: to sp_core::
      
      * Apply renames in finality-grandpa.
      
      * Fix benches.
      
      * Fix benches 2.
      
      * Revert node-template.
      
      * Fix frame-system in our modules.
      40a16efe
    • Gavin Wood's avatar
      Identity module enhancements (#4401) · 01765762
      Gavin Wood authored
      * Updates; not yet tested.
      
      * Fix and add tests
      
      * Add test
      
      * Update a few comments
      01765762
    • Gavin Wood's avatar
      Remove proposal when it is refused (#4399) · 13b13087
      Gavin Wood authored
      * Remove proposal when it is refused.
      
      * Fix build, add test
      13b13087
  4. Dec 15, 2019
  5. Dec 14, 2019
    • cheme's avatar
      Fix key collision for child trie (#4162) · 9f4c7b78
      cheme authored
      * In progress, runtime io must switch to future proof root +
      child_specific (unique id) + u32 type.
      
      * Switch interface, sr-io seems ok, rpc could use similar interface to
      sr-io, genesis json broken if there is child trie in existing encoding
      genesis.
      
      * test from previous implementation.
      
      * fix proving test.
      
      * Restore Keyspacedb from other branch, only apply to child trie.
      
      * Removing unneeded child_info from child root (child info are stored
      if things changed, otherwhise the root does not change).
      
      * Switch rpc to use same format as ext: more future proof.
      
      * use root from child info for trie backend essence.
      
      * Breaking long lines.
      
      * Update doc and clean pr a bit.
      
      * fix error type
      
      * Restore removed doc on merge and update sr-io doc.
      
      * Switch child storage api to use directly unique id, if managed id
      where to be put in place, the api will change at this time.
      
      * Clean deprecated host interface from child.
      
      * Removing assertion on child info (can fail depending on root
      memoization).
      
      * merging child info in the overlay when possible.
      
      * child iteration by prefix using child_info.
      
      * Using ChainInfo in frame support. ChainInfo gets redesign to avoid
      buffers allocation on every calls.
      
      * Add length of root to the data of child info.
      
      * comments
      
      * Encode compact.
      
      * Remove child info with root.
      
      * Fix try_update condition.
      
      * Comment Ext child root caching.
      
      * Replace tuples by struct with field
      
      * remove StorageTuple alias.
      
      * Fix doc tests, and remove StorageOverlay and ChildStorageOverlay
      aliases.
      9f4c7b78
    • Benjamin Kampmann's avatar
  6. Dec 13, 2019
    • Pierre Krieger's avatar
      Extract consensus_gossip.rs and put it in its own crate (#4284) · 723148f1
      Pierre Krieger authored
      
      
      * Extract gossiping system from network
      
      * Finish porting GRANDPA tests
      
      * Try put correct engine ID
      
      * Fix messages encoding
      
      * Fix communication tests
      
      * Use a threads pool to spawn stuff
      
      * Fix compilation everywhere
      
      * Fix bad merge conflict
      
      * Remove dependency on async-std
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarRobert Habermeier <[email protected]>
      
      * More suggestions
      
      * Remove network startup GP future
      
      * Update to futures_timer
      
      * adjust wait_when_behind test
      
      * Pass correct Roles after handshake
      
      * Revert "adjust wait_when_behind test"
      
      This reverts commit 9e310244.
      
      * Crate root documentation
      
      * Remove MessageRecipient
      
      * Address concerns
      
      * Fix more concerns
      
      * Forgot Cargo.lock
      723148f1
    • Weiliang Li's avatar
      update comments in authority discovery (#4390) · 6e9be553
      Weiliang Li authored
      * update comments in authority discovery
      
      * Update lib.rs
      6e9be553
  7. Dec 12, 2019
  8. Dec 11, 2019