Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Support account_nextIndex RPC. #460

Merged
merged 10 commits into from Oct 23, 2019
Merged

Support account_nextIndex RPC. #460

merged 10 commits into from Oct 23, 2019

Conversation

tomusdrw
Copy link
Contributor

@tomusdrw tomusdrw commented Oct 4, 2019

Exposes account_nextIndex RPC for polkadot.

I'm not super happy with this PR, since we use node-* packages (especially node-primitives), but I'm not quite sure yet how to deal with it.

  1. One idea would be to move AccountsNonceApi (RuntimeApi) to srml::system (but then we have strict dependencies on particular srmls`.
  2. Second I had was to actually automate registering this kind of RuntimeApi-based RPCs so that we don't have to write this glue code.
  3. I'm a bit hesitant on putting the runtime API and the RPC implementation to core as it's very specific for a particular srml set. Is there a place that's kind of between core and srml (i.e. depends on both, but is not node)? Should we introduce one?

Update

Updated the PR to support latest master now. Still keeping onice label until the refactoring is merged to polkadot-master branch.

@tomusdrw tomusdrw requested a review from jacogr October 4, 2019 10:24
Copy link
Contributor

@jacogr jacogr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot really review, but the intent with having this available really would make submissions smoother on Kusama.

@gavofyork
Copy link
Member

gavofyork commented Oct 4, 2019

Ok - I think it's fine to have this additional off-chain logic that specifically relates to an SRML module in the srml path, probably in its own crate in a sub path of srml/system.

Polkadot shouldn't really be bringing in any node/ crates (they're really just for bespoke logic relevant to Substrate Node), and Long Term (TM) I would even plan on splitting up core, srml and node into separate repos.

Similarly any logic strictly relevant to an SRML module should not be in core either.

@rphmeier
Copy link
Contributor

rphmeier commented Oct 8, 2019

Right - it's also important to keep the separations clear so that we could have separate licenses for core, srml, node, polkadot, etc.

@tomusdrw
Copy link
Contributor Author

tomusdrw commented Oct 8, 2019

I'm working on a PR to substrate currently to move this stuff to the right places, put this one on hold until it's merged there.

@tomusdrw tomusdrw changed the title Use node-rpc extensions to support account_nextIndex. Support account_nextIndex RPC. Oct 17, 2019
@tomusdrw tomusdrw removed the A1-onice label Oct 21, 2019
rpc/Cargo.toml Show resolved Hide resolved
service/src/lib.rs Outdated Show resolved Hide resolved
service/src/lib.rs Outdated Show resolved Hide resolved
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
@tomusdrw tomusdrw added A0-please_review Pull request needs code review. and removed A5-grumble labels Oct 21, 2019
@gavofyork gavofyork merged commit aa63bc6 into master Oct 23, 2019
@gavofyork gavofyork deleted the td-accounts-rpc branch October 23, 2019 11:17
andresilva pushed a commit that referenced this pull request Oct 23, 2019
* Use node-rpc extensions to support account_nextIndex.

* Remove todo.

* Update lock.

* Use new srml_system_rpc crate.

* Update to substrate=master

* Update lockfile.

* Update to polkadot-master.

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
gavofyork pushed a commit that referenced this pull request Oct 23, 2019
* Fix compilation in wasm (#465)

Also fix the weird file structure by making `wasm_executor.rs` ->
`wasm_executor/mod.rs`.

* Changes for substrate#3699 (#466)

* change upstream and branch

* Fix build

* remove doc renamings

* Fix tests

* .

* Revert changing fork and branch

* Update Cargo.toml

* Update parachains.rs

* wasm_executor: fix wasm signature checker (#471)

Signed-off-by: yjhmelody <465402634@qq.com>

* Update to latest Substrate master (#472)

* Update to latest Substrate master

* Fix

* Fix compilation

* fix var name for post_upward_message (#474)

Signed-off-by: yjhmelody <465402634@qq.com>

* integrate minor weight/fee changes (#482)

* Update cargo files

* Make it build again.

* Fix build

* revert cargo file

* New lockfile

* Bump.

* Update to latest Substrate master (#486)

* Only register one gossip validator for full nodes (#487)

* Support `account_nextIndex` RPC. (#460)

* Use node-rpc extensions to support account_nextIndex.

* Remove todo.

* Update lock.

* Use new srml_system_rpc crate.

* Update to substrate=master

* Update lockfile.

* Update to polkadot-master.

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update to latest substrate master (#491)

* update to latest substrate master

* Fix compilation
gavofyork added a commit that referenced this pull request Oct 25, 2019
* add authority discovery module (#444)

* grandpa: set justification period to 512 blocks (#445)

* lock (#446)

* Kusama CC2 spec (#449)

* update readme for cc2 (#453)

* docs: add security policy (#450)

* docs: add security policy

* Update SECURITY.md

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Enable `substrate-session` `std` feature and remove unused traits (#456)

* update (#457)

* Update latest substrate master (#462)

* update substrate to latest polkadot-master

* fix test runtime

* Fix compilation in wasm (#465)

Also fix the weird file structure by making `wasm_executor.rs` ->
`wasm_executor/mod.rs`.

* Make `ParachainContext` take self as mutable (#458)

This replicates changes to `Environment`/`Proposer` that are used
internally at Cumulus.

* wasm_executor: fix wasm signature checker (#471)

Signed-off-by: yjhmelody <465402634@qq.com>

* Changes for substrate#3699 (#466)

* change upstream and branch

* Fix build

* remove doc renamings

* Fix tests

* .

* Revert changing fork and branch

* Update Cargo.toml

* Update parachains.rs

* update branch name in Cargo.lock (#473)

* Introduce Parathreads (runtime) (#341)

* Rest of parathread draft implementation, parachain permissioning.

* Update Substrate

* Update Substrate again

* Integrate weight/fee stuff.

* Council

* Build fixes

* More fixes

* Minor additions

* fix some small errors

* Revert "fix some small errors"

This reverts commit 4fb52c8.

* Merge fix.

* do_swap -> on_swap

* Update depdendency to polkadot-master

* Fix more merge problems

* Some patching of errors

* Fix storage closure

* Actually fix storage. It builds!

* Tests run... but not successfully.

* Add `run_to_block` to get parachains active to start

* More `run_to_block`

* Fix build

* Queue up changes to threads

* Move registration test

* Fix regsiter/deregister test

* Retry queue.

* Minor refactor

* Refactor to avoid heavy storage items

* Make tests pass

* remove para on deregister, add events

* Remove println

* Fix register/deregister parathread test

* fix merge

* Parathread can be activated test

* Test auction

* Add `Debtors` storage item

I considered putting the debtor information in `ParaInfo`, but it did not make sense to me since this information only applies to parathreads, not `paras` in general.

* remove comment code

* Some new tests

* Fixes for removing threads when scheduled. Tests.

* Test progression of threads.

* Test that reschedule queuing works properly.

* Make test slightly more interesting

* whitespace

* Swap works properly.

* Update locks

* Build

* Rename can_swap

* Add test for funds to be correctly returned after a swap

Swap does not seem to have logic which correctly swaps the debtor account to the new parathread.

* Make tests consistant

* Add check that `PendingSwap` is cleaned up

* Update runtime/src/parachains.rs

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>

* Update runtime/src/registrar.rs

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>

* Some fixes/suggestions from review

* Docs

* Apply suggestions from code review

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update network/src/gossip.rs

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>

* Rename OnSwap

* Add missing `]`

* Rejig ordering semantics, making everything a bit slower but correct.

* Some Fixes to Parathread Compile (#470)

* Some Fixes

* Fix queue_upward_messages

* Change back to const

* Build fixes

* Fix tests

* Update to latest Substrate master (#472)

* Update to latest Substrate master

* Fix

* Fix compilation

* fix var name for post_upward_message (#474)

Signed-off-by: yjhmelody <465402634@qq.com>

* change versioning and tagging of releases (#476)

* change versioning and tagging of releases

* Make `ParaId` constructible from a const context (#483)

* Pass `client` and `task_executor` to `BuildParachainContext` (#484)

* Pass `client` and `task_executor` to `BuildParachainContext`

* Update `Cargo.lock`

* integrate minor weight/fee changes (#482)

* Update cargo files

* Make it build again.

* Fix build

* revert cargo file

* New lockfile

* Bump.

* Update to latest Substrate master (#486)

* Fixes required for Cumulus (#485)

* Collator node need to register all gossip validators as well

* Make sure that parachain authorities are only written once at genesis

* Fix test

* fix dockerfile build - upgrade image base from ubuntu 16 to 18 (#423)

* Only register one gossip validator for full nodes (#487)

* ci: fix publishing of ci builds (#488)

* Support `account_nextIndex` RPC. (#460)

* Use node-rpc extensions to support account_nextIndex.

* Remove todo.

* Update lock.

* Use new srml_system_rpc crate.

* Update to substrate=master

* Update lockfile.

* Update to polkadot-master.

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update to latest substrate master (#491)

* update to latest substrate master

* Fix compilation

* Switch elections to Phragmen, enable them in PoA (#492)

* Switch elections to Phragmen, enable them in PoA

* Remove superfluous code.

* Build fixes

* Update to substrate master

* Build fixes

* Add warning

* Disable authority discovery for now

* Remove commented code

* Fix warning

* service: cleanup task spawning (#495)

* Update to latest substrate polkadot-master (#496)

* update to latest substrate polkadot-master

* Bump to 0.6.3

* service: don't use the grandpa observer (#494) (#498)

* service: don't use the grandpa observer

* service: remove unnecessary boxing

* service: fix indentation

* service: remove unnecessary on_exit

tasks spawned with `spawn_task`/`spawn_essential_task` are already
guarded by `on_exit`.

* Update service/src/lib.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>
tomusdrw pushed a commit that referenced this pull request Mar 26, 2021
* substrate-relay::SubmitMillauToRialtoMessage

* typo

* Update relays/substrate/src/cli.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
imstar15 pushed a commit to imstar15/polkadot that referenced this pull request Aug 25, 2021
* set default para id to 1000

* add genesis value generation script

* add statemine chain spec and genesis values

* add westmint chain spec and genesis values

* rename chain specs to _genesis to indicate that they are not usable for syncing the chain

* adjust chain names to reduce confusion

* add westmint chain spec

* set chain id to shell

* comment out statemine chain spec

* fix build

Co-authored-by: joepetrowski <joe@parity.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants