Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite Externalities to take &mut self everywhere #37

Open
bkchr opened this issue Aug 18, 2022 · 5 comments
Open

Rewrite Externalities to take &mut self everywhere #37

bkchr opened this issue Aug 18, 2022 · 5 comments
Labels
D1-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. I4-refactor Code needs refactoring.

Comments

@bkchr
Copy link
Member

bkchr commented Aug 18, 2022

The Externalities trait should be rewritten to take &mut self everywhere. After that we should be able to change as_trie_db_cache/as_trie_db_mut_cache to take a &mut self. Then we should be able to remove the Mutexes.

Originally posted by @arkpar in paritytech/substrate#11407 (comment)

@sudipghimire533
Copy link

If I could get bit of help and quite explanation about how & why, I would love to take this.

@bkchr
Copy link
Member Author

bkchr commented Sep 3, 2022

What kind of help do you need?

@Doordashcon
Copy link
Contributor

Hello @bkchr I believe the write operations already take &mut self herehttps://github.com/paritytech/substrate/blob/72dd574acf805fda1dc1e64b7bbd510e12a81312/primitives/externalities/src/lib.rs#L82 Could you explain further maybe?

@bkchr
Copy link
Member Author

bkchr commented Apr 8, 2023

As described in the intial post, all functions should take &mut self because we need this internally.

@the-right-joyce the-right-joyce transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added I4-refactor Code needs refactoring. D1-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. and removed I7-refactor labels Aug 25, 2023
@kianenigma
Copy link
Contributor

@liamaharon IIRC this would have helped with some of the work related making a RPC-baed externalities as well, although we decided to drop that for now.

Neopallium added a commit to PolymeshAssociation/polkadot-sdk that referenced this issue Dec 8, 2023
…aritytech#37)

First, we increase the size to 10MiB for the local cache. Second, we give the node cache a bigger
max size than the value cache, see the changed comment on why.

In general this should ensure that we are able to cache the `:code` and not directly throw it out of
the cache because it is too big (which currently happens when the size of the runtime > 2MiB). In
the future this should be improved to ensure that certain values are not removed from the cache at
all, like `:code`.

Co-authored-by: Bastian Köcher <git@kchr.de>
Signed-off-by: Robert G. Jakabosky <rjakabosky+neopallium@neoawareness.com>
lexnv pushed a commit that referenced this issue Apr 3, 2024
Make `chainHead_unstable_storage` more powerful
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* Run RustFmt as part of the CI

* Format repo

* Run RustFmt before the default Travis build step

Apparently if you override `script` you also need to make
sure to `build` and `test` the code yourself.

* Format repo
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* Run RustFmt as part of the CI

* Format repo

* Run RustFmt before the default Travis build step

Apparently if you override `script` you also need to make
sure to `build` and `test` the code yourself.

* Format repo
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* Run RustFmt as part of the CI

* Format repo

* Run RustFmt before the default Travis build step

Apparently if you override `script` you also need to make
sure to `build` and `test` the code yourself.

* Format repo
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* Run RustFmt as part of the CI

* Format repo

* Run RustFmt before the default Travis build step

Apparently if you override `script` you also need to make
sure to `build` and `test` the code yourself.

* Format repo
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* Run RustFmt as part of the CI

* Format repo

* Run RustFmt before the default Travis build step

Apparently if you override `script` you also need to make
sure to `build` and `test` the code yourself.

* Format repo
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* Run RustFmt as part of the CI

* Format repo

* Run RustFmt before the default Travis build step

Apparently if you override `script` you also need to make
sure to `build` and `test` the code yourself.

* Format repo
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* Run RustFmt as part of the CI

* Format repo

* Run RustFmt before the default Travis build step

Apparently if you override `script` you also need to make
sure to `build` and `test` the code yourself.

* Format repo
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* Run RustFmt as part of the CI

* Format repo

* Run RustFmt before the default Travis build step

Apparently if you override `script` you also need to make
sure to `build` and `test` the code yourself.

* Format repo
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
* Run RustFmt as part of the CI

* Format repo

* Run RustFmt before the default Travis build step

Apparently if you override `script` you also need to make
sure to `build` and `test` the code yourself.

* Format repo
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
* Run RustFmt as part of the CI

* Format repo

* Run RustFmt before the default Travis build step

Apparently if you override `script` you also need to make
sure to `build` and `test` the code yourself.

* Format repo
jonathanudd pushed a commit to jonathanudd/polkadot-sdk that referenced this issue Apr 10, 2024
* Run RustFmt as part of the CI

* Format repo

* Run RustFmt before the default Travis build step

Apparently if you override `script` you also need to make
sure to `build` and `test` the code yourself.

* Format repo
liuchengxu added a commit to subcoin-project/polkadot-sdk that referenced this issue Sep 20, 2024
* refactoring: introduce Params in network worker

* Initial metrics in subcoin-network

* Initial metrics in sc-consensus-nakamoto

* Spawn prometheus service in import-blocks command

* Use GaugeVec for block_execution_time

* Rename --bootnode to --seednodes in subcoin networking params

* More subcoin network metrics

* Fix test

* FMT

* Add block transactions count metric

* Add docker

* Add dashboard.json

* Add README.md

* Update grafana README.md

* .

* Update dashboard.json

* Add block size metric

* Update readme (paritytech#38)

* Update README.md

* Update README.md

* Update README.md

* .

* .

* .

* Update README.md

* Update README.md

* Update README.md

* Rate limiting on metric report of block_execution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D1-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. I4-refactor Code needs refactoring.
Projects
Status: backlog
Development

No branches or pull requests

5 participants