-
Notifications
You must be signed in to change notification settings - Fork 721
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
[BUG] - pool margin value not shown correctly in ledger-state #1063
Comments
@dcoutts The precision epsilon of the rational approximation was set to 1 in the parser. This is fixed by setting epsilon equal to 0 and thus enforcing a machine precision rational approximation. diff --git a/cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs b/cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs
index 2caff9dd..fd4302a7 100644
--- a/cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs
+++ b/cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs
@@ -1112,7 +1112,7 @@ pPoolCost =
pPoolMargin :: Parser ShelleyStakePoolMargin
pPoolMargin =
- (\dbl -> maybeOrFail . Shelley.mkUnitInterval $ approxRational (dbl :: Double) 1) <$>
+ (\dbl -> maybeOrFail . Shelley.mkUnitInterval $ approxRational (dbl :: Double) 0) <$>
Opt.option Opt.auto
( Opt.long "pool-margin"
<> Opt.metavar "DOUBLE" |
@dcoutts I have tested the fix with the pool margin set to the irrational Euler constant gamma = 0.57721 56649 01532 86060... The parsed pool margin approximates the Euler constant up to 15 digits as expected for double precision numbers. |
Closes: IntersectMBO#1063 @dcoutts The precision epsilon of the rational approximation was set to 1 in the parser. Thus for most x in [0, 1] the best rational approximation of x in the interval [x - 1, x + 1] is 0/1. This is fixed by setting epsilon equal to 0 and thus enforcing a machine precision rational approximation.
Closes: #1063 @dcoutts The precision epsilon of the rational approximation was set to 1 in the parser. Thus for most x in [0, 1] the best rational approximation of x in the interval [x - 1, x + 1] is 0/1. This is fixed by setting epsilon equal to 0 and thus enforcing a machine precision rational approximation.
Closes: #1063 @dcoutts The precision epsilon of the rational approximation was set to 1 in the parser. Thus for most x in [0, 1] the best rational approximation of x in the interval [x - 1, x + 1] is 0/1. This is fixed by setting epsilon equal to 0 and thus enforcing a machine precision rational approximation.
1110: Pool margin fix r=Jimbo4350 a=erikd Closes: #1063 Relevant issue: IntersectMBO/cardano-ledger#1508 Co-authored-by: onyxstakepool <onyxstakepool@gmail.com>
Closes: IntersectMBO/cardano-node#1063 @dcoutts The precision epsilon of the rational approximation was set to 1 in the parser. Thus for most x in [0, 1] the best rational approximation of x in the interval [x - 1, x + 1] is 0/1. This is fixed by setting epsilon equal to 0 and thus enforcing a machine precision rational approximation.
Closes: IntersectMBO/cardano-node#1063 @dcoutts The precision epsilon of the rational approximation was set to 1 in the parser. Thus for most x in [0, 1] the best rational approximation of x in the interval [x - 1, x + 1] is 0/1. This is fixed by setting epsilon equal to 0 and thus enforcing a machine precision rational approximation.
cardano-cli / cardano-node version 1.12.0 on master.
Registered a new stake pool on FnF network - specified non-zero margin (e.g. 0.75) when creating stake pool registration certificate. Followed the rest of the steps, submitted the transaction - pool record was created in ledger-state output (seen via cardano-cli shelley query ledger-state --testnet-magic 42 command).
Expected to see poolMargin field with the same value as was specified during pool creation - instead, poolMargin is listed as 0 for all stake pools.
The text was updated successfully, but these errors were encountered: