-
Notifications
You must be signed in to change notification settings - Fork 217
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
More measures post restoration benchmarks + SeqAnyState #2084
More measures post restoration benchmarks + SeqAnyState #2084
Conversation
-- recognize as ours. It is expressed in tenth of percents, so "1" means 0.1%, | ||
-- "10" means 1% and 1000 means 100%. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- recognize as ours. It is expressed in tenth of percents, so "1" means 0.1%, | |
-- "10" means 1% and 1000 means 100%. | |
-- recognize as ours. It is expressed in tenths of a percent, so "1" means 0.1%, | |
-- "10" means 1%, and 1000 means 100%. |
There is also per mille, but it is rarely used in English, so I wouldn't recommend it. 😸
-- recognize as ours. It is expressed in tenth of percents, so "1" means 0.1%, | ||
-- "10" means 1% and 1000 means 100%. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- recognize as ours. It is expressed in tenth of percents, so "1" means 0.1%, | |
-- "10" means 1% and 1000 means 100%. | |
-- recognize as ours. It is expressed in tenths of a percent, so "1" means 0.1%, | |
-- "10" means 1%, and 1000 means 100%. |
| otherwise = | ||
(False, st) | ||
where | ||
p = floor (double (maxBound :: Word32) * double (natVal (Proxy @p)) / 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this is a bit easier to read:
p = floor (double (maxBound :: Word32) * double (natVal (Proxy @p)) / 1000) | |
p = floor | |
$ double (maxBound :: Word32) | |
* double (natVal (Proxy @p)) | |
/ 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree :), although I admit this could be more readable. What about:
p = floor (double sup * double (natVal (Proxy @p)) / 1000)
where
sup = maxBound :: Word32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about:
p = floor (double sup * double (natVal (Proxy @p)) / 1000) where sup = maxBound :: Word32
I think this is an improvement. I'm guessing sup
is short for "superior" ("borne supérieure")?
Perhaps we could also give natVal (Proxy @p)
a name, and then we'd have:
p = floor ((double sup * double den) / 1000)
where
sup = maxBound :: Word32
den = natVal (Proxy @p)
Or:
p = floor ((double n * double d) / 1000)
where
n = maxBound :: Word32
d = natVal (Proxy @p)
(where n
and d
are numerator and denominator, respectively).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, although I think the line is already very readable :)
-- it discover addresses based on an arbitrary ratio instead of respecting the | ||
-- BIP-44 discovery. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- it discover addresses based on an arbitrary ratio instead of respecting the | |
-- BIP-44 discovery. | |
-- it discovers addresses based on an arbitrary ratio instead of respecting | |
-- BIP-44 discovery. |
7306a33
to
8622066
Compare
@jonathanknowles comments' typos fixed and made the definition of |
-- we ought to simply recognize as ours. So, giving @5 means that 5% of the | ||
-- entire address space of the network will be considered ours, picked randomly. | ||
-- The type parameter is expected to be a ratio of addresses we ought to simply | ||
-- recognize as ours. It is expressed in tenths of percent, so "1" means 0.1%, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- recognize as ours. It is expressed in tenths of percent, so "1" means 0.1%, | |
-- recognize as ours. It is expressed in tenths of a percent, so "1" means 0.1%, |
-- seed. | ||
-- | ||
-- The type parameter is expected to be a ratio of addresses we ought to simply | ||
-- recognize as ours. It is expressed in tenths of percent, so "1" means 0.1%, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- recognize as ours. It is expressed in tenths of percent, so "1" means 0.1%, | |
-- recognize as ours. It is expressed in tenths of a percent, so "1" means 0.1%, |
| otherwise = | ||
(False, st) | ||
where | ||
p = floor (double (maxBound :: Word32) * double (natVal (Proxy @p)) / 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about:
p = floor (double sup * double (natVal (Proxy @p)) / 1000) where sup = maxBound :: Word32
I think this is an improvement. I'm guessing sup
is short for "superior" ("borne supérieure")?
Perhaps we could also give natVal (Proxy @p)
a name, and then we'd have:
p = floor ((double sup * double den) / 1000)
where
sup = maxBound :: Word32
den = natVal (Proxy @p)
Or:
p = floor ((double n * double d) / 1000)
where
n = maxBound :: Word32
d = natVal (Proxy @p)
(where n
and d
are numerator and denominator, respectively).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathanknowles comments' typos fixed and made the definition of p more readable!
Thanks for fixing these! I added a couple more suggestions (as I think there is still an "a" missing from a couple of these comments).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This wallet is very analogous to the existing any% wallet scheme we designed a while ago, with a subtle difference: it is built __on top of__ the 'RndState' and, as a result, does perform the same database operation and addresses management as the standard random wallets. So the benchmark results obtained from this are much closer to what an actual random wallet of the same size would look like.
In particular, we check for the time needed to list addresses on a wallet, as well as the time needed to perform a fee estimation. This gives an order of magnitude of how long these functions take on large wallets.
This make sure that benchmarks reflects a real-setup with a bit more fidelity by also storing and retrieving the address space.
be93880
to
309874f
Compare
bors r+ |
Canceled |
bors r+ |
Build succeeded |
Issue Number
#2032
Overview
Comments
On the testnet (although I messed up and the rnd % benchmark are actually doing 1%, 2% and 4% restorations!)