Skip to content
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

Sam/expose budget multiplier #119

Merged
merged 8 commits into from
Jun 15, 2022
Merged

Conversation

samuelWilliams99
Copy link
Contributor

No description provided.

@samuelWilliams99 samuelWilliams99 added the enhancement New feature or request label Jun 14, 2022
@@ -37,19 +41,49 @@ estimateBudget pabConf txFile = do
Raw rp -> deserialiseRaw rp
Signed sp -> fmap CAPI.getTxBody <$> deserialiseSigned sp

pparamsRes <- QueryNode.queryProtocolParams debugNodeInf
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure which way is better, but protocol params can be pulled from PABConfig.
(slot <-> time conversions now use pparams from PABConfig).

It feels like getting them from PABConfig will be safer as cardano-cli will use that also.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I saw this ticket and assumed we wanted to move over to using the node for everything over time #112
I can switch to params if we'd prefer?
I bellieve if the cli uses params that don't match the node, it'll fail regardless, no?

Copy link
Collaborator

@mikekeke mikekeke Jun 14, 2022

Choose a reason for hiding this comment

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

I bellieve if the cli uses params that don't match the node, it'll fail regardless, no?

Can't say with confidence =)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I love cardano :)

getScaledBudget maxUnits scaler budget =
if fst scalers >= 1 && snd scalers >= 1
then Right $ fmap (fmap $ scaleBudget scalers) budget
else Left $ BudgetEstimationError "Exceeded global transaction budget"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it could be helpful if current maximum and calculated budgets will be printed together with the error message.

@samuelWilliams99 samuelWilliams99 merged commit 405bfc9 into master Jun 15, 2022
@samuelWilliams99 samuelWilliams99 deleted the sam/expose-budget-multiplier branch June 15, 2022 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants