André Silva
0ddd5cc278
babe: treat epoch_authorship RPC method as unsafe ( #6069 )
...
* service: pass DenyUnsafe to rpc extensions
* node: add DenyUnsafe to rpc full node dependencies
* client: fix whitespace in rpc policy file
* babe: treat epochAuthorship rpc method as unsafe
* babe: add test for unsafe rpc method
* babe: rename babe rpc handler
* service: traitify rpc extension builder
* service: make the rpc extensions builder api non-breaking
* service: revert changes from light node rpc extensions builder
* node: remove unnecessary type in service creation
* service: cleanup with_rpc_extensions implementation
* service: add missing docs to RpcExtensionBuilder
2020-05-21 13:58:04 +02:00
Pierre Krieger
717fa95bc7
Restore the empty line after the license ( #6088 )
2020-05-20 13:08:27 +00:00
Nikolay Volf
d5411969ac
fix whitespace ( #6062 )
2020-05-18 13:51:28 +02:00
Benjamin Kampmann
be8c96adec
Relax substrate licensing scheme ( #5947 )
2020-05-15 13:21:56 +02:00
Yuanchao Sun
52d0173ec3
Add RPC function state_getProof, resolves #1110 ( #5649 )
...
* Add RPC function state_getProof, resolves #1110
* Apply suggestions from code review
* Update client/rpc/src/state/state_full.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
* Update Cargo.lock
* Make block hash optional
* Wrap StorageProof as Bytes
* Add struct ReadProof
* Fix typo
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2020-04-20 21:09:55 +02:00
cheme
4ffcf98d8d
Child trie api changes BREAKING ( #4857 )
...
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com >
2020-04-20 15:21:22 +02:00
Igor Matuszewski
4b1f7d187f
Allow to expose a subset of unsafe RPCs ( #5233 )
...
* sc-cli: Use type-safe constructors for RPC/Prometheus interfaces
* service: Simplify rpc handler creation
Could probably be further simplifies once [this][commit] lands.
[commit]: https://github.com/paritytech/jsonrpc/commit/20485387ed06a48f1a70bf4d609a7cde6cf0accf
* service: Streamline some HTTP & WS server start logic
* client: Introduce a simple RPC policy mechanism
* rpc/system: Check unsafe RPCs
* rpc/offchain: Check unsafe RPCs
* rpc/author: Check unsafe RPCs
2020-04-20 11:03:58 +02:00
Pierre Krieger
95ee37d242
Add alternative RPC methods to system_networkState ( #5643 )
...
* Add alternatives to system_networkState
* Fix tests
* Apply suggestions from code review
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com >
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com >
2020-04-16 16:36:14 +01:00
Bastian Köcher
7cdfaff12b
Add new RPC method to get the chain type ( #5576 )
...
* Add new RPC method to get the chain type
This adds a new RPC method to get the chain type of the running chain.
The chain type needs to be specified in the chain spec. This should make
it easier for tools/UI to display extra information without needing to
rely on parsing the chain name.
* Update client/rpc-api/src/system/mod.rs
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com >
* Primitive crate
* Feedback
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com >
2020-04-08 20:41:51 +02:00
Pierre Krieger
8c03a4fcef
Split the Roles in three types ( #5520 )
...
* Split the Roles bitfield in three
* Forgot to include some changes
* Fix cli test
* More test fixes
* Oh God, merging master broke other tests
* Didn't run the doctests
* Address review
* I'm trying to fix the build blindly because it's taking a good hour to compile on my machine
* Address some review
* Also update the peerset's API to make sense
* Fix peerset tests
* Fix browser node
* client: distinguish between local and network authority
Co-authored-by: André Silva <andre.beat@gmail.com >
2020-04-03 19:08:14 +02:00
Seun Lanlege
ab0f7d213a
Adds state_queryStorageAt ( #5362 )
...
* adds state_queryStorageAt
* make at param for query_storage_at optional
* Update client/rpc/src/state/state_full.rs
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com >
* adds query_storage_at to StateBackend
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com >
2020-03-26 16:03:34 +01:00
Jakub Pánik
e366b5bd2c
Added subscribe_all_heads RPC function ( #4979 )
...
* Added subscribe_all_heads RPC function
* Update client/rpc/src/chain/tests.rs
Fixed style ( spacing )
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com >
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com >
2020-03-04 14:19:38 +01:00
Shawn Tabrizi
c7a14db792
Fix various spelling errors ( #4940 )
...
* meaningfull -> meaningful
* initialise -> initialize
* tokans -> tokens
* incentivise -> incentivize
* lenght -> length
* incentivisation -> incentivization
* doesnt't -> doesn't
* overwriten -> overwritten
* lifecycle -> life cycle
* lifecycle -> life cycle
* usefull -> useful
* noone -> no one
* spaming -> spamming
* defered -> deferred
* hieght -> height
* sumation -> summation
* ingore -> ignore
* registed -> registered
* Auxialary -> Auxiliary
* loggin -> logging
* independance -> independence
* trailling -> trailing
* responsability -> responsibility
* trunkated -> truncated
* Weither -> Whether
* informations -> information
* Runtume -> Runtime
* choosen -> chosen
* delcataion -> declaration
* Unchekced -> Unchecked
* defintion -> definition
* scrach -> scratch
* imput -> input
* transfered -> transferred
* endownment -> endowment
* Determinator -> Determiner
* relevent -> relevant
* emited -> emitted
* acocunt -> account
* proprotional -> proportional
* instantiaion -> instantiation
* commited -> committed
* tombstonedead -> tombstone
* uwnrap -> unwrap
* acount -> account
* specialised -> specialized
* existant -> existent
* requried -> required
* Anull -> Annul
* AUTHORITES -> AUTHORITIES
* underyling -> underlying
* recognisable -> recognizable
* Capitalise -> Capitalize
* reportfor -> report for
* hearbeat -> heartbeat
* onlineness -> being online
* creater -> creator
* Bytearray -> Byte array
* Despoit -> Deposit
* substratced -> subtracted
* Curent -> Current
* imbalanes -> imbalances
* countfown -> countdown
* inexisting -> inexistent
* additionaly -> additionally
* substracted -> subtracted
* auxilary -> auxiliary
* parital -> partial
* in't -> isn't
* compatability -> compatibility
* infomation -> information
* etected -> detected
* extrinsiscs -> extrinsics
* reprensentation -> representation
* coonfiguration -> configuration
* primtives -> primitives
* miscelanious -> miscellaneous
* VERISON -> VERSION
* endcoded -> encoded
* Genrates -> Generates
* miliseconds -> milliseconds
* occured -> occurred
* trully -> truely
* truely -> truly
* conjuction -> conjunction
* encouters -> encounters
* customised -> customized
* deterministicly -> deterministically
* finalisation -> finalization
* pluggable -> plugable
* wakeup -> wake-up
* interemdiate -> intermediate
* intepreting -> interpreting
* finalzied -> finalized
* throgh -> through
* extinsic -> extrinsic
* convient -> convenient
* allocater -> allocator
* propagateable -> propagatable
* succesfuly -> successfully
* finalising -> finalizing
* publically -> publicly
* phrasee -> phrase
* substration -> substractions
* substractions -> subtractions
* neccessarily -> necessarily
* Inlucde -> Include
* unefficient -> inefficient
* thay -> they
* funtion -> function
* datastructures -> data structures
* infromation -> information
* propagatable -> propagable
* ecountered -> encountered
* recognise -> recognize
* intergration -> integration
* lastet -> latest
* datatypes -> data types
* datatype -> data type
* Strongarming -> Strong Arming
* avaible -> available
* Commiting -> Committing
* Retreiving -> Retrieving
* shoud -> should
* canonicaliziation -> canonicalization
* comitted -> committed
* clonable -> cloneable
* Uknown -> Unknown
* reponse -> response
* arbitary -> arbitrary
* Capapbilities -> Capabilities
* responsbile -> responsible
* initialisation -> initialization
* cames -> came
* intemediate -> intermediate
* reqeust -> request
* intance -> instance
* explcitly -> explicitly
* neighor -> neighbor
* reolving -> resolving
* untill -> until
* Validte -> Validate
* deserailize -> deserialize
* literaly -> literally
* preceeding -> preceding
* abpve -> above
* chcecked -> checked
* numbet -> number
* Unknow -> Unknown
* halfs -> halves
* gossup -> gossip
* givent -> given
* immediatelly -> immediately
* slicable -> sliceable
* conensus -> consensus
* Mimicks -> Mimics
* acccept -> accept
* serialise -> serialize
* exstrinsics -> extrinsics
* panicks -> panics
* maintaince -> maintenance
* repeatidely -> repeatedly
* anecstor -> ancestor
* becasue -> because
* processer -> processor
* Prunning -> Pruning
* insterested -> interested
* unuseful -> not useful
* yeided -> yielded
* descendfing -> descending
* corresponts -> corresponds
* survivew -> survive
* keps -> keeps
* ligh -> light
* prerequisities -> prerequisites
* positiion -> position
* depedency -> dependency
* extrinisic -> extrinsic
* atomicaly -> atomically
* staticly -> statically
* resul -> result
* timestamb -> timestamp
* Utilites -> Utilities
* ammount -> amount
* pocess -> process
* exteral -> external
* Update client/finality-grandpa/src/tests.rs
* Update primitives/io/src/lib.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update primitives/blockchain/src/lib.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update frame/support/src/weights.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update bin/node/cli/tests/common.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/api/src/execution_extensions.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/cli/src/params.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/executor/common/src/sandbox.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/api/src/execution_extensions.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/finality-grandpa/src/communication/mod.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/state-db/src/pruning.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update frame/contracts/src/tests.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Update client/api/src/execution_extensions.rs
* bump impl
* timestamb -> timestamp
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
2020-02-17 15:07:24 +01:00
Gavin Wood
9202cd87e0
Additional RPC for dumping all main storage key pairs under a prefix ( #4803 )
...
* Merge branch 'gav-split-balanecs-vesting' into gav-upsub
# Conflicts:
# Cargo.lock
# cli/Cargo.toml
# collator/Cargo.toml
# primitives/Cargo.toml
# runtime/common/Cargo.toml
# runtime/common/src/claims.rs
# runtime/kusama/Cargo.toml
# runtime/polkadot/Cargo.toml
# service/Cargo.toml
* Update client/src/client.rs
* Update client/src/client.rs
* Fix merge conflict
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2020-02-05 17:27:50 +01:00
Xiliang Chen
febb6e29b2
add state_getKeysPaged ( #4718 )
...
* add storage_getNextKey
* RPC storage_getKeysPages
* respect count
* use iterator
* improve
* add tests
* improve
* add doc comments
* Make prefix optional
* update error
* improve
2020-02-04 10:44:40 +01:00
Edwin
9a6d9f0db5
RPC api for offchain storage ( #4694 )
...
* Rpc api for offchain storage
* Replace Vec<u8> to Bytes, replace Mutex to RwLock
* Remove pub
* Modify copyright year
2020-01-28 23:31:28 +01:00
Bastian Köcher
fc99887de0
Introduces author_hasKey and author_hasSessionKeys rpc endpoints ( #4720 )
...
* Introduces `author_hasKey` and `author_hasSessionKeys` rpc endpoints
Both endpoints can be used to check if a key is present in the keystore.
- `hasKey` works on with an individual public key and key type. It
checks if a private key for the given combination exists in the
keystore.
- `hasSessionKeys` works with the full encoded session key blob stored
on-chain in `nextKeys`. This requires that the given blob can be decoded
by the runtime. It will return `true`, iff all public keys of the
session key exist in the storage.
Fixes: https://github.com/paritytech/substrate/issues/4696
* Update client/rpc-api/src/author/error.rs
Co-Authored-By: Nikolay Volf <nikvolf@gmail.com >
* Indentation
Co-authored-by: Nikolay Volf <nikvolf@gmail.com >
2020-01-24 15:20:45 +01:00
Shawn Tabrizi
7efa62725e
Update copyright year ( #4532 )
2020-01-05 14:05:44 +01:00
Tomasz Drwięga
216f77d91f
Document TransactionStatus and fix termination conditions. ( #4446 )
...
* Document TransactionStatus and fix termination conditions.
* Update client/rpc-api/src/author/mod.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com >
2019-12-18 21:28:25 +01:00
Robert Habermeier
da87c3c1e3
RPCs for reserved peers ( #4423 )
...
* RPC forwarders for adding reserved peers
* implement service side of reserved-peer RPCs
* Clean up unnecessary format! invocation
Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com >
* add some tests for the new RPC methods
* remove redundant `data` field
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com >
2019-12-18 14:12:15 +01:00
Tomasz Drwięga
8778ca7dc8
[big refactor] Remove crate aliasing. ( #4395 )
...
* 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.
2019-12-16 20:36:49 +08:00
cheme
0ece5d9e17
Fix key collision for child trie ( #4162 )
...
* 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.
2019-12-14 11:11:19 +09:00
Benjamin Kampmann
c5a709a882
Fix folder names in client and test ( #4360 )
...
* client/rpc/api -> client/rpc-api
* client/util/wasm-builder-runner -> utils/wasm-builder-runner
* client/grafana-data-source -> utils/grafana-data-source
* test/utils -> test-utils
* fix moved path
* Update Cargo.lock
* Update Cargo.lock
2019-12-11 16:41:38 +01:00