ethereum / ethereum/populus

Validate value lengths when linking bytecode

Open
#312 7 comments 0 reactions 0 assignees View on GitHub
Good First Issue
Dominant language
No language data
Stars
319
Forks
110
PR merge metrics
No merged PRs in 30d

Description

### What is wrong?

Populus uses the function [`populus.utils.link_bytecode`](https://github.com/pipermerriam/populus/blob/master/populus/utils/linking.py#L107) to transform unlinked bytecode into it's fully linked representation. This is done by providing a mapping of values that should be substituted for each link reference.

Currently, the linking process does not validate that the value being linked is of the appropriate size for the link reference location in the bytecode.

### How can it be fixed?

Add logic to this function which iterates through the paired link references and values and checks that all values are of the appropriate length for their respective link references.

#306 is a blocker which must be merged prior to this ticket being actionable.

#### Cute Animal Picture

> put a cute animal picture here.

![108c643a0a956d03551bad79c3a5844b](https://user-images.githubusercontent.com/824194/28338874-7993b40e-6bc7-11e7-850a-d65b4b81000e.jpg)

Contributor guide

No contributing guide indexed for this repository

Research direction

Read populus/utils/linking.py at the link_bytecode function, after blocker #306 has been merged. Follow how paired link references and values are processed, then add validation that each value matches its reference length. Done means inappropriate lengths are rejected before bytecode linking proceeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
blockchain, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.