Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.

Bump parity-codec from 3.5.1 to 4.0.0#120

Closed
dependabot-preview[bot] wants to merge 1 commit intomasterfrom
dependabot/cargo/parity-codec-4.0.0
Closed

Bump parity-codec from 3.5.1 to 4.0.0#120
dependabot-preview[bot] wants to merge 1 commit intomasterfrom
dependabot/cargo/parity-codec-4.0.0

Conversation

@dependabot-preview
Copy link
Copy Markdown
Contributor

@dependabot-preview dependabot-preview bot commented Jun 3, 2019

Bumps parity-codec from 3.5.1 to 4.0.0.

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Pull request limits (per update run and/or open at any time)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

@dependabot-preview dependabot-preview bot added the dependencies Pull requests that update a dependency file label Jun 3, 2019
@tomtau
Copy link
Copy Markdown
Contributor

tomtau commented Jun 4, 2019

@devashishdxt seems this breaks on usize usage which is correct, as its size is platform-dependent.
The current uses were:

  • not necessary: e.g. nonce probably shouldn't be usize
  • something to do either with length or indexing into a vector: here, it'd need more thought. For example for transaction inputs/outputs, there's some implicit / configuration limit in Tendermint on block or transaction sizes anyway, so one can't enjoy the "full" u64::MAX/u32::MAX-size Vecs anyway (and the question is whether it could be any useful to have transactions with that many outputs/inputs). So, it could make sense to use ArrayVec instead, e.g. with a capacity u16::MAX and have all the usize places replaced with u16.

any thoughts?

@devashishdxt
Copy link
Copy Markdown
Contributor

devashishdxt commented Jun 4, 2019

So, it could make sense to use ArrayVec instead

@tomtau The only problem with ArrayVec is it allocates memory corresponding to its capacity even when there are very few elements in it. In most of our usecases, we'll have very few array elements, so, using ArrayVec is probably not a good choice. One option is change all the usages of usize to u64 and cast them to usize wherever necessary (bincode does this).

@tomtau
Copy link
Copy Markdown
Contributor

tomtau commented Jun 4, 2019

@devashishdxt

it allocates memory corresponding to its capacity even when there are very few elements in it

Depends on how much space that would waste. There's also a smallvec, so one could have a stack-allocated common case.
Anyway, there are two points in that example:

  1. For some of these structures for TX, it may be good to have static "upper bound" (that's a way lower than u64::MAX) on the number of elements -- not only for the possibility of stack-allocation, but also for reasoning about memory requirements or block size: e.g. "if I have this much RAM or this maximum blocksize, it should able to hold at least this many TX in memory or contain them in a single block"

  2. Depending on the upper bound, the length or index may not need to be held in u64.

For non-TX structures, e.g. Merkle tree length, it could be done as bincode does it.

@devashishdxt
Copy link
Copy Markdown
Contributor

For some of these structures for TX, it may be good to have static "upper bound" (that's a way lower than u64::MAX) on the number of elements -- not only for the possibility of stack-allocation, but also for reasoning about memory requirements or block size: e.g. "if I have this much RAM or this maximum blocksize, it should able to hold at least this many TX in memory or contain them in a single block"

Agree, but we don't have to use a different data structure to achieve this. SmallVec looks like a good optimisation but it won't solve usize problem.

@tomtau
Copy link
Copy Markdown
Contributor

tomtau commented Jun 4, 2019

Yeah, I guess the initial definitions could keep using Vec -- the allocation upper bound would be enforced be Decode implementation.

@dependabot-preview dependabot-preview bot force-pushed the dependabot/cargo/parity-codec-4.0.0 branch 2 times, most recently from 99ab979 to 53bcafe Compare June 5, 2019 03:15
@tomtau
Copy link
Copy Markdown
Contributor

tomtau commented Jun 5, 2019

Just a note that parity-codec was renamed paritytech/parity-scale-codec@132e647 not on crates.io yet AFAIK

@dependabot-preview dependabot-preview bot force-pushed the dependabot/cargo/parity-codec-4.0.0 branch from 53bcafe to 0708f61 Compare June 10, 2019 01:49
leejw51crypto added a commit to leejw51crypto/chain that referenced this pull request Jun 11, 2019
leejw51crypto added a commit to leejw51crypto/chain that referenced this pull request Jun 11, 2019
…-com#120

solution: converted usize fields (in datatypes that use scale-codec) to u64
leejw51crypto added a commit to leejw51crypto/chain that referenced this pull request Jun 11, 2019
…-com#120

solution: converted usize fields (in datatypes that use scale-codec) to u64
leejw51crypto added a commit to leejw51crypto/chain that referenced this pull request Jun 11, 2019
…-com#120

solution: converted usize fields (in datatypes that use scale-codec) to u64
@tomtau
Copy link
Copy Markdown
Contributor

tomtau commented Jun 11, 2019

this PR is being resolved in #133

@tomtau tomtau closed this Jun 11, 2019
@dependabot-preview
Copy link
Copy Markdown
Contributor Author

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@tomtau tomtau deleted the dependabot/cargo/parity-codec-4.0.0 branch June 11, 2019 09:06
leejw51crypto added a commit to leejw51crypto/chain that referenced this pull request Jun 12, 2019
…-com#120

Solution: converted usize fields (in datatypes that use scale-codec) to u64
leejw51crypto pushed a commit to leejw51crypto/chain that referenced this pull request Jun 12, 2019
Bumps [quickcheck](https://github.com/BurntSushi/quickcheck) from 0.8.3 to 0.8.5.
- [Release notes](https://github.com/BurntSushi/quickcheck/releases)
- [Commits](BurntSushi/quickcheck@0.8.3...0.8.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Problem: latest parity/scale-codec failed to compile (CRO-161) crypto-com#120

Solution: converted usize fields (in datatypes that use scale-codec) to u64
leejw51crypto added a commit to leejw51crypto/chain that referenced this pull request Jun 12, 2019
…-com#120

Solution: converted usize fields (in datatypes that use scale-codec) to u64
tomtau pushed a commit that referenced this pull request Jun 12, 2019
…133)

Solution: converted usize fields (in datatypes that use scale-codec) to u64
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants