Add a way to pad transactions' size if needed by Simplicity cost metric

Open
#260 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust
Domain
blockchain

Research direction

The issue names rust-elements but no file or test. Start by locating transaction weight and serialization entry points and the existing Simplicity cost handling; then determine the padding basis and required coverage. Done means a standardized, tested mechanism for padding transactions to the required weight is implemented.

Written by the indexing model from the issue text.

Description

Simplicity transactions have an additional "cost" associated with the computational resources consumed by verification of the results of executing the contract.

This cost is paid for by ensuring that the transaction has a sufficiently high weight (using conventional weight calculations) to cause the associated fee to be adequate according to the cost formula. Currently, most typical Simplicity programs inherently produce large enough transactions to satisfy this requirement, so there hasn't been a need to artificially increase the size of their transactions in order to get them accepted by Liquid nodes. However, this might not always be the case for more computationally-intensive contracts in the future, e.g. those that use loops or that call expensive jets repeatedly for some reason.

So, we could use a standardized way to pad transactions to make them deliberately larger when this turns out to be required by the cost formula.

@apoelstra suggested that the appropriate place to specify and implement the basis for this is here in rust-elements.

Dominant language
Rust
Stars
57
Forks
40
Avg merge
11h 58m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ElementsProject/rust-elements

All issues in ElementsProject/rust-elements

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.