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

WIP on chain heap #639

Merged
merged 8 commits into from
Sep 1, 2018
Merged

WIP on chain heap #639

merged 8 commits into from
Sep 1, 2018

Conversation

guanqun
Copy link

@guanqun guanqun commented Aug 31, 2018

try to fix #312

But I have several question regarding this:

  1. we have a CLI option to specify max heap pages, how are we going to handle this? simply remove it or make it a max cap?
  2. should we have a hard limit on the heap size? otherwise I'm a bit concerned about the allocation attack.
  3. we should use the usize::decode() interface to decode, right?

@gavofyork

@gavofyork gavofyork added the A3-in_progress Pull request is in progress. No review needed at this stage. label Aug 31, 2018
@gavofyork
Copy link
Member

  1. remove it
  2. i think it's fine for now - any "sudo" attack that can arbitrarily alter storage variables can already brick the chain by introducing an infinite loop as the runtime, so it's no worse.
  3. no - u64::decode(), then cast to usize (different runtime environments might have different usizes)

@guanqun
Copy link
Author

guanqun commented Sep 1, 2018

Thank you for the answer.
And I'm using ":heappages" instead of ":heapsize" in the hope for more clear meaning.

@gavofyork
Copy link
Member

cool

Copy link
Member

@gavofyork gavofyork left a comment

Choose a reason for hiding this comment

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

Looks good!

@gavofyork gavofyork merged commit c54321a into paritytech:master Sep 1, 2018
@gavofyork gavofyork added A8-looksgood and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Sep 1, 2018
@guanqun guanqun deleted the gq-on-chain-heap branch September 1, 2018 09:11
gguoss pushed a commit to chainx-org/substrate that referenced this pull request Sep 3, 2018
* move heap size on chain

* fix the interface change

* decode heap size

* fix code comments

* fix comment

* update Cargo.lock

* rename to heappages

* add one heap pages variable in runtime
dvdplm added a commit that referenced this pull request Sep 3, 2018
…rs-generic-over-hasher-and-rlpcodec

* origin/master: (26 commits)
  Contract runtime polishing (#601)
  WIP on chain heap (#639)
  Events to track extrinsic success (#640)
  Install llvm-tools-preview component (#643)
  fix wasm executor compile error (#631)
  random fixes (#638)
  Empty becomes (), reflecting convention (#637)
  Allow to build_upon skipped entries, but don't walk back (#635)
  Separate out staking module into balances and payment (#629)
  Update .gitlab-ci.yml (#633)
  Do not attempt to rustup if in CI. This is taken care of by the base (#621)
  Avoid need for ident strings in storage (#624)
  rename to panic_handler as panic_implementation is deprecated in nightly (#626)
  5 random fixes (#2) (#623)
  fix one typo in README (#627)
  Misspelled words (#625)
  Contracts: Per block gas limit (#506)
  Make sure to ban invalid transactions. (#615) (#620)
  Forward-port BFT fixes from v0.2 and restructure agreement cancelling (#619)
  Allow specifying listening multiaddresses (#577)
  ...
dvdplm added a commit that referenced this pull request Sep 4, 2018
* master: (22 commits)
  Introduce treasury and document (#646)
  Off-the-table staking preference (#656)
  Implement function `json_metadata` in `decl_module!` (#654)
  Fix warnings in networking (#652)
  Add a reputation system (#645)
  Check for pruned block state (#648)
  Contract runtime polishing (#601)
  WIP on chain heap (#639)
  Events to track extrinsic success (#640)
  Install llvm-tools-preview component (#643)
  fix wasm executor compile error (#631)
  random fixes (#638)
  Empty becomes (), reflecting convention (#637)
  Allow to build_upon skipped entries, but don't walk back (#635)
  Separate out staking module into balances and payment (#629)
  Update .gitlab-ci.yml (#633)
  Do not attempt to rustup if in CI. This is taken care of by the base (#621)
  Avoid need for ident strings in storage (#624)
  rename to panic_handler as panic_implementation is deprecated in nightly (#626)
  5 random fixes (#2) (#623)
  ...
lamafab pushed a commit to lamafab/substrate that referenced this pull request Jun 16, 2020
* docs: update readme for cc3

* docs: refer to the v0.7 release branch
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Heap size should be an on-chain parameter
2 participants