-
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
Add possibility to query local node to load protocol parameters - transaction build
#5054
base: master
Are you sure you want to change the base?
Conversation
62079cf
to
3b33373
Compare
transaction build
Might be good to demonstrate the change does what is intended somehow. For example in tests, or at least running the command manually and verifying results and pasting them in the PR. |
3b33373
to
2713502
Compare
2713502
to
6044cc2
Compare
@@ -469,6 +470,11 @@ renderGenesisCmd cmd = | |||
-- Shelley CLI flag/option data types | |||
-- | |||
|
|||
data ProtocolParamsSource | |||
= ProtocolParamsFromFile !ProtocolParamsFile | |||
| ProtocolParamsQueryNode !NetworkId !AnyConsensusModeParams |
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.
The issue with this type is, in the situation where we want to query the node for the protocol parameters, we already have NetworkId
and AnyConsensusModeParams
values available to us.
@@ -323,14 +323,14 @@ runTxBuildCmd | |||
-> TxMetadataJsonSchema | |||
-> [ScriptFile] | |||
-> [MetadataFile] | |||
-> Maybe ProtocolParamsFile | |||
-> Maybe ProtocolParamsSource |
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.
So I think what you want to do here is change Maybe ProtocolParamsFile
to ProtocolParamsSource
. In the case of Maybe ProtocolParamsFile
the Nothing
case corresponded to querying the node for the ProtocolParameters
value.
TxInCount | ||
TxOutCount | ||
TxShelleyWitnessCount | ||
TxByronWitnessCount | ||
| TxCalculateMinRequiredUTxO | ||
AnyCardanoEra | ||
ProtocolParamsFile | ||
ProtocolParamsSource |
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.
The problem here is TxCalculateMinRequiredUTxO
is an offline cli command i.e does not necessitate having a running node in the background.
@@ -238,14 +239,14 @@ data TransactionCmd | |||
| TxCalculateMinFee | |||
TxBodyFile | |||
(Maybe NetworkId) | |||
ProtocolParamsFile | |||
ProtocolParamsSource |
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.
Likewise here, this is an offline command.
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.
You can't use ProtocolParamsSource
here because it's an offline command i.e you do not have to run a node to use it.
@@ -185,7 +186,7 @@ data TransactionCmd | |||
[ScriptFile] | |||
-- ^ Auxiliary scripts | |||
[MetadataFile] | |||
(Maybe ProtocolParamsFile) | |||
(Maybe ProtocolParamsSource) |
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.
build-raw is also an offline cli command
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.
You can't use ProtocolParamsSource
here because it's an offline command i.e you do not have to run a node to use it.
@@ -361,8 +361,8 @@ runTxBuildCmd | |||
scripts <- firstExceptT ShelleyTxCmdScriptFileError $ | |||
mapM (readFileScriptInAnyLang . unScriptFile) scriptFiles | |||
txAuxScripts <- hoistEither $ first ShelleyTxCmdAuxScriptsValidationError $ validateTxAuxScripts cEra scripts | |||
mpparams <- forM mProtocolParamsFile $ \ppf -> | |||
firstExceptT ShelleyTxCmdProtocolParamsError (readProtocolParameters ppf) | |||
mpparams <- forM mProtocolParamsSource $ \pps -> |
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.
This has already been deprecated and we already query the node for the ProtocolParameters
: https://github.com/input-output-hk/cardano-node/blob/master/cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs#L651
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.
Good point. mpparams
isn't used anywhere further.
This PR is stale because it has been open 45 days with no activity. |
@@ -238,14 +239,14 @@ data TransactionCmd | |||
| TxCalculateMinFee | |||
TxBodyFile | |||
(Maybe NetworkId) | |||
ProtocolParamsFile | |||
ProtocolParamsSource |
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.
You can't use ProtocolParamsSource
here because it's an offline command i.e you do not have to run a node to use it.
@@ -185,7 +186,7 @@ data TransactionCmd | |||
[ScriptFile] | |||
-- ^ Auxiliary scripts | |||
[MetadataFile] | |||
(Maybe ProtocolParamsFile) | |||
(Maybe ProtocolParamsSource) |
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.
You can't use ProtocolParamsSource
here because it's an offline command i.e you do not have to run a node to use it.
This PR adds possibility to query local node for protocol parameters for
transaction build
command. This is a first part of implementation for #5052.