stacks-network / stacks-network/stacks-core

Principal size calculation is too simple

Open
#6,887 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3.1k
Forks
762
Avg merge
4d 6h
Merged PRs (30d)
76

Description

Currently the size for a principal is just using the size of the type. This means that a standard principal, which should just be size 20 is being assessed a size of 148, the max possible size of a contract principal (20 for the standard principal plus 128 character contract name). If this size is used for cost computations, then contracts are being overcharged.

Contributor guide

Open the contributing guide

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.

Research direction

No file or test is named in the issue. Start by locating the Rust code that calculates principal size, then compare the standard principal and contract principal cases described here. Done means standard principals use size 20 while contract principals account for the contract name, so cost computations no longer overcharge standard principals.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.