-
Notifications
You must be signed in to change notification settings - Fork 213
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
Estimate max number of allowed inputs in coin selection #462
Comments
|
|
Moving this back to I'll add a bullet point to the ticket and make sure it's used. |
@rvl I've also extended the QA section with links. The idea is really to make the work easy for @piotr-iohk and avoid having him figuring out where to look for the tests. We're starting to have a rather big codebase, with tests spread across many modules, and even though there are some naming convention, it's always good to point at the information you want to highlight 👍 |
I thought the corresponding wallet layer functions would be implemented in another ticket. There is nothing in the AC about it. |
lgtm 👍 Sort of related tests are in #533. |
Context
We currently use a hard-coded limit of
10
inputs for a single transaction. This is pretty far from what reality allows.https://github.com/input-output-hk/cardano-wallet/blob/eccc130290f71a18b471f2e16a31614b3cddc2d4/lib/core/src/Cardano/Wallet/Api/Server.hs#L363-L364
When working on benchmarking, we've already explored a bit the true limitation of the system, although based on a transaction max size known a priori (
8kb
):https://github.com/input-output-hk/cardano-wallet/blob/master/lib/core/test/bench/db/Main.hs#L183-L229
Decision
How many inputs are we allowed to select is a tricky question to answer in practice because not all inputs are born equals! One inputs may increase the transaction's size more than another one (and vice-versa) because of the impact it has on change.
Therefore, a simpler strategy to adopt would be to:
This would be fairly resilient in practice and be a real best-effort at constructing transactions with the downside of sometimes wasting computing power in making selection for transactions that will require too many inputs already.
Acceptance Criteria
For each binary format / backend target, we
must
compute a theoretical maximum number of inputs from a given transaction's max size (https://github.com/input-output-hk/cardano-wallet/blob/master/lib/core/test/bench/db/Main.hs#L183-L229 is a good starting point).TransactionLayer
forhttp-bridge
must be extended with a function:TransactionLayer
forjormungandr
must be extended with a similar function.Both implementation must include extensive comments about where the results come from and what hypotheses or simplifications were made.
Development Plan
estimateMaxNumberOfInputs
function. Something like larger transaction ⇒ higher maximum for inputs. Make sure generator includes boundaries of the Word16 parameter.txMaxSize
?PR
master
master
QA
The new functions have unit tests. See Cardano/Wallet/TransactionSpecShared
The implementations are documented adequately with source code comments. See Cardano/Wallet/Transaction
The text was updated successfully, but these errors were encountered: