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

Problem: (CRO-503) No way to calculate square root of Milli#507

Merged
bors[bot] merged 1 commit intocrypto-com:masterfrom
devashishdxt:milli-sqrt
Oct 25, 2019
Merged

Problem: (CRO-503) No way to calculate square root of Milli#507
bors[bot] merged 1 commit intocrypto-com:masterfrom
devashishdxt:milli-sqrt

Conversation

@devashishdxt
Copy link
Copy Markdown
Contributor

Solution: Implemented Babylonian Method to calculate square root.

@lezzokafka
Copy link
Copy Markdown
Collaborator

Heron's method ROCKS!

@tomtau tomtau requested a review from lezzokafka October 24, 2019 07:30
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 24, 2019

Codecov Report

Merging #507 into master will increase coverage by 0.09%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #507      +/-   ##
==========================================
+ Coverage   67.22%   67.31%   +0.09%     
==========================================
  Files         120      120              
  Lines       14114    14156      +42     
==========================================
+ Hits         9488     9529      +41     
- Misses       4626     4627       +1
Impacted Files Coverage Δ
chain-core/src/state/tendermint.rs 59.74% <ø> (ø) ⬆️
chain-core/src/tx/fee/mod.rs 86.3% <100%> (+4.85%) ⬆️
client-core/src/synchronizer/auto_synchronizer.rs 53.19% <0%> (-0.71%) ⬇️
...work/src/network_ops/default_network_ops_client.rs 86.96% <0%> (-0.07%) ⬇️

@lezzokafka
Copy link
Copy Markdown
Collaborator

Reminder:
Changing TendermintVotePower struct to fit Milli

Copy link
Copy Markdown
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

looks ok, but for our peace of mind, I'd suggest to write a few quickcheck properties around the Milli arithmetic operations, e.g.:

  • for all v1, v2 except v2 == 0 => (v1 / v2) * v2 == v1
  • for all v => v.sqrt() * v.sqrt() == v (perhaps the comparison needs to have some delta / error tolerance)

@tomtau
Copy link
Copy Markdown
Contributor

tomtau commented Oct 24, 2019

bors r+

bors bot added a commit that referenced this pull request Oct 24, 2019
507: Problem: (CRO-503) No way to calculate square root of Milli r=tomtau a=devashishdxt

Solution: Implemented [Babylonian Method](https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) to calculate square root.

Co-authored-by: Devashish Dixit <[email protected]>
@bors
Copy link
Copy Markdown
Contributor

bors bot commented Oct 24, 2019

Build failed

@tomtau
Copy link
Copy Markdown
Contributor

tomtau commented Oct 25, 2019

bors retry

bors bot added a commit that referenced this pull request Oct 25, 2019
507: Problem: (CRO-503) No way to calculate square root of Milli r=tomtau a=devashishdxt

Solution: Implemented [Babylonian Method](https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) to calculate square root.

510: Bump kvdb from 0.1.0 to 0.1.1 r=tomtau a=dependabot-preview[bot]

Bumps [kvdb](https://github.com/paritytech/parity-common) from 0.1.0 to 0.1.1.
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/paritytech/parity-common/commits)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=kvdb&package-manager=cargo&previous-version=0.1.0&new-version=0.1.1)](https://dependabot.com/compatibility-score.html?dependency-name=kvdb&package-manager=cargo&previous-version=0.1.0&new-version=0.1.1)

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-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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 close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor 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](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- 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)



</details>

511: Bump kvdb-rocksdb from 0.1.5 to 0.1.6 r=tomtau a=dependabot-preview[bot]

Bumps [kvdb-rocksdb](https://github.com/paritytech/parity-common) from 0.1.5 to 0.1.6.
<details>
<summary>Commits</summary>

- [`fa938ee`](paritytech/parity-common@fa938ee) Merge pull request [#95](https://github-redirect.dependabot.com/paritytech/parity-common/issues/95) from paritytech/sp-bump-uint
- [`e388dcf`](paritytech/parity-common@e388dcf) Initialize a crate for memory related tools ([#89](https://github-redirect.dependabot.com/paritytech/parity-common/issues/89))
- [`756c608`](paritytech/parity-common@756c608) Bump primitive-types and uint version
- [`5b56003`](paritytech/parity-common@5b56003) Merge pull request [#92](https://github-redirect.dependabot.com/paritytech/parity-common/issues/92) from paritytech/td-u128
- [`39c6ee0`](paritytech/parity-common@39c6ee0) Fix for the review.
- [`9eba22f`](paritytech/parity-common@9eba22f) More compact.
- [`982228f`](paritytech/parity-common@982228f) Add some tests.
- [`e114cfb`](paritytech/parity-common@e114cfb) Expose U128, add u128 conversions.
- [`6e04748`](paritytech/parity-common@6e04748) Merge pull request [#86](https://github-redirect.dependabot.com/paritytech/parity-common/issues/86) from paritytech/sp-primitive-types-init
- [`d632b4c`](paritytech/parity-common@d632b4c) Bump primitive-types patch version
- Additional commits viewable in [compare view](paritytech/parity-common@kvdb-rocksdb-v0.1.5...primitive-types-v0.1.6)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=kvdb-rocksdb&package-manager=cargo&previous-version=0.1.5&new-version=0.1.6)](https://dependabot.com/compatibility-score.html?dependency-name=kvdb-rocksdb&package-manager=cargo&previous-version=0.1.5&new-version=0.1.6)

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-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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 close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor 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](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- 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)



</details>

512: Bump sgx_tstd from `3a43c5f` to `c8a5908` r=tomtau a=dependabot-preview[bot]

Bumps [sgx_tstd](https://github.com/baidu/rust-sgx-sdk) from `3a43c5f` to `c8a5908`.
<details>
<summary>Commits</summary>

- [`c8a5908`](apache/teaclave-sgx-sdk@c8a5908) Update Readme and add third party wiki link
- [`47c5815`](apache/teaclave-sgx-sdk@47c5815) Provides some info on third_party crates
- [`65f8a49`](apache/teaclave-sgx-sdk@65f8a49) Add Fedora 27 docker support
- See full diff in [compare view](apache/teaclave-sgx-sdk@3a43c5f...c8a5908)
</details>
<br />

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-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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 close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor 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](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- 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)



</details>

Co-authored-by: Devashish Dixit <[email protected]>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
@leejw51crypto
Copy link
Copy Markdown
Collaborator

i'm reviewing

Copy link
Copy Markdown
Collaborator

@leejw51crypto leejw51crypto left a comment

Choose a reason for hiding this comment

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

good job

@bors
Copy link
Copy Markdown
Contributor

bors bot commented Oct 25, 2019

@bors bors bot merged commit 9c721e9 into crypto-com:master Oct 25, 2019
@devashishdxt devashishdxt deleted the milli-sqrt branch October 25, 2019 03:14
bors bot added a commit that referenced this pull request May 1, 2020
1519: Bump cbindgen from 0.14.1 to 0.14.2 r=tomtau a=dependabot-preview[bot]

Bumps [cbindgen](https://github.com/eqrion/cbindgen) from 0.14.1 to 0.14.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/eqrion/cbindgen/blob/master/CHANGES">cbindgen's changelog</a>.</em></p>
<blockquote>
<h2>0.14.2</h2>
<pre><code> * Fixed minimal dependency versions. ([#507](mozilla/cbindgen#507))
 * Add an option to write pragma once. ([#511](mozilla/cbindgen#511))
 * Fix submodule scanning for implicit Rust 2018 modules. ([#512](mozilla/cbindgen#512))
 * Fix dependency parsing / scanning to handle target-specific versions. ([#513](mozilla/cbindgen#513))
 * Use heck for case conversion. ([#514](mozilla/cbindgen#514))
 * Add support for verbatim content after includes. ([#416](mozilla/cbindgen#416))
 * Allow to add attributes to most generated functions. ([#515](mozilla/cbindgen#515))
</code></pre>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/eqrion/cbindgen/commit/b6b88f8c3024288287368b377e4d928ddcd2b9e2"><code>b6b88f8</code></a> Release v0.14.2</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/a05a223704e206679068cf84da09a7b49ea202a4"><code>a05a223</code></a> tests: Add tests for attribute annotations.</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/5ee5b3ee8884b256decf6e4d91563799a986d758"><code>5ee5b3e</code></a> ir: Allow per-method annotations for all the auto-generated struct and enum m...</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/be8e6ec876972b28519803e041ae12b4c63948fc"><code>be8e6ec</code></a> enum: Allow to store annotations for empty variants.</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/1a824c04f21f22d1488609cedf8d0c7b13bb83eb"><code>1a824c0</code></a> Add support for verbatim content after includes</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/d0d67165561c6249d39148bc1b63d62d713fdd1a"><code>d0d6716</code></a> ir: Minor cleanup to the cfg code.</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/8139fbf3c7db6e0635161ecc5631d865ac4e3d4e"><code>8139fbf</code></a> Fix <a href="https://github-redirect.dependabot.com/eqrion/cbindgen/issues/418">#418</a>: Use heck for case conversion</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/4beb526516fa6e1de38cebc3f02b1d095f8947d1"><code>4beb526</code></a> Fix <a href="https://github-redirect.dependabot.com/eqrion/cbindgen/issues/254">#254</a> (<a href="https://github-redirect.dependabot.com/eqrion/cbindgen/issues/512">#512</a>)</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/ca1c0b27b66edc372d7c190e8d22e41125a985a4"><code>ca1c0b2</code></a> Run cargo-fmt</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/1df5129d1a227d5f1dbf66b6d8fe66eba44ae880"><code>1df5129</code></a> Fix 2015 edition module path resolution</li>
<li>Additional commits viewable in <a href="https://github.com/eqrion/cbindgen/compare/v0.14.1...v0.14.2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=cbindgen&package-manager=cargo&previous-version=0.14.1&new-version=0.14.2)](https://dependabot.com/compatibility-score/?dependency-name=cbindgen&package-manager=cargo&previous-version=0.14.1&new-version=0.14.2)

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-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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 close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor 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](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- 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)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
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.

4 participants