-
Notifications
You must be signed in to change notification settings - Fork 157
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
Pledge amount greater than maxLovelace #1551
Comments
There is a relevant point about bounded values for |
This is not a bug. Stake pool operators are free to make a pledge as large as they want, even ridiculous ones that they cannot possibly meet. Even just pledging 51% of the total supply is absurd, as you are making a promise to have enough stake to control the entire system. The ledger does not attempt to make a value judgement on what is and is not reasonable, instead it gives out no rewards to a pool that does not meet the pledge in a given epoch. |
Ok, not a bug, but definitely a significant WTF moment. In |
That's great! as a part of #1475 we will introduce bounded values for |
The actual monetary policy max lovelace value is part of the ledger. It would be nice if the value was validated against that. |
Allowing arbitrary values for the pedge amnount is a SERIOUS pain in the neck for Not fixing this in the LEDGER kicks the can along the road making the life of everyone who uses these values more difficult. |
We will have to handle Word64. Word64 occurs in many types, for example in metadata. Large values will also occur as a result of aggregation queries (e.g. total amounts traded over some period of time). |
While use of supporting handling of Word64 sounds valid, I think the core requirement is to have |
I understand that unbounded values are problematic, but I do not see any validation issue with a pledge larger than the max lovelace. the pledge is completely agnostic to the monetary policy. Why is a bound of |
validation of values that come out of cardano-node seems like a straightforward thing to implement. pooltool just got caught by a completely out of bounds value as well (1.1e19 cost on a pool). I agree with Erik, these types of unconstrained numbers (especially when they are straightforward to constrain at least at the IO level) will only lead to problems down the line. |
Checking that a pledge is less then 4.5e10 ada is not validation. The only thing that matters is if the pool can meet their pledge, and there is no fixed level for that. Of course they cannot meet a pledge of 4.5e10 ada, but they also cannot meet pledges of much lower than that. But there is no fixed level for that. Fundamentally, if pools want to shoot themselves in the foot they have many ways to do that, and we cannot stop them all, especially the ones with such grey areas like "is this a 'reasonable' cost or pledge".
Like what? There is no need to implement anything. There's no fixed level you can pick in downstream components either. Just allow the full word64 range.
What does that mean? It's completely legitimate for a pool to declare such a cost. They will not be competitive, but that's not a problem for the system. |
The current situation may be correctly considered "not a bug", but for the user it constitutes unexpected and surprising behavior. |
Database filler stopped with this error. I just dropped the constraint db-sync logs
If this is the right way to solve the problem. May be it's needed to change schema. |
@alexqrid This was due to an philosophic impedance mismatch between the what The specific problem was fixed in IntersectMBO/cardano-db-sync#352 and the more general philosophical problem was fixed in IntersectMBO/cardano-db-sync#358 . From now until the next release from the |
I still don't understand the justification for not screening nonsensical values on pool registration. As a pool explorer, I am now bound to faithfully display a pledge of 72B ADA to reflect the actual value as registered even though it makes no sense. I agree that there will need to be unbounded integer values all over the infrastructure, but where we can bound them we should. My 0.02 lovelaces |
The philosophy of the Shelley ledger rules is to enforce only the necessary constraints. It's the Occam's razor approach: if a constraint is not necessary for the correct functioning of the ledger then it is not included. This gives an intellectual clarity: it should be possible to point at any constraint in the rules and say why it's needed. This would not be the case if there were redundant checks. This philosophy means for example that the ledger rules do not prevent people from declaring pool pledges that they could not possibly satisfy. It is not prevented because it is unnecessary to do so: the pledge will not be satisfied anyway. Similarly the ledger rules do not check that tx outputs are less than the total circulation in supply. It is unnecessary to do that, since such a check is redundant. It is already checked by the fact that the inputs and outputs must balance.
That is true, but this is unavoidable. There is no cut-off could we pick that would separate the sense from the nonsense. Is a 200M pledge sense or nonsense? What about 300M? The fact is it is impossible to say in advance what values can make any sense, and this will change over time as the amount in circulation grows and the value of K changes. What we can say precisely is when a pledge is being met, either right now or at an epoch boundary. So what Daedalus does, and what a pool explorer could do, is to show when a pool's pledge is not currently being met. This is much more useful than trying to find some line in the sand for unrealistically large pledges. Then it doesn't matter what stupid value someone has pledged: they're not meeting their pledge. You don't even have to show what the pledge value is in that case.
And note that we do bound them, by bounding types like Word64 or Int64. |
Working on
db-sync
I had a failure to insert aPoolParam
struct which after some debugging turned out to be due to a pledge amount being greater thanmaxLoveLace
.Obviously a pledge about of this size make no sense and the transaction including this pledge amount should be rejected and not included on the chain.
The text was updated successfully, but these errors were encountered: