-
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
LocalStateQuery: Use params from chain when building txs #1577
Comments
1593: cardano-node: 1.10.1 -> 1.11.0 r=rvl a=rvl # Issue Number Relates to #1577 / ADP-83. # Overview - Updates cardano-node version in nix. - Updates the cardano-haskell stack snapshot. - Adds `cardano-cli` to the shell. I am hoping to use this in the integration tests. - Build fixes # Comments WIP until input-output-hk/cardano-haskell#13 is merged. Co-authored-by: Rodney Lorrimar <[email protected]>
1587: Cabal: Set -Werror and -Ox only with release flag r=rvl a=rvl Makes Cabal builds faster, like the `stack build --fast` flag. Nothing is changed when the development flag is unset. Some components are missing `-O`, and most others are at `-O2`. However, from what I've read, `-O2` often doesn't help, so you only use it if your benchmarks say so. 1593: cardano-node: 1.10.1 -> 1.11.0 r=rvl a=rvl # Issue Number Relates to #1577 / ADP-83. # Overview - Updates cardano-node version in nix. - Updates the cardano-haskell stack snapshot. - Adds `cardano-cli` to the shell. I am hoping to use this in the integration tests. - Build fixes # Comments WIP until input-output-hk/cardano-haskell#13 is merged. Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: IOHK <[email protected]>
1580: Add LocalStateQuery to byron network layer r=rvl a=rvl ### Issue Number Relates to #1577 / [ADP-83](https://jira.iohk.io/projects/ADP/issues/ADP-83). ### Overview - [x] Updates ouroboros-network and cardano-node to latest master versions - [x] Initial try at LocalStateQuery client in network layer. - [x] Get latest tx parameters when fetching the block tip. - [x] Store tx parameters in database while following the chain. - [x] Use tx parameters from database when creating transactions. ### Comments The TRANS_CREATE integration tests which check the fee should cover this. The only way the wallet can get TxParameters is through the node protocol parameters state. ### Next PRs - [ ] Marcin says to use `defaultCodecs` or `clientCodecs` rather than constructing our own codecs. These functions require a `BlockConfig ByronBlock`. Which means that we would need to modify parseGenesisData, etc, etc. So this can be another PR ⇒ #1606. - [ ] Integration test where new protocol parameters are proposed and accepted. It should test that the new tx max size and fee policy apply. This will require cardano-cli to update the node's parameters. However the update proposal function of cardano-cli is not yet complete. Co-authored-by: Rodney Lorrimar <[email protected]>
1606: Don't deserialise blocks in the chain sync node client r=KtorZ a=rvl # Issue Number Relates to #1577 / ADP-83. # Overview The chain tip following node client doesn't need to serialise blocks. So use bytestring representation for blocks in this part. # Comments I attempted to change it to use `defaultCodecs` (serialised) / `clientCodecs` (deserialised) to help when upgrading the node version, but it is quite difficult to set up the arguments `mkByronConfig`. Not to mention there are two different `NodeToClientVersion` types that need to be imported. So I gave up on this. Co-authored-by: iohk-bors[bot] <43231472+iohk-bors[bot]@users.noreply.github.com> Co-authored-by: Rodney Lorrimar <[email protected]>
1610: Buildkite all-tests-pass branch r=rvl a=rvl ### Overview - Some buildkite fixes. - Trigger buildkite nightly pipeline from github actions, after the windows tests pass. - Push the `all-tests-pass` branch after the nightly job successfully completes. - Add a github tag filter to the docker image push script. Otherwise, if the buildkite ref filter were removed, and someone pushed any tag, then the "latest" docker tags would be updated to that tag. - Bump haskell.nix revision while we're at it. 1624: Fix migration error on checkpoint table r=rvl a=rvl ### Issue Number Relates to #1577 / ADP-83 and #1621. ### Overview Fix migration error on checkpoint table found in nightly tests. SQLite doesn't support removing columns, so we put them back as "unused" fields (https://www.sqlite.org/lang_altertable.html#altertableishard). 1627: Bump version from 2020.4.28 to 2020.5.6 r=rvl a=rvl - Updates the cabal package versions from 2020.4.28 to 2020.5.6. - A few shell script tweaks to the release script. Co-authored-by: Rodney Lorrimar <[email protected]>
1624: Fix migration error on checkpoint table r=rvl a=rvl ### Issue Number Relates to #1577 / ADP-83 and #1621. ### Overview Fix migration error on checkpoint table found in nightly tests. SQLite doesn't support removing columns, so we put them back as "unused" fields (https://www.sqlite.org/lang_altertable.html#altertableishard). 1627: Bump version from 2020.4.28 to 2020.5.6 r=rvl a=rvl - Updates the cabal package versions from 2020.4.28 to 2020.5.6. - A few shell script tweaks to the release script. Co-authored-by: Rodney Lorrimar <[email protected]>
1630: Reduce logging from network layer r=rvl a=rvl ### Issue Number Relates to #1577 / ADP-83. ### Overview - Set network tip log level to debug - Improve formatting of text log message - Only log the tip when it changes, because the node can seem to send updates when nothing changes ### Comments This is what it looks like now: ``` [cardano-wallet.network:Debug:18] [2020-05-06 07:49:54.10 UTC] Network node tip block height is 4125310 at hash c5cb3bcd ``` 1633: review RELEASE_TEMPLATE to constuct changelog from PR + labels r=rvl a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> N/A # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> We used to organize the CHANGELOG by milestones, but we are now organizing it by 'type of change' (improvement, bug fix, addition). Therefore, the current thing called CHANGELOG is redundant with the other. I've tweaked the 'make_changelog' script to build a changelog according to these categories, provided that PR were labelled accordingly. # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: Matthias Benkort <[email protected]> Co-authored-by: KtorZ <[email protected]>
1630: Reduce logging from network layer r=rvl a=rvl ### Issue Number Relates to #1577 / ADP-83. ### Overview - Set network tip log level to debug - Improve formatting of text log message - Only log the tip when it changes, because the node can seem to send updates when nothing changes ### Comments This is what it looks like now: ``` [cardano-wallet.network:Debug:18] [2020-05-06 07:49:54.10 UTC] Network node tip block height is 4125310 at hash c5cb3bcd ``` Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: Matthias Benkort <[email protected]>
1630: Reduce logging from network layer r=rvl a=rvl ### Issue Number Relates to #1577 / ADP-83. ### Overview - Set network tip log level to debug - Improve formatting of text log message - Only log the tip when it changes, because the node can seem to send updates when nothing changes ### Comments This is what it looks like now: ``` [cardano-wallet.network:Debug:18] [2020-05-06 07:49:54.10 UTC] Network node tip block height is 4125310 at hash c5cb3bcd ``` Co-authored-by: Rodney Lorrimar <[email protected]>
@rvl looks good, I just have few questions:
Not sure if it is possibly related but I raised DB migration issue -> #1649
Does that mean we could/should update existing integration tests for transactions to verify this (or add some new integration test checking this)
|
Thanks @piotr-iohk
I do not think it's related. The two causes are port conflicts and
I decided that a parameter change integration test will be slow and flaky. Something I could possibly do for the integration tests is set the initial TxParameters to dummy values. Then the transaction tests will show that the parameters did successfully update once. But I did not do that because it adds a bit of "wtf?" code to
The two tx parameters were never included in this endpoint, so it stays exactly the same. |
ok, closing. 👍 |
Context
Part of ADP-83.
The wallet server must keep track of certain protocol parameters that may change through soft protocol updates. The current parameters of interest both relate to transaction construction:
These two parameters are needed when building a transaction before running the coin selection.
Relevant parameter functions are:
The state machine types are in
Ouroboros.Network.Protocol.LocalStateQuery.Client
.With cardano-node since revision 0172a96e16f46f1688da6dd8294481bb995fd72d, a new entry is added to NodeToClientProtocols that we can use. In our network layer
Cardano.Wallet.Byron.Network
we need to make room for this protocol.Example code exists in
Ouroboros.Network.Protocol.LocalStateQuery.Example
:In the wallet engine are already blockchain parameters stored in the database with every wallet checkpoint.
Note that for transaction construction, only the parameters for the network tip are relevant. A transaction obviously cannot be inserted into the chain under the network tip.
The node only maintains local state for the last k blocks from its tip.
The type
Cardano.Chain.Update.ProtocolParameters
is the values that the node supports updates for. The intersection of this type andCardano.Wallet.Primitive.Types.BlockchainParameters
is the following three fields:- ppSlotDuration (getSlotLength)
- ppMaxTxSize
- ppTxFeePolicy
Decision
Option A - parameters from checkpoint
The present code structure has the full bundle of parameters stored in each wallet checkpoint. So it's convenient to use the parameters from the wallet tip (not network tip) when constructing a transaction.
So, for each wallet, after fetching the latest blocks, use
LocalStateQuery
to get the blockchain parameters for the wallet tip.Save these dynamic blockchain parameters into the wallet checkpoint after applying the latest blocks.
Option B - request latest parameters when constructing tx
Add a method to
NetworkLayer
something like thisUse this function before running coin selection to get the tx max size and fee policy.
Possible problem
The LocalStateQuery client is not synchronised with the ChainSync client. So there is a race condition between getting the tip point and querying the parameters for this point.
Acceptance Criteria
Development
QA
Cardano.Wallet.Byron.NetworkSpec.spec
which tests querying protocol parameters from the node.lib/byron/test/integration/Main.hs:182
.DB Migrations
There will be a new tx_parameters table added, but no other fields are modified. So automatic migrations will be ok.
The text was updated successfully, but these errors were encountered: