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

Make base extrinsic weight stable for capacity txs #1215

Closed
enddynayn opened this issue Mar 9, 2023 · 0 comments · Fixed by #1455
Closed

Make base extrinsic weight stable for capacity txs #1215

enddynayn opened this issue Mar 9, 2023 · 0 comments · Fixed by #1455
Assignees
Labels
Capacity Capacity Transactions

Comments

@enddynayn
Copy link
Collaborator

enddynayn commented Mar 9, 2023

Description
Capacity transactions are meant to be stable and not affected by network congestion.

Additionally, unlike token transactions, capacity transactions
do not allow tipping or multiplying the weight
fee by a targeted_fee_adjustment.

The fee for a capacity transaction:

fee = base_fee + length_fee + weight_fee
----- ^^^^
----- ^^^^

The base_fee is not static and can change when we run overhead benchmarks.

Acceptance Criteria:

  • Ensure that the base_extrinsic weight does not change for Capacity transactions.
  • Add comment to weight to fee function to warn that it also changes static capacity weights if changed.

Note
Weights for capacity are a
snapshot of weights calculated from benchmarks.
These weights are static and are not updated.
Similarly, we would want to create a constant containing a snapshot of
extrinsic base weight.

@wilwade check

@enddynayn enddynayn added the Capacity Capacity Transactions label Mar 9, 2023
@p5150j p5150j transferred this issue from frequency-chain/docs Mar 10, 2023
mattheworris added a commit that referenced this issue May 3, 2023
…ansactions. (#1455)

# Goal
Ensure that the `base_extrinsic` weight does not change for Capacity
transactions.

Closes #1215

# Discussion
Created a new constant `CAPACITY_EXTRINSIC_BASE_WEIGHT` as a snapshot of
the benchmarks in: `runtime/common/src/weights/extrinsic_weights.rs`.

This change required updates to the unit tests, as this new constant
overrides the `base_extrinsic` in the `mock.rs`, the test accounts
required more tokens to cover the transaction costs.

# Checklist
- [ ] Chain spec updated
- [ ] Custom RPC OR Runtime API added/changed? Updated js/api-augment.
- [ ] Design doc(s) updated
- [ ] Tests added
- [ ] Benchmarks added
- [ ] Weights updated

---------

Co-authored-by: Matthew Orris <--help>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Capacity Capacity Transactions
Projects
None yet
3 participants