Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Transaction cost model for bankless leader #16641

Closed
tao-stones opened this issue Apr 19, 2021 · 1 comment · Fixed by #16694
Closed

Transaction cost model for bankless leader #16641

tao-stones opened this issue Apr 19, 2021 · 1 comment · Fixed by #16694
Assignees
Milestone

Comments

@tao-stones
Copy link
Contributor

tao-stones commented Apr 19, 2021

Problem

Needed by #5395 to limit number of transaction in a block.

Proposed Solution

  1. new cost model

    • is configured with two limits: max block cost, and max same account transaction cost.
    • integrated into banking_stage, shared amount threads.
    • is reset when new bank is introduced.
    • Keeps tracking current bank's costs, when a transaction would breach either block or account cost limit, it will be placed into leader's retry queue.
  2. the cost limits used to configure cost model (described above) are collected from mainnet, they are to encourage parallelizeble transactions as well as to limit block size;

  3. determine cost of an transaction:

    • transaction cost = account access cost + instruction execution cost, where
    • account access cost is the sum of accounts instruction accesses, writable is more expansive than read
    • instruction execution cost is maintained in a table, known instrument execution time are collected from cluster; whereas new on-chain program is given a high default value when it is added to the table; replay stage will feed the actual execution cost back to cost model.
@tao-stones
Copy link
Contributor Author

visit the approach with @sakridge , updated description regarding account access cost and instruction cost

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants